{"action":"created","comment":{"url":"https://api.github.com/repos/mmanski/Cabzza/pulls/comments/47756983","id":47756983,"diff_hunk":"@@ -0,0 +1,134 @@\n+package com.pri.cabzza.web.rest;\n+\n+import com.codahale.metrics.annotation.Timed;\n+import com.pri.cabzza.domain.StockInfo;\n+import com.pri.cabzza.repository.StockInfoRepository;\n+import com.pri.cabzza.repository.search.StockInfoSearchRepository;\n+import com.pri.cabzza.web.rest.util.HeaderUtil;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.http.HttpHeaders;\n+import org.springframework.http.HttpStatus;\n+import org.springframework.http.MediaType;\n+import org.springframework.http.ResponseEntity;\n+import org.springframework.web.bind.annotation.*;\n+\n+import javax.inject.Inject;\n+import java.net.URI;\n+import java.net.URISyntaxException;\n+import java.util.List;\n+import java.util.Optional;\n+import java.util.stream.Collectors;\n+import java.util.stream.StreamSupport;\n+\n+import static org.elasticsearch.index.query.QueryBuilders.*;\n+\n+/**\n+ * REST controller for managing StockInfo.\n+ */\n+@RestController\n+@RequestMapping(\"/api\")\n+public class StockInfoResource {\n+\n+    private final Logger log = LoggerFactory.getLogger(StockInfoResource.class);\n+\n+    @Inject\n+    private StockInfoRepository stockInfoRepository;\n+\n+    @Inject\n+    private StockInfoSearchRepository stockInfoSearchRepository;\n+\n+    /**\n+     * POST  /stockInfos -> Create a new stockInfo.\n+     */\n+    @RequestMapping(value = \"/stockInfos\",\n+        method = RequestMethod.POST,\n+        produces = MediaType.APPLICATION_JSON_VALUE)\n+    @Timed\n+    public ResponseEntity<StockInfo> createStockInfo(@RequestBody StockInfo stockInfo) throws URISyntaxException {\n+        log.debug(\"REST request to save StockInfo : {}\", stockInfo);\n+        if (stockInfo.getId() != null) {\n+            return ResponseEntity.badRequest().header(\"Failure\", \"A new stockInfo cannot already have an ID\").body(null);\n+        }\n+        StockInfo result = stockInfoRepository.save(stockInfo);\n+        stockInfoSearchRepository.save(result);\n+        return ResponseEntity.created(new URI(\"/api/stockInfos/\" + result.getId()))\n+            .headers(HeaderUtil.createEntityCreationAlert(\"stockInfo\", result.getId().toString()))\n+            .body(result);\n+    }\n+\n+    /**\n+     * PUT  /stockInfos -> Updates an existing stockInfo.\n+     */\n+    @RequestMapping(value = \"/stockInfos\",\n+        method = RequestMethod.PUT,\n+        produces = MediaType.APPLICATION_JSON_VALUE)\n+    @Timed\n+    public ResponseEntity<StockInfo> updateStockInfo(@RequestBody StockInfo stockInfo) throws URISyntaxException {\n+        log.debug(\"REST request to update StockInfo : {}\", stockInfo);\n+        if (stockInfo.getId() == null) {\n+            return createStockInfo(stockInfo);\n+        }\n+        StockInfo result = stockInfoRepository.save(stockInfo);\n+        stockInfoSearchRepository.save(stockInfo);\n+        return ResponseEntity.ok()\n+            .headers(HeaderUtil.createEntityUpdateAlert(\"stockInfo\", stockInfo.getId().toString()))\n+            .body(result);\n+    }\n+\n+    /**\n+     * GET  /stockInfos -> get all the stockInfos.\n+     */\n+    @RequestMapping(value = \"/stockInfos\",\n+        method = RequestMethod.GET,\n+        produces = MediaType.APPLICATION_JSON_VALUE)\n+    @Timed\n+    public List<StockInfo> getAllStockInfos() {\n+        log.debug(\"REST request to get all StockInfos\");\n+        return stockInfoRepository.findAll();\n+    }\n+\n+    /**\n+     * GET  /stockInfos/:id -> get the \"id\" stockInfo.\n+     */\n+    @RequestMapping(value = \"/stockInfos/{id}\",\n+        method = RequestMethod.GET,\n+        produces = MediaType.APPLICATION_JSON_VALUE)\n+    @Timed\n+    public ResponseEntity<StockInfo> getStockInfo(@PathVariable Long id) {\n+        log.debug(\"REST request to get StockInfo : {}\", id);\n+        return Optional.ofNullable(stockInfoRepository.findOne(id))\n+            .map(stockInfo -> new ResponseEntity<>(\n+                stockInfo,","path":"src/main/java/com/pri/cabzza/web/rest/StockInfoResource.java","position":102,"original_position":102,"commit_id":"baf1185d6f0856781fe42e659fae0177d13f7635","original_commit_id":"baf1185d6f0856781fe42e659fae0177d13f7635","user":{"login":"mmanski","id":8754944,"avatar_url":"https://avatars.githubusercontent.com/u/8754944?v=3","gravatar_id":"","url":"https://api.github.com/users/mmanski","html_url":"https://github.com/mmanski","followers_url":"https://api.github.com/users/mmanski/followers","following_url":"https://api.github.com/users/mmanski/following{/other_user}","gists_url":"https://api.github.com/users/mmanski/gists{/gist_id}","starred_url":"https://api.github.com/users/mmanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmanski/subscriptions","organizations_url":"https://api.github.com/users/mmanski/orgs","repos_url":"https://api.github.com/users/mmanski/repos","events_url":"https://api.github.com/users/mmanski/events{/privacy}","received_events_url":"https://api.github.com/users/mmanski/received_events","type":"User","site_admin":false},"body":"please fix formatting here","created_at":"2015-12-16T10:06:43Z","updated_at":"2015-12-16T10:06:43Z","html_url":"https://github.com/mmanski/Cabzza/pull/7#discussion_r47756983","pull_request_url":"https://api.github.com/repos/mmanski/Cabzza/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/mmanski/Cabzza/pulls/comments/47756983"},"html":{"href":"https://github.com/mmanski/Cabzza/pull/7#discussion_r47756983"},"pull_request":{"href":"https://api.github.com/repos/mmanski/Cabzza/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/mmanski/Cabzza/pulls/7","id":53375016,"html_url":"https://github.com/mmanski/Cabzza/pull/7","diff_url":"https://github.com/mmanski/Cabzza/pull/7.diff","patch_url":"https://github.com/mmanski/Cabzza/pull/7.patch","issue_url":"https://api.github.com/repos/mmanski/Cabzza/issues/7","number":7,"state":"open","locked":false,"title":"Entites","user":{"login":"SobieS93","id":6418307,"avatar_url":"https://avatars.githubusercontent.com/u/6418307?v=3","gravatar_id":"","url":"https://api.github.com/users/SobieS93","html_url":"https://github.com/SobieS93","followers_url":"https://api.github.com/users/SobieS93/followers","following_url":"https://api.github.com/users/SobieS93/following{/other_user}","gists_url":"https://api.github.com/users/SobieS93/gists{/gist_id}","starred_url":"https://api.github.com/users/SobieS93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SobieS93/subscriptions","organizations_url":"https://api.github.com/users/SobieS93/orgs","repos_url":"https://api.github.com/users/SobieS93/repos","events_url":"https://api.github.com/users/SobieS93/events{/privacy}","received_events_url":"https://api.github.com/users/SobieS93/received_events","type":"User","site_admin":false},"body":"jhipster-entities added","created_at":"2015-12-11T10:18:25Z","updated_at":"2015-12-16T10:06:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6be75bf14b902de06061f393218fe58bad13a11d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mmanski/Cabzza/pulls/7/commits","review_comments_url":"https://api.github.com/repos/mmanski/Cabzza/pulls/7/comments","review_comment_url":"https://api.github.com/repos/mmanski/Cabzza/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mmanski/Cabzza/issues/7/comments","statuses_url":"https://api.github.com/repos/mmanski/Cabzza/statuses/baf1185d6f0856781fe42e659fae0177d13f7635","head":{"label":"mmanski:entites","ref":"entites","sha":"baf1185d6f0856781fe42e659fae0177d13f7635","user":{"login":"mmanski","id":8754944,"avatar_url":"https://avatars.githubusercontent.com/u/8754944?v=3","gravatar_id":"","url":"https://api.github.com/users/mmanski","html_url":"https://github.com/mmanski","followers_url":"https://api.github.com/users/mmanski/followers","following_url":"https://api.github.com/users/mmanski/following{/other_user}","gists_url":"https://api.github.com/users/mmanski/gists{/gist_id}","starred_url":"https://api.github.com/users/mmanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmanski/subscriptions","organizations_url":"https://api.github.com/users/mmanski/orgs","repos_url":"https://api.github.com/users/mmanski/repos","events_url":"https://api.github.com/users/mmanski/events{/privacy}","received_events_url":"https://api.github.com/users/mmanski/received_events","type":"User","site_admin":false},"repo":{"id":31781486,"name":"Cabzza","full_name":"mmanski/Cabzza","owner":{"login":"mmanski","id":8754944,"avatar_url":"https://avatars.githubusercontent.com/u/8754944?v=3","gravatar_id":"","url":"https://api.github.com/users/mmanski","html_url":"https://github.com/mmanski","followers_url":"https://api.github.com/users/mmanski/followers","following_url":"https://api.github.com/users/mmanski/following{/other_user}","gists_url":"https://api.github.com/users/mmanski/gists{/gist_id}","starred_url":"https://api.github.com/users/mmanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmanski/subscriptions","organizations_url":"https://api.github.com/users/mmanski/orgs","repos_url":"https://api.github.com/users/mmanski/repos","events_url":"https://api.github.com/users/mmanski/events{/privacy}","received_events_url":"https://api.github.com/users/mmanski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmanski/Cabzza","description":"","fork":false,"url":"https://api.github.com/repos/mmanski/Cabzza","forks_url":"https://api.github.com/repos/mmanski/Cabzza/forks","keys_url":"https://api.github.com/repos/mmanski/Cabzza/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmanski/Cabzza/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmanski/Cabzza/teams","hooks_url":"https://api.github.com/repos/mmanski/Cabzza/hooks","issue_events_url":"https://api.github.com/repos/mmanski/Cabzza/issues/events{/number}","events_url":"https://api.github.com/repos/mmanski/Cabzza/events","assignees_url":"https://api.github.com/repos/mmanski/Cabzza/assignees{/user}","branches_url":"https://api.github.com/repos/mmanski/Cabzza/branches{/branch}","tags_url":"https://api.github.com/repos/mmanski/Cabzza/tags","blobs_url":"https://api.github.com/repos/mmanski/Cabzza/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmanski/Cabzza/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmanski/Cabzza/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmanski/Cabzza/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmanski/Cabzza/statuses/{sha}","languages_url":"https://api.github.com/repos/mmanski/Cabzza/languages","stargazers_url":"https://api.github.com/repos/mmanski/Cabzza/stargazers","contributors_url":"https://api.github.com/repos/mmanski/Cabzza/contributors","subscribers_url":"https://api.github.com/repos/mmanski/Cabzza/subscribers","subscription_url":"https://api.github.com/repos/mmanski/Cabzza/subscription","commits_url":"https://api.github.com/repos/mmanski/Cabzza/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmanski/Cabzza/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmanski/Cabzza/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmanski/Cabzza/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmanski/Cabzza/contents/{+path}","compare_url":"https://api.github.com/repos/mmanski/Cabzza/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmanski/Cabzza/merges","archive_url":"https://api.github.com/repos/mmanski/Cabzza/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmanski/Cabzza/downloads","issues_url":"https://api.github.com/repos/mmanski/Cabzza/issues{/number}","pulls_url":"https://api.github.com/repos/mmanski/Cabzza/pulls{/number}","milestones_url":"https://api.github.com/repos/mmanski/Cabzza/milestones{/number}","notifications_url":"https://api.github.com/repos/mmanski/Cabzza/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmanski/Cabzza/labels{/name}","releases_url":"https://api.github.com/repos/mmanski/Cabzza/releases{/id}","created_at":"2015-03-06T17:51:46Z","updated_at":"2015-06-20T11:45:57Z","pushed_at":"2015-12-16T10:03:37Z","git_url":"git://github.com/mmanski/Cabzza.git","ssh_url":"git@github.com:mmanski/Cabzza.git","clone_url":"https://github.com/mmanski/Cabzza.git","svn_url":"https://github.com/mmanski/Cabzza","homepage":null,"size":43187,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"mmanski:jhipster-stack-switch","ref":"jhipster-stack-switch","sha":"03fd095842d4d4819b8c22591a046dd40f93601a","user":{"login":"mmanski","id":8754944,"avatar_url":"https://avatars.githubusercontent.com/u/8754944?v=3","gravatar_id":"","url":"https://api.github.com/users/mmanski","html_url":"https://github.com/mmanski","followers_url":"https://api.github.com/users/mmanski/followers","following_url":"https://api.github.com/users/mmanski/following{/other_user}","gists_url":"https://api.github.com/users/mmanski/gists{/gist_id}","starred_url":"https://api.github.com/users/mmanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmanski/subscriptions","organizations_url":"https://api.github.com/users/mmanski/orgs","repos_url":"https://api.github.com/users/mmanski/repos","events_url":"https://api.github.com/users/mmanski/events{/privacy}","received_events_url":"https://api.github.com/users/mmanski/received_events","type":"User","site_admin":false},"repo":{"id":31781486,"name":"Cabzza","full_name":"mmanski/Cabzza","owner":{"login":"mmanski","id":8754944,"avatar_url":"https://avatars.githubusercontent.com/u/8754944?v=3","gravatar_id":"","url":"https://api.github.com/users/mmanski","html_url":"https://github.com/mmanski","followers_url":"https://api.github.com/users/mmanski/followers","following_url":"https://api.github.com/users/mmanski/following{/other_user}","gists_url":"https://api.github.com/users/mmanski/gists{/gist_id}","starred_url":"https://api.github.com/users/mmanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmanski/subscriptions","organizations_url":"https://api.github.com/users/mmanski/orgs","repos_url":"https://api.github.com/users/mmanski/repos","events_url":"https://api.github.com/users/mmanski/events{/privacy}","received_events_url":"https://api.github.com/users/mmanski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmanski/Cabzza","description":"","fork":false,"url":"https://api.github.com/repos/mmanski/Cabzza","forks_url":"https://api.github.com/repos/mmanski/Cabzza/forks","keys_url":"https://api.github.com/repos/mmanski/Cabzza/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmanski/Cabzza/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmanski/Cabzza/teams","hooks_url":"https://api.github.com/repos/mmanski/Cabzza/hooks","issue_events_url":"https://api.github.com/repos/mmanski/Cabzza/issues/events{/number}","events_url":"https://api.github.com/repos/mmanski/Cabzza/events","assignees_url":"https://api.github.com/repos/mmanski/Cabzza/assignees{/user}","branches_url":"https://api.github.com/repos/mmanski/Cabzza/branches{/branch}","tags_url":"https://api.github.com/repos/mmanski/Cabzza/tags","blobs_url":"https://api.github.com/repos/mmanski/Cabzza/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmanski/Cabzza/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmanski/Cabzza/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmanski/Cabzza/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmanski/Cabzza/statuses/{sha}","languages_url":"https://api.github.com/repos/mmanski/Cabzza/languages","stargazers_url":"https://api.github.com/repos/mmanski/Cabzza/stargazers","contributors_url":"https://api.github.com/repos/mmanski/Cabzza/contributors","subscribers_url":"https://api.github.com/repos/mmanski/Cabzza/subscribers","subscription_url":"https://api.github.com/repos/mmanski/Cabzza/subscription","commits_url":"https://api.github.com/repos/mmanski/Cabzza/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmanski/Cabzza/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmanski/Cabzza/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmanski/Cabzza/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmanski/Cabzza/contents/{+path}","compare_url":"https://api.github.com/repos/mmanski/Cabzza/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmanski/Cabzza/merges","archive_url":"https://api.github.com/repos/mmanski/Cabzza/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmanski/Cabzza/downloads","issues_url":"https://api.github.com/repos/mmanski/Cabzza/issues{/number}","pulls_url":"https://api.github.com/repos/mmanski/Cabzza/pulls{/number}","milestones_url":"https://api.github.com/repos/mmanski/Cabzza/milestones{/number}","notifications_url":"https://api.github.com/repos/mmanski/Cabzza/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmanski/Cabzza/labels{/name}","releases_url":"https://api.github.com/repos/mmanski/Cabzza/releases{/id}","created_at":"2015-03-06T17:51:46Z","updated_at":"2015-06-20T11:45:57Z","pushed_at":"2015-12-16T10:03:37Z","git_url":"git://github.com/mmanski/Cabzza.git","ssh_url":"git@github.com:mmanski/Cabzza.git","clone_url":"https://github.com/mmanski/Cabzza.git","svn_url":"https://github.com/mmanski/Cabzza","homepage":null,"size":43187,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mmanski/Cabzza/pulls/7"},"html":{"href":"https://github.com/mmanski/Cabzza/pull/7"},"issue":{"href":"https://api.github.com/repos/mmanski/Cabzza/issues/7"},"comments":{"href":"https://api.github.com/repos/mmanski/Cabzza/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/mmanski/Cabzza/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/mmanski/Cabzza/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mmanski/Cabzza/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/mmanski/Cabzza/statuses/baf1185d6f0856781fe42e659fae0177d13f7635"}}}}