| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Notice; |
| | | import com.doumee.dao.web.request.NoticeCardRequest; |
| | | import com.doumee.dao.web.response.NoticeCardResponse; |
| | | import com.doumee.service.business.NoticeService; |
| | | 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; |
| | |
| | | public class NoticeApi extends ApiController{ |
| | | |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | | private NoticesService noticeService; |
| | | |
| | | |
| | | /** |
| | |
| | | @LoginRequired |
| | | @ApiOperation(value = "查询用户通知", notes = "小程序端") |
| | | @PostMapping("/findNoticePage") |
| | | public ApiResponse<IPage<NoticeCardResponse>> findNoticePage(@RequestBody PageWrap<NoticeCardRequest> pageWrap){ |
| | | pageWrap.getModel().setMemberId(getMemberId()); |
| | | return ApiResponse.success("查询成功",noticeService.noticePage(pageWrap)); |
| | | public ApiResponse<PageData<Notices>> findNoticePage(@RequestBody PageWrap<Notices> pageWrap){ |
| | | pageWrap.getModel().setUserId(getMemberId()); |
| | | return ApiResponse.success("查询成功",noticeService.findPage(pageWrap)); |
| | | } |
| | | |
| | | /** |
| | | * 查询最新系统通知 |
| | | * @return |
| | | */ |
| | | @LoginRequired |
| | | @ApiOperation(value = "查询最新系统通知", notes = "小程序端") |
| | | @GetMapping("/findNewNotice") |
| | | public ApiResponse<NoticeCardResponse> findNewNotice(){ |
| | | |
| | | return ApiResponse.success("查询成功",noticeService.newNotice(getMemberId())); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "用户更新阅读状态", notes = "小程序端") |
| | | @GetMapping("/getMemberDTO") |
| | | public ApiResponse hasRead(@RequestParam Integer id){ |
| | | Notice notice = new Notice(); |
| | | Notices notice = new Notices(); |
| | | notice.setId(id); |
| | | notice.setStatus(Constants.ONE); |
| | | noticeService.updateById(notice); |
| | |
| | | @LoginRequired |
| | | @ApiOperation(value = "查询通知详情", notes = "小程序端") |
| | | @GetMapping("/getNoticeDetail") |
| | | public ApiResponse<NoticeCardResponse> getNoticeDetail(@RequestParam Integer id){ |
| | | return ApiResponse.success("查询成功",noticeService.getNoticeDetail(id)); |
| | | public ApiResponse<Notices> getNoticeDetail(@RequestParam Integer id){ |
| | | return ApiResponse.success("查询成功",noticeService.findById(id)); |
| | | } |
| | | |
| | | } |