| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.admin.response.StagingDataVO; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.system.dto.NoticesDTO; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.dao.web.response.InternalHomeVO; |
| | | import com.doumee.service.business.ApproveService; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.VisitsService; |
| | | import com.doumee.service.system.NoticesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @Autowired |
| | | private NoticesService noticesService; |
| | | |
| | | @Autowired |
| | | private ApproveService approveService; |
| | | |
| | | |
| | | @ApiOperation("头部数据") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("任务中心分页") |
| | | @PostMapping("/taskPage") |
| | | @RequiresPermissions("business:notices:query") |
| | | public ApiResponse<PageData<Notices>> taskPage (@RequestBody PageWrap<Notices> pageWrap) { |
| | | pageWrap.getModel().setPalt(Constants.ZERO); |
| | | return ApiResponse.success(noticesService.findPage(pageWrap)); |
| | | |
| | | @ApiOperation(value = "任务中心头部", notes = "H5") |
| | | @GetMapping("/taskCenterHead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "isDetail", value = " 是否查询详细 1是;0否", required = true), |
| | | }) |
| | | public ApiResponse<InternalHomeVO> taskCenterHead(@RequestParam Integer isDetail,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success("查询成功",approveService.getHomeData(getLoginUser(token).getMemberId(),isDetail)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("任务中心分页") |
| | | @PostMapping("/taskPage") |
| | | public ApiResponse<PageData<Notices>> taskPage (@RequestBody PageWrap<NoticesDTO> pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | pageWrap.getModel().setMemberId(loginUserInfo.getMemberId()); |
| | | return ApiResponse.success(noticesService.taskCanterPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("标记已读") |
| | | @GetMapping("/signRead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "noticesId", value = "记录主键", required = false), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "signType", value = "标记类型:0=单个标记;1=标记全部未读", required = false), |
| | | }) |
| | | public ApiResponse signRead (Integer noticesId,@RequestParam Integer signType, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | if(Constants.equalsInteger(signType,Constants.ZERO)){ |
| | | noticesService.signReadById(noticesId); |
| | | }else{ |
| | | noticesService.signRead(loginUserInfo.getMemberId()); |
| | | } |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | } |