@Test public void newsUnreadCount() throws Exception { when(feedService.countUnread(isA(ClientAppUserAccessToken.class))).thenReturn(11); oauthPerform(user, get("/v1/feed/news-unread-count")).andExpect(status().isOk()) .andExpect(jsonPath("$.data", is(11))); }
@ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) public int newsUnreadCount(ClientAppUserAccessToken token) { return feedService.countUnread(token); }
V1FeedResource { @ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) public int newsUnreadCount(ClientAppUserAccessToken token) { return feedService.countUnread(token); } }
V1FeedResource { @ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) public int newsUnreadCount(ClientAppUserAccessToken token) { return feedService.countUnread(token); }  }
V1FeedResource { @ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) public int newsUnreadCount(ClientAppUserAccessToken token) { return feedService.countUnread(token); }  @ApiOperation(value = "[feed] Latest news", notes = "List latest FeedAssets, 25 assets a page. " + "To retrieve next page, passing last asset id of previous page in parameter start-asset-id.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news", method = RequestMethod.GET) List<V1FeedAssetDto> news(ClientAppUserAccessToken token,
      @RequestParam(value = "start-asset-id", required = false) FlakeId startAssetId); @ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) int newsUnreadCount(ClientAppUserAccessToken token); @ApiOperation(value = "[feed] Acknowledge a FeedAsset", notes = "A FeedAsset set to acknowledged will treat all assets before it as read. " + "Typically you should acknowledge the latest feedAssetId you received " + "when the user open news feed window in your app.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/acknowledge", method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE }) void acknowledge(ClientAppUserAccessToken token,
      @Valid @RequestBody AcknowledgeEntry entry); }
V1FeedResource { @ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) public int newsUnreadCount(ClientAppUserAccessToken token) { return feedService.countUnread(token); }  @ApiOperation(value = "[feed] Latest news", notes = "List latest FeedAssets, 25 assets a page. " + "To retrieve next page, passing last asset id of previous page in parameter start-asset-id.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news", method = RequestMethod.GET) List<V1FeedAssetDto> news(ClientAppUserAccessToken token,
      @RequestParam(value = "start-asset-id", required = false) FlakeId startAssetId); @ApiOperation(value = "[feed] Get unread count in news feed", notes = "Get unread count in news feed, max value is 11 regardless real unread count. " + "The method should not repeat invoke in short time, we recommend once per 5 minutes.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/news-unread-count", method = RequestMethod.GET) int newsUnreadCount(ClientAppUserAccessToken token); @ApiOperation(value = "[feed] Acknowledge a FeedAsset", notes = "A FeedAsset set to acknowledged will treat all assets before it as read. " + "Typically you should acknowledge the latest feedAssetId you received " + "when the user open news feed window in your app.") @RequiredScope(ClientAppScope.FEED) @RequestMapping(value = "/acknowledge", method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE }) void acknowledge(ClientAppUserAccessToken token,
      @Valid @RequestBody AcknowledgeEntry entry);  }