Commit 4b6c4fa7 authored by zhangfeng's avatar zhangfeng

feature-reward:调整目录结构,批量兑换

parent ae75f29e
package cn.iocoder.yudao.module.reward.api.reward;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO;
import java.util.List;
/**
* 礼品兑换 api 接口
*/
public interface RedeemRewardApi {
RedeemRewardRespDTO redeemReward(RedeemRewardReqVO redeemRewardReqVO);
List<RedeemRewardRespDTO> redeemRewards(List<RedeemRewardReqVO> redeemRewardReqVOList);
}
package cn.iocoder.yudao.module.reward.api.reward.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
@ApiModel("管理后台 - 礼品兑换 Request VO")
public class RedeemRewardReqVO {
@ApiModelProperty(value = "会员名称")
private String memberName;
@ApiModelProperty(value = "当前积分")
private Integer score;
@ApiModelProperty(value = "礼品id")
private Long rewardId;
@ApiModelProperty(value = "兑换数量")
private Integer count;
@ApiModelProperty(value = "兑换方式,同领取方式(1上门领取,2包邮到家,3邮寄到付)")
private Integer pickMethod;
@ApiModelProperty(value = "兑换入口(后台,app,web)")
private String entrance;
@ApiModelProperty(value = "费用数字(两位小数)")
private Integer expenses;
@ApiModelProperty(value = "费用币种(字典配置)")
private Integer currency;
@ApiModelProperty(value = "收件人姓名")
private String recipientName;
@ApiModelProperty(value = "收件人电话")
private String recipientPhoneNum;
@ApiModelProperty(value = "收件人地址")
private String recipientAddress;
@ApiModelProperty(value = "兑换人")
private String redeemer;
@ApiModelProperty(value = "兑换时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date redemptionTime;
@ApiModelProperty(value = "快递公司")
private String courierCompany;
@ApiModelProperty(value = "快递单号")
private String expressNo;
@ApiModelProperty(value = "快递日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date expressDate;
@ApiModelProperty(value = "快递寄出人")
private String expressSender;
@ApiModelProperty(value = "上传附件")
private String annex;
@ApiModelProperty(value = "备注")
private String remark;
}
package cn.iocoder.yudao.module.reward.api.reward.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 礼品兑换 Response VO")
public class RedeemRewardRespDTO {
@ApiModelProperty(value = "兑换操作结果")
private Boolean exchangeResult;
@ApiModelProperty(value = "兑换操作详情")
private String msg;
}
package cn.iocoder.yudao.module.reward.api.reward;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
@Service
@Validated
public class RedeemRewardApiImpl implements RedeemRewardApi {
@Override
public RedeemRewardRespDTO redeemReward(RedeemRewardReqVO redeemRewardReqVO) {
return null;
}
@Override
public List<RedeemRewardRespDTO> redeemRewards(List<RedeemRewardReqVO> redeemRewardReqVOList) {
return null;
}
}
package cn.iocoder.yudao.module.reward.controller.admin.reward;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.reward.api.reward.RedeemRewardApi;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 礼品管理")
@RequestMapping("/reward/redeem")
public class RedeemRewardController {
@Resource
private RedeemRewardApi redeemRewardApi;
@PostMapping("/single")
@ApiOperation("兑换礼品")
//@PreAuthorize("@ss.hasPermission('reward::redeem')")
public CommonResult<RedeemRewardRespDTO> redeemReward(@Valid @RequestBody RedeemRewardReqVO redeemRewardReqVO) {
return success(redeemRewardApi.redeemReward(redeemRewardReqVO));
}
@PostMapping("/batch")
@ApiOperation("批量兑换礼品")
//@PreAuthorize("@ss.hasPermission('reward::redeem')")
public CommonResult<List<RedeemRewardRespDTO>> redeemRewards(@Valid @RequestBody List<RedeemRewardReqVO> redeemRewardReqVOList) {
return success(redeemRewardApi.redeemRewards(redeemRewardReqVOList));
}
}
package cn.iocoder.yudao.module.reward.dal.dataobject.reward;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import java.util.Date;
/**
* 礼品 DO
......
package cn.iocoder.yudao.module.reward.dal.mysql.reward;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO;
import cn.iocoder.yudao.module.reward.vo.reward.RewardQueryVO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.reward.vo.reward.*;
import java.util.List;
/**
* 礼品 Mapper
......
package cn.iocoder.yudao.module.reward.service.reward;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.reward.vo.reward.*;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.reward.vo.reward.*;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
/**
* 礼品 Service 接口
......
package cn.iocoder.yudao.module.reward.service.reward;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
......@@ -8,7 +7,6 @@ import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
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.dal.mysql.reward.RewardMapper;
import cn.iocoder.yudao.module.reward.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.reward.vo.reward.*;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.RandomStringUtils;
......@@ -20,7 +18,6 @@ import java.time.Instant;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.reward.enums.ErrorCodeConstants.*;
......
package cn.iocoder.yudao.module.reward.vo.reward;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
......
package cn.iocoder.yudao.module.reward.vo.reward;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
......
package cn.iocoder.yudao.module.reward.vo.reward;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
......
package cn.iocoder.yudao.module.reward.vo.reward;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
......
package cn.iocoder.yudao.module.reward.vo.reward;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
......
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