{"action":"created","issue":{"url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/issues/43","repository_url":"https://api.github.com/repos/miedzinski195659/zwinne-wks","labels_url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/issues/43/comments","events_url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/issues/43/events","html_url":"https://github.com/miedzinski195659/zwinne-wks/pull/43","id":322139585,"number":43,"title":"Zmzpwyb 14","user":{"login":"nullJaX","id":19861372,"avatar_url":"https://avatars3.githubusercontent.com/u/19861372?v=4","gravatar_id":"","url":"https://api.github.com/users/nullJaX","html_url":"https://github.com/nullJaX","followers_url":"https://api.github.com/users/nullJaX/followers","following_url":"https://api.github.com/users/nullJaX/following{/other_user}","gists_url":"https://api.github.com/users/nullJaX/gists{/gist_id}","starred_url":"https://api.github.com/users/nullJaX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nullJaX/subscriptions","organizations_url":"https://api.github.com/users/nullJaX/orgs","repos_url":"https://api.github.com/users/nullJaX/repos","events_url":"https://api.github.com/users/nullJaX/events{/privacy}","received_events_url":"https://api.github.com/users/nullJaX/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-11T01:40:05Z","updated_at":"2018-05-11T17:10:55Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/pulls/43","html_url":"https://github.com/miedzinski195659/zwinne-wks/pull/43","diff_url":"https://github.com/miedzinski195659/zwinne-wks/pull/43.diff","patch_url":"https://github.com/miedzinski195659/zwinne-wks/pull/43.patch"},"body":"Wprowadzenie wysyłania maila. Osoba robiąca _Code Review_ , aby przetestować działanie, powinna dodać następujący kod w kontrolerze **TestController** przy metodzie **xls()** :\r\n```\r\n//==========================================\r\n    @Autowired\r\n    private AccountsRepository accountsRepository;\r\n    \r\n    @Autowired\r\n    private MailService mailService;\r\n    //==========================================\r\n    \r\n    @RequestMapping(value = \"/{testId}/xls\", method = RequestMethod.GET)\r\n    public @ResponseBody\r\n    ResponseEntity generateXLS(@PathVariable String testId) {\r\n        try {\r\n            //==========================================\r\n            Collection<Account> accounts = this.accountsRepository.findAll();\r\n            TestAttempt ta;\r\n            for(Account a : accounts) {\r\n                if (a.getSolvedTests().size()>0) {\r\n                    ta = a.getSolvedTests().iterator().next();\r\n                    try {\r\n                        this.mailService.sendEmail(\"your_mail_here@gmail.com\", ta);\r\n                    } catch (MessagingException e) {\r\n                        e.printStackTrace();\r\n                    }\r\n                    break;\r\n                }\r\n            }\r\n            //==========================================\r\n            \r\n            Test test = this.testService.getTestById(testId);\r\n            byte[] out = this.xlsGeneratorUtil.generate(test);\r\n            //return file\r\n            HttpHeaders hHeaders = new HttpHeaders();\r\n            hHeaders.add(\"content-disposition\", \"attachment; filename=\" + test.getName() + \".xls\");\r\n            hHeaders.add(\"Content-Type\", \"application/vnd.ms-excel\");\r\n            return new ResponseEntity(out, hHeaders, HttpStatus.OK);\r\n        } catch (IOException | WKSRecruiterException e) {\r\n            return ResponseEntity.status(HttpStatus.CONFLICT).body(WKSRecruiterException.of(e));\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/issues/comments/388426339","html_url":"https://github.com/miedzinski195659/zwinne-wks/pull/43#issuecomment-388426339","issue_url":"https://api.github.com/repos/miedzinski195659/zwinne-wks/issues/43","id":388426339,"user":{"login":"nullJaX","id":19861372,"avatar_url":"https://avatars3.githubusercontent.com/u/19861372?v=4","gravatar_id":"","url":"https://api.github.com/users/nullJaX","html_url":"https://github.com/nullJaX","followers_url":"https://api.github.com/users/nullJaX/followers","following_url":"https://api.github.com/users/nullJaX/following{/other_user}","gists_url":"https://api.github.com/users/nullJaX/gists{/gist_id}","starred_url":"https://api.github.com/users/nullJaX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nullJaX/subscriptions","organizations_url":"https://api.github.com/users/nullJaX/orgs","repos_url":"https://api.github.com/users/nullJaX/repos","events_url":"https://api.github.com/users/nullJaX/events{/privacy}","received_events_url":"https://api.github.com/users/nullJaX/received_events","type":"User","site_admin":false},"created_at":"2018-05-11T17:10:55Z","updated_at":"2018-05-11T17:10:55Z","author_association":"COLLABORATOR","body":"Proszę o kołd riwju"}}
{"actor":{"display_login":"nullJaX"}}