@RestController
@RequestMapping("notice")
public class NoticeController {
@Autowired
MsgService msgService;
/**
* 查询当前用户 通知列表
*
* @param msg msg.userUid 为必填项
* @param page
* @return
*/
@RequestMapping(method = RequestMethod.GET)
public ApiResult listNotice(MsgBase msg, MsgPage page) {
if (StringUtils.isEmpty(msg.getUserUid())) {
return new ApiResult(401, "fail", 3001, "unauthorized");
}
try {
page = msgService.queryPageForNotice(msg, page);
long unreadTotal = msgService.listUnReadMsgByUserUid(msg.getUserUid());
page.setUnreadTotal(unreadTotal);
return ApiResult.success(page);
} catch (Exception e) {
e.printStackTrace();
return ApiResult.sysError();
}
}
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |