Commit 9764f29c authored by zhangfeng's avatar zhangfeng

feature-reward:礼品分页列表请求方式改为post

parent af847670
......@@ -51,4 +51,11 @@ public interface RewardConvert {
* @return
*/
PageResult<RewardBackVO> convertPage(PageResult<RewardDO> page);
/***
* 更新礼品状态VO转实体
* @param bean
* @return
*/
RewardDO convertStatusReqVO(RewardStatusReqVO bean);
}
package cn.iocoder.yudao.module.reward.vo.reward;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("管理后台 - 礼品状态更新 VO")
public class RewardStatusReqVO {
@ApiModelProperty(value = "", required = true)
@NotNull(message = "不能为空")
private Long id;
@ApiModelProperty(value = "礼品状态(1已启用,2未启用,3已关闭,4已过期)")
@NotNull(message = "礼品状态不能为空")
private Integer status;
}
package cn.iocoder.yudao.module.reward.controller.admin.reward;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.reward.vo.reward.*;
import cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO;
import cn.iocoder.yudao.module.reward.convert.reward.RewardConvert;
import cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO;
import cn.iocoder.yudao.module.reward.service.reward.RewardService;
import cn.iocoder.yudao.module.reward.vo.reward.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Validated
@RestController
......@@ -73,14 +76,22 @@ public class RewardController {
return success(RewardConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@PostMapping("/page")
@ApiOperation("获得礼品分页")
//@PreAuthorize("@ss.hasPermission('reward::query')")
public CommonResult<PageResult<RewardBackVO>> getPage(@Valid RewardQueryVO query, PageVO page) {
public CommonResult<PageResult<RewardBackVO>> getPage(@Valid @RequestBody RewardQueryVO query, PageVO page) {
PageResult<RewardDO> pageResult = rewardService.getPage(query, page);
return success(RewardConvert.INSTANCE.convertPage(pageResult));
}
@PostMapping("/status")
@ApiOperation("礼品状态变更")
//@PreAuthorize("@ss.hasPermission('reward::query')")
public CommonResult<Boolean> updateStatus(@Valid @RequestBody RewardStatusReqVO statusVO) {
rewardService.updateById(RewardConvert.INSTANCE.convertStatusReqVO(statusVO));
return success(true);
}
@GetMapping("/export-excel")
@ApiOperation("导出礼品 Excel")
//@PreAuthorize("@ss.hasPermission('reward::export')")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment