| package com.doumee.cloud.web; | 
|   | 
| import com.doumee.api.BaseController; | 
| import com.doumee.core.annotation.trace.Trace; | 
| import com.doumee.service.business.third.model.ApiResponse; | 
| import com.doumee.service.business.third.model.LoginUserInfo; | 
| import com.doumee.service.business.third.model.PageData; | 
| import com.doumee.service.business.third.model.PageWrap; | 
| import com.doumee.core.utils.Constants; | 
| import com.doumee.dao.system.model.Notices; | 
| import com.doumee.service.system.NoticesService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| @Api(tags = "消息通知信业务") | 
| @Trace(exclude = true) | 
| @RestController | 
| @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/notice") | 
| @Slf4j | 
| public class NoticeApi extends BaseController { | 
|   | 
|     @Autowired | 
|     private NoticesService noticeService; | 
|   | 
|   | 
|     /** | 
|      * 查询用户通知 | 
|      * @param pageWrap | 
|      * @return | 
|      */ | 
|     @ApiOperation(value = "查询用户通知", notes = "小程序端") | 
|     @PostMapping("/findNoticePage") | 
|     public ApiResponse<PageData<Notices>> findNoticePage(@RequestBody PageWrap<Notices> pageWrap | 
|             ,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|         LoginUserInfo user = getLoginUser(token); | 
|         pageWrap.getModel().setUserId(user.getId()); | 
|         return ApiResponse.success("查询成功",noticeService.findPage(pageWrap)); | 
|     } | 
|   | 
|   | 
|   | 
|     /** | 
|      * 用户更新阅读状态 | 
|      * @param id | 
|      * @return | 
|      */ | 
|     @ApiOperation(value = "用户更新阅读状态", notes = "小程序端") | 
|     @GetMapping("/getMemberDTO") | 
|     public ApiResponse hasRead(@RequestParam Integer id){ | 
|         Notices notice = new Notices(); | 
|         notice.setId(id); | 
|         notice.setStatus(Constants.ONE); | 
|         noticeService.updateById(notice); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|   | 
|     @ApiOperation(value = "查询通知详情", notes = "小程序端") | 
|     @GetMapping("/getNoticeDetail") | 
|     public ApiResponse<Notices> getNoticeDetail(@RequestParam Integer id){ | 
|         return ApiResponse.success("查询成功",noticeService.findById(id)); | 
|     } | 
|   | 
| } |