提交新功能 分销商 积分 会员体系
This commit is contained in:
@ -97,6 +97,11 @@
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.yixiang.boot</groupId>
|
||||
<artifactId>yshop-module-product-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
|
@ -1,10 +1,8 @@
|
||||
package co.yixiang.yshop.module.member.api.user;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import co.yixiang.yshop.framework.common.enums.CommonStatusEnum;
|
||||
import co.yixiang.yshop.framework.common.enums.ShopCommonEnum;
|
||||
import co.yixiang.yshop.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import co.yixiang.yshop.module.member.api.user.dto.WechatUserDto;
|
||||
import co.yixiang.yshop.module.member.api.user.dto.WechatUserDTO;
|
||||
import co.yixiang.yshop.module.member.convert.user.UserConvert;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import co.yixiang.yshop.module.member.service.user.MemberUserService;
|
||||
@ -31,14 +29,14 @@ public class MemberUserApiImpl implements MemberUserApi {
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
@Override
|
||||
public void saveWechatMember(WechatUserDto wechatUserDto) {
|
||||
public void saveWechatMember(WechatUserDTO wechatUserDto) {
|
||||
MemberUserDO user = new MemberUserDO();
|
||||
user.setNickname(wechatUserDto.getNickname());
|
||||
user.setAvatar(wechatUserDto.getHeadimgurl());
|
||||
// 生成密码
|
||||
String password = IdUtil.fastSimpleUUID();
|
||||
user.setPassword(encodePassword(password));
|
||||
user.setUsername(wechatUserDto.getOpenid());
|
||||
user.setUsername(wechatUserDto.getOpenId());
|
||||
user.setLoginType("wechat");
|
||||
user.setWxProfile(wechatUserDto);
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
package co.yixiang.yshop.module.member.api.user;
|
||||
|
||||
import co.yixiang.yshop.module.member.api.user.dto.IncreaseNowMoneyDTO;
|
||||
import co.yixiang.yshop.module.member.enums.BillDetailEnum;
|
||||
import co.yixiang.yshop.module.member.service.user.MemberUserService;
|
||||
import co.yixiang.yshop.module.member.service.userbill.UserBillService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class MemberUserNowMoneyApiImpl implements MemberUserNowMoneyApi {
|
||||
|
||||
@Resource
|
||||
private MemberUserService memberUserService;
|
||||
|
||||
@Resource
|
||||
private UserBillService userBillService;
|
||||
|
||||
@Override
|
||||
public void increaseNowMoney(IncreaseNowMoneyDTO increaseNowMoneyDTO) {
|
||||
// 增加余额
|
||||
memberUserService.incMoney(increaseNowMoneyDTO.getId(), increaseNowMoneyDTO.getAmount());
|
||||
// 保存记录
|
||||
userBillService.income(increaseNowMoneyDTO.getId(),
|
||||
"充值", BillDetailEnum.CATEGORY_1.getValue(),
|
||||
BillDetailEnum.TYPE_1.getValue(),
|
||||
increaseNowMoneyDTO.getAmount(),
|
||||
increaseNowMoneyDTO.getAmount(),
|
||||
increaseNowMoneyDTO.getMark(),
|
||||
increaseNowMoneyDTO.getLink());
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint;
|
||||
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.burypoint.TrendChartRespVO;
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.burypoint.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.burypoint.BuryPointDO;
|
||||
import co.yixiang.yshop.module.member.convert.burypoint.BuryPointConvert;
|
||||
import co.yixiang.yshop.module.member.service.burypoint.BuryPointService;
|
||||
|
||||
@Tag(name = "管理后台 - 埋点")
|
||||
@RestController
|
||||
@RequestMapping("/member/bury-point")
|
||||
@Validated
|
||||
public class BuryPointController {
|
||||
|
||||
@Resource
|
||||
private BuryPointService buryPointService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建埋点")
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:create')")
|
||||
public CommonResult<Long> createBuryPoint(@Valid @RequestBody BuryPointCreateReqVO createReqVO) {
|
||||
return success(buryPointService.createBuryPoint(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新埋点")
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:update')")
|
||||
public CommonResult<Boolean> updateBuryPoint(@Valid @RequestBody BuryPointUpdateReqVO updateReqVO) {
|
||||
buryPointService.updateBuryPoint(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除埋点")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:delete')")
|
||||
public CommonResult<Boolean> deleteBuryPoint(@RequestParam("id") Long id) {
|
||||
buryPointService.deleteBuryPoint(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得埋点")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:query')")
|
||||
public CommonResult<BuryPointRespVO> getBuryPoint(@RequestParam("id") Long id) {
|
||||
BuryPointDO buryPoint = buryPointService.getBuryPoint(id);
|
||||
return success(BuryPointConvert.INSTANCE.convert(buryPoint));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得埋点列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:query')")
|
||||
public CommonResult<List<BuryPointRespVO>> getBuryPointList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<BuryPointDO> list = buryPointService.getBuryPointList(ids);
|
||||
return success(BuryPointConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得埋点分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:query')")
|
||||
public CommonResult<PageResult<BuryPointRespVO>> getBuryPointPage(@Valid BuryPointPageReqVO pageVO) {
|
||||
PageResult<BuryPointDO> pageResult = buryPointService.getBuryPointPage(pageVO);
|
||||
return success(BuryPointConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出埋点 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:bury-point:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportBuryPointExcel(@Valid BuryPointExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<BuryPointDO> list = buryPointService.getBuryPointList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<BuryPointExcelVO> datas = BuryPointConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "埋点.xls", "数据", BuryPointExcelVO.class, datas);
|
||||
}
|
||||
|
||||
@GetMapping("/get-trend-chart")
|
||||
@Operation(summary = "获取趋势图")
|
||||
public CommonResult<List<TrendChartRespVO>> getTrendChart() {
|
||||
return success(buryPointService.getTrendChart());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 埋点 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class BuryPointBaseVO {
|
||||
|
||||
@Schema(description = "用户ID", example = "8201")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "事件")
|
||||
private String event;
|
||||
|
||||
@Schema(description = "事件参数")
|
||||
private String eventParameter;
|
||||
|
||||
@Schema(description = "IP")
|
||||
private String ip;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 埋点创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuryPointCreateReqVO extends BuryPointBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 埋点 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class BuryPointExcelVO {
|
||||
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty("事件")
|
||||
private String event;
|
||||
|
||||
@ExcelProperty("事件参数")
|
||||
private String eventParameter;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("IP")
|
||||
private String ip;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 埋点 Excel 导出 Request VO,参数和 BuryPointPageReqVO 是一致的")
|
||||
@Data
|
||||
public class BuryPointExportReqVO {
|
||||
|
||||
@Schema(description = "用户ID", example = "8201")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "事件")
|
||||
private String event;
|
||||
|
||||
@Schema(description = "事件参数")
|
||||
private String eventParameter;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "IP")
|
||||
private String ip;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 埋点分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuryPointPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户ID", example = "8201")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "事件")
|
||||
private String event;
|
||||
|
||||
@Schema(description = "事件参数")
|
||||
private String eventParameter;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "IP")
|
||||
private String ip;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 埋点 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuryPointRespVO extends BuryPointBaseVO {
|
||||
|
||||
@Schema(description = "主键", required = true, example = "28996")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.burypoint.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 埋点更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuryPointUpdateReqVO extends BuryPointBaseVO {
|
||||
|
||||
@Schema(description = "主键", required = true, example = "28996")
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import co.yixiang.yshop.module.member.controller.admin.integralrule.vo.*;
|
||||
import co.yixiang.yshop.module.member.convert.integralrule.IntegralRuleConvert;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.integralrule.IntegralRuleDO;
|
||||
import co.yixiang.yshop.module.member.service.integralrule.IntegralRuleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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 co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 会员积分规则")
|
||||
@RestController
|
||||
@RequestMapping("/member/integral-rule")
|
||||
@Validated
|
||||
public class IntegralRuleController {
|
||||
|
||||
@Resource
|
||||
private IntegralRuleService integralRuleService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员积分规则")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:create')")
|
||||
public CommonResult<Long> createIntegralRule(@Valid @RequestBody IntegralRuleCreateReqVO createReqVO) {
|
||||
return success(integralRuleService.createIntegralRule(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员积分规则")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:update')")
|
||||
public CommonResult<Boolean> updateIntegralRule(@Valid @RequestBody IntegralRuleUpdateReqVO updateReqVO) {
|
||||
integralRuleService.updateIntegralRule(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员积分规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:delete')")
|
||||
public CommonResult<Boolean> deleteIntegralRule(@RequestParam("id") Long id) {
|
||||
integralRuleService.deleteIntegralRule(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员积分规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:query')")
|
||||
public CommonResult<IntegralRuleRespVO> getIntegralRule(@RequestParam("id") Long id) {
|
||||
IntegralRuleDO integralRule = integralRuleService.getIntegralRule(id);
|
||||
return success(IntegralRuleConvert.INSTANCE.convert(integralRule));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员积分规则列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:query')")
|
||||
public CommonResult<List<IntegralRuleRespVO>> getIntegralRuleList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<IntegralRuleDO> list = integralRuleService.getIntegralRuleList(ids);
|
||||
return success(IntegralRuleConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员积分规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:query')")
|
||||
public CommonResult<PageResult<IntegralRuleRespVO>> getIntegralRulePage(@Valid IntegralRulePageReqVO pageVO) {
|
||||
PageResult<IntegralRuleDO> pageResult = integralRuleService.getIntegralRulePage(pageVO);
|
||||
return success(IntegralRuleConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员积分规则 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportIntegralRuleExcel(@Valid IntegralRuleExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<IntegralRuleDO> list = integralRuleService.getIntegralRuleList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<IntegralRuleExcelVO> datas = IntegralRuleConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员积分规则.xls", "数据", IntegralRuleExcelVO.class, datas);
|
||||
}
|
||||
|
||||
@GetMapping("getRule")
|
||||
@Operation(summary = "查询会员积分规则")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:query')")
|
||||
public CommonResult<IntegralRuleVO> getRule(){
|
||||
IntegralRuleVO vo = integralRuleService.getRule();
|
||||
return CommonResult.success(vo);
|
||||
}
|
||||
|
||||
@PostMapping("saveRule")
|
||||
@Operation(summary = "保存会员积分规则")
|
||||
@PreAuthorize("@ss.hasPermission('member:integral-rule:update')")
|
||||
public CommonResult<Boolean> saveRule(@RequestBody IntegralRuleVO vo){
|
||||
integralRuleService.saveRule(vo);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 会员积分规则 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class IntegralRuleBaseVO {
|
||||
|
||||
@Schema(description = "类型", required = true, example = "1")
|
||||
@NotNull(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "yshop")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "获取积分")
|
||||
private Integer integral;
|
||||
|
||||
@Schema(description = "拓展字段")
|
||||
private String attribute1;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String iconUrl;
|
||||
|
||||
@Schema(description = "是否开启")
|
||||
private Boolean enable;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分规则创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IntegralRuleCreateReqVO extends IntegralRuleBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 会员积分规则 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class IntegralRuleExcelVO {
|
||||
|
||||
@ExcelProperty("评论ID")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ExcelProperty("获取积分")
|
||||
private Integer integral;
|
||||
|
||||
@ExcelProperty("拓展字段")
|
||||
private String attribute1;
|
||||
|
||||
@ExcelProperty("添加时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("图标")
|
||||
private String iconUrl;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分规则 Excel 导出 Request VO,参数和 IntegralRulePageReqVO 是一致的")
|
||||
@Data
|
||||
public class IntegralRuleExportReqVO {
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "yshop")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "获取积分")
|
||||
private Integer integral;
|
||||
|
||||
@Schema(description = "拓展字段")
|
||||
private String attribute1;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IntegralRulePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "yshop")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "获取积分")
|
||||
private Integer integral;
|
||||
|
||||
@Schema(description = "拓展字段")
|
||||
private String attribute1;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分规则 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IntegralRuleRespVO extends IntegralRuleBaseVO {
|
||||
|
||||
@Schema(description = "评论ID", required = true, example = "5350")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "添加时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分规则更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IntegralRuleUpdateReqVO extends IntegralRuleBaseVO {
|
||||
|
||||
@Schema(description = "评论ID", required = true, example = "5350")
|
||||
@NotNull(message = "评论ID不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.integralrule.vo;
|
||||
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.integralrule.IntegralRuleDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author pepis
|
||||
* @apiNote
|
||||
**/
|
||||
@Data
|
||||
public class IntegralRuleVO {
|
||||
@Schema(description = "积分奖励列表")
|
||||
private List<IntegralRuleDO> ruleList;
|
||||
|
||||
@Schema(description = "积分抵扣规则")
|
||||
private String integralDeductionRule; //积分抵扣规则
|
||||
@Schema(description = "积分抵扣是否开启")
|
||||
private String integralEnable; //积分抵扣是否开启
|
||||
@Schema(description = "积分名称")
|
||||
private String integralName; //积分名称
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.signinrecord.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.signinrecord.SignInRecordDO;
|
||||
import co.yixiang.yshop.module.member.convert.signinrecord.SignInRecordConvert;
|
||||
import co.yixiang.yshop.module.member.service.signinrecord.SignInRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 签到记录")
|
||||
@RestController
|
||||
@RequestMapping("/member/sign-in-record")
|
||||
@Validated
|
||||
public class SignInRecordController {
|
||||
|
||||
@Resource
|
||||
private SignInRecordService signInRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建签到记录")
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:create')")
|
||||
public CommonResult<Long> createSignInRecord(@Valid @RequestBody SignInRecordCreateReqVO createReqVO) {
|
||||
return success(signInRecordService.createSignInRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新签到记录")
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:update')")
|
||||
public CommonResult<Boolean> updateSignInRecord(@Valid @RequestBody SignInRecordUpdateReqVO updateReqVO) {
|
||||
signInRecordService.updateSignInRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除签到记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:delete')")
|
||||
public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) {
|
||||
signInRecordService.deleteSignInRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得签到记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:query')")
|
||||
public CommonResult<SignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) {
|
||||
SignInRecordDO signInRecord = signInRecordService.getSignInRecord(id);
|
||||
return success(SignInRecordConvert.INSTANCE.convert(signInRecord));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得签到记录列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:query')")
|
||||
public CommonResult<List<SignInRecordRespVO>> getSignInRecordList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<SignInRecordDO> list = signInRecordService.getSignInRecordList(ids);
|
||||
return success(SignInRecordConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得签到记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:query')")
|
||||
public CommonResult<PageResult<SignInRecordRespVO>> getSignInRecordPage(@Valid SignInRecordPageReqVO pageVO) {
|
||||
PageResult<SignInRecordDO> pageResult = signInRecordService.getSignInRecordPage(pageVO);
|
||||
return success(SignInRecordConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出签到记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:sign-in-record:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSignInRecordExcel(@Valid SignInRecordExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<SignInRecordDO> list = signInRecordService.getSignInRecordList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<SignInRecordExcelVO> datas = SignInRecordConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "签到记录.xls", "数据", SignInRecordExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 签到记录 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class SignInRecordBaseVO {
|
||||
|
||||
@Schema(description = "会员ID", example = "10758")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "积分")
|
||||
private BigDecimal integral;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 签到记录创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordCreateReqVO extends SignInRecordBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 签到记录 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class SignInRecordExcelVO {
|
||||
|
||||
@ExcelProperty("参数主键")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("会员ID")
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty("积分")
|
||||
private Integer integral;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 签到记录 Excel 导出 Request VO,参数和 SignInRecordPageReqVO 是一致的")
|
||||
@Data
|
||||
public class SignInRecordExportReqVO {
|
||||
|
||||
@Schema(description = "会员ID", example = "10758")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "积分")
|
||||
private Integer integral;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 签到记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "会员ID", example = "10758")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "积分")
|
||||
private Integer integral;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 签到记录 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordRespVO extends SignInRecordBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "25392")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "当天是否签到")
|
||||
private Boolean isSign = true;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.signinrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 签到记录更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordUpdateReqVO extends SignInRecordBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "25392")
|
||||
@NotNull(message = "参数主键不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -2,9 +2,12 @@ package co.yixiang.yshop.module.member.controller.admin.user;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import co.yixiang.yshop.module.member.controller.admin.user.vo.*;
|
||||
import co.yixiang.yshop.module.member.convert.user.UserConvert;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import co.yixiang.yshop.module.member.service.signinrecord.SignInRecordService;
|
||||
import co.yixiang.yshop.module.member.service.user.UserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -14,11 +17,14 @@ 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 co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 用户")
|
||||
@RestController
|
||||
@ -28,6 +34,8 @@ public class MemberUserController {
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private SignInRecordService signInRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户")
|
||||
@ -44,11 +52,11 @@ public class MemberUserController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updateMony")
|
||||
@PutMapping("/updateMoney")
|
||||
@Operation(summary = "更新用户余额与积分")
|
||||
@PreAuthorize("@ss.hasPermission('member:user:update')")
|
||||
public CommonResult<Boolean> updateMony(@Valid @RequestBody UserUpdateMoneyReqVO updateReqVO) {
|
||||
userService.updateMony(updateReqVO);
|
||||
public CommonResult<Boolean> updateMoney(@Valid @RequestBody UserUpdateMoneyReqVO updateReqVO) {
|
||||
userService.updateMoney(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ -67,7 +75,9 @@ public class MemberUserController {
|
||||
@PreAuthorize("@ss.hasPermission('member:user:query')")
|
||||
public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) {
|
||||
MemberUserDO user = userService.getUser(id);
|
||||
return success(UserConvert.INSTANCE.convert(user,true));
|
||||
UserRespVO convert = UserConvert.INSTANCE.convert(user, true);
|
||||
convert.setSignNum(signInRecordService.countByUserIdThisWeek(id));
|
||||
return success(convert);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ -79,14 +89,50 @@ public class MemberUserController {
|
||||
return success(UserConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/userList")
|
||||
@Operation(summary = "获得用户列表")
|
||||
@PreAuthorize("@ss.hasPermission('member:user:query')")
|
||||
public CommonResult<List<UserRespVO>> getUserList(UserExportReqVO exportReqVO) {
|
||||
List<MemberUserDO> list = userService.getUserList(exportReqVO);
|
||||
return success(UserConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user:query')")
|
||||
public CommonResult<PageResult<UserRespVO>> getUserPage(@Valid UserPageReqVO pageVO) {
|
||||
PageResult<MemberUserDO> pageResult = userService.getUserPage(pageVO);
|
||||
return success(UserConvert.INSTANCE.convertPage(pageResult));
|
||||
PageResult<UserRespVO> pageResult = userService.getUserPage(pageVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员用户 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
@PreAuthorize("@ss.hasPermission('member:user:export')")
|
||||
public void exportMaterialExcel(@Valid UserExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<MemberUserDO> list = userService.getUserList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<MemberUserExcelVO> voList = UserConvert.INSTANCE.convertListExcel(list);
|
||||
ExcelUtils.write(response, "会员用户.xls", "数据", MemberUserExcelVO.class, voList);
|
||||
}
|
||||
|
||||
@PostMapping("updateTag")
|
||||
@Operation(summary = "更新用户标签")
|
||||
@PreAuthorize("@ss.hasPermission('member:user:update')")
|
||||
public CommonResult<Boolean> updateTag(@RequestBody UserUpdateTagDTO dto){
|
||||
userService.updateTag(dto);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
// @GetMapping("addGrowthValue")
|
||||
// @Operation(summary = "增加成长值")
|
||||
// @PreAuthorize("@ss.hasPermission('member:user:update')")
|
||||
// public CommonResult<Boolean> addGrowthValue(Long userId, String type, BigDecimal consumeAmount){
|
||||
// userService.addGrowthValue(userId,type,consumeAmount);
|
||||
// return CommonResult.success(true);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.user.vo;
|
||||
|
||||
import co.yixiang.yshop.framework.desensitize.core.slider.annotation.MobileDesensitize;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 素材库 Excel VO
|
||||
*
|
||||
* @author yshop
|
||||
*/
|
||||
@Data
|
||||
public class MemberUserExcelVO {
|
||||
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("用户昵称")
|
||||
private String nickname;
|
||||
|
||||
@MobileDesensitize
|
||||
@ExcelProperty("手机号码")
|
||||
private String mobile;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("用户余额")
|
||||
private BigDecimal nowMoney;
|
||||
|
||||
@ExcelProperty("登录类型")
|
||||
private String loginType;
|
||||
|
||||
|
||||
}
|
@ -1,17 +1,13 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.user.vo;
|
||||
|
||||
import co.yixiang.yshop.framework.desensitize.core.slider.annotation.MobileDesensitize;
|
||||
import co.yixiang.yshop.module.member.api.user.dto.WechatUserDto;
|
||||
import co.yixiang.yshop.module.member.api.user.dto.WechatUserDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 用户 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
@ -77,7 +73,7 @@ public class UserBaseVO {
|
||||
private String loginType;
|
||||
|
||||
@Schema(description = "微信用户json信息")
|
||||
private WechatUserDto wxProfile;
|
||||
private WechatUserDTO wxProfile;
|
||||
|
||||
@Schema(description = "生日")
|
||||
private String birthday;
|
||||
@ -107,6 +103,31 @@ public class UserBaseVO {
|
||||
*/
|
||||
private String cardId;
|
||||
|
||||
/**
|
||||
* 会员成长值
|
||||
*/
|
||||
private Integer growthValue;
|
||||
|
||||
/**
|
||||
* 核销权限
|
||||
*/
|
||||
private Boolean writeOffAuthority;
|
||||
|
||||
/**
|
||||
* 邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private LocalDateTime loginDate;
|
||||
|
||||
/**
|
||||
* 连续签到天数
|
||||
*/
|
||||
private Integer signNum;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class UserCreateReqVO extends UserBaseVO {
|
||||
private String lastIp;
|
||||
|
||||
@Schema(description = "连续签到天数", required = true)
|
||||
@NotNull(message = "连续签到天数不能为空")
|
||||
private Integer signNum;
|
||||
|
||||
@Schema(description = "等级", required = true)
|
||||
|
@ -1,12 +1,11 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.user.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户 Excel 导出 Request VO,参数和 UserPageReqVO 是一致的")
|
||||
@ -23,10 +22,12 @@ public class UserExportReqVO {
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "名称 模糊搜索")
|
||||
private String name;
|
||||
}
|
||||
|
@ -34,4 +34,9 @@ public class UserPageReqVO extends PageParam {
|
||||
@Schema(description = "登录类型")
|
||||
private String loginType;
|
||||
|
||||
@Schema(description = "标签")
|
||||
private String tagName;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,11 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.user.vo;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.usertagref.vo.UserTagRefRespVO;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.usertagref.UserTagRefDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 用户 Response VO")
|
||||
@Data
|
||||
@ -16,4 +19,8 @@ public class UserRespVO extends UserBaseVO {
|
||||
@Schema(description = "添加时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "标签列表")
|
||||
private List<UserTagRefDO> tagList;
|
||||
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@ToString(callSuper = true)
|
||||
public class UserUpdateMoneyReqVO {
|
||||
|
||||
@Schema(description = "用户id", required = true, example = "16370")
|
||||
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16370")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author pepis
|
||||
* @apiNote
|
||||
**/
|
||||
@Data
|
||||
public class UserUpdateTagDTO {
|
||||
@Schema(description = "用户ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标签列表")
|
||||
private List<Long> tagIdList;
|
||||
}
|
@ -3,9 +3,6 @@ package co.yixiang.yshop.module.member.controller.admin.useraddress.vo;
|
||||
import co.yixiang.yshop.framework.desensitize.core.slider.annotation.MobileDesensitize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
@ -15,51 +12,51 @@ import javax.validation.constraints.*;
|
||||
@Data
|
||||
public class UserAddressBaseVO {
|
||||
|
||||
@Schema(description = "用户id", required = true, example = "25124")
|
||||
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25124")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long uid;
|
||||
|
||||
@Schema(description = "收货人姓名", required = true, example = "李四")
|
||||
@Schema(description = "收货人姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotNull(message = "收货人姓名不能为空")
|
||||
private String realName;
|
||||
|
||||
@MobileDesensitize
|
||||
@Schema(description = "收货人电话", required = true)
|
||||
@Schema(description = "收货人电话", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收货人电话不能为空")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "收货人所在省", required = true)
|
||||
@Schema(description = "收货人所在省", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收货人所在省不能为空")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "收货人所在市", required = true)
|
||||
@Schema(description = "收货人所在市", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收货人所在市不能为空")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "城市id", example = "15595")
|
||||
private Integer cityId;
|
||||
|
||||
@Schema(description = "收货人所在区", required = true)
|
||||
@Schema(description = "收货人所在区", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收货人所在区不能为空")
|
||||
private String district;
|
||||
|
||||
@Schema(description = "收货人详细地址", required = true)
|
||||
@Schema(description = "收货人详细地址", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收货人详细地址不能为空")
|
||||
private String detail;
|
||||
|
||||
@Schema(description = "邮编", required = true)
|
||||
@Schema(description = "邮编", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "邮编不能为空")
|
||||
private String postCode;
|
||||
|
||||
@Schema(description = "经度", required = true)
|
||||
@Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "经度不能为空")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度", required = true)
|
||||
@Schema(description = "纬度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "纬度不能为空")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "是否默认", required = true)
|
||||
@Schema(description = "是否默认", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否默认不能为空")
|
||||
private Byte isDefault;
|
||||
|
||||
|
@ -10,10 +10,10 @@ import java.time.LocalDateTime;
|
||||
@ToString(callSuper = true)
|
||||
public class UserAddressRespVO extends UserAddressBaseVO {
|
||||
|
||||
@Schema(description = "用户地址id", required = true, example = "24169")
|
||||
@Schema(description = "用户地址id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24169")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "添加时间", required = true)
|
||||
@Schema(description = "添加时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import javax.validation.constraints.*;
|
||||
@ToString(callSuper = true)
|
||||
public class UserAddressUpdateReqVO extends UserAddressBaseVO {
|
||||
|
||||
@Schema(description = "用户地址id", required = true, example = "24169")
|
||||
@Schema(description = "用户地址id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24169")
|
||||
@NotNull(message = "用户地址id不能为空")
|
||||
private Long id;
|
||||
|
||||
|
@ -1,30 +1,21 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userbill;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userbill.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.userbill.UserBillDO;
|
||||
import co.yixiang.yshop.module.member.convert.userbill.UserBillConvert;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.module.member.controller.admin.userbill.vo.UserBillPageReqVO;
|
||||
import co.yixiang.yshop.module.member.controller.admin.userbill.vo.UserBillRespVO;
|
||||
import co.yixiang.yshop.module.member.service.userbill.UserBillService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 用户账单")
|
||||
@RestController
|
||||
@ -38,10 +29,10 @@ public class UserBillController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户账单分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-bill:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-bill:query')")
|
||||
public CommonResult<PageResult<UserBillRespVO>> getUserBillPage(@Valid UserBillPageReqVO pageVO) {
|
||||
PageResult<UserBillDO> pageResult = userBillService.getUserBillPage(pageVO);
|
||||
return success(UserBillConvert.INSTANCE.convertPage(pageResult));
|
||||
PageResult<UserBillRespVO> pageResult = userBillService.getUserBillPageAdmin(pageVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userbill.vo;
|
||||
|
||||
import co.yixiang.yshop.module.member.enums.BillDetailEnum;
|
||||
import co.yixiang.yshop.module.member.enums.BillEnum;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author pepis
|
||||
* @apiNote
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
public class UserBillModifyDTO {
|
||||
// 用户id
|
||||
private Long uid;
|
||||
// 变动金额 包含负数
|
||||
private BigDecimal amount;
|
||||
// 变动后金额
|
||||
private BigDecimal afterAmount ;
|
||||
// 关联id
|
||||
private Long linkId;
|
||||
// 变动类型
|
||||
private BillDetailEnum typeEnum;
|
||||
// 分类
|
||||
private BillDetailEnum categoryEnum;
|
||||
// 收入/支出
|
||||
private BillEnum pmType;
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userbill.vo;
|
||||
|
||||
import lombok.*;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@ -51,4 +52,7 @@ public class UserBillPageReqVO extends PageParam {
|
||||
@Schema(description = "0 = 带确定 1 = 有效 -1 = 无效", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,10 @@ package co.yixiang.yshop.module.member.controller.admin.userbill.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 用户账单 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ -16,4 +18,10 @@ public class UserBillRespVO extends UserBillBaseVO {
|
||||
@Schema(description = "添加时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "用户头像")
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,102 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.userinvitelog.UserInviteLogDO;
|
||||
import co.yixiang.yshop.module.member.convert.userinvitelog.UserInviteLogConvert;
|
||||
import co.yixiang.yshop.module.member.service.userinvitelog.UserInviteLogService;
|
||||
|
||||
@Tag(name = "管理后台 - 邀请日志")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-invite-log")
|
||||
@Validated
|
||||
public class UserInviteLogController {
|
||||
|
||||
@Resource
|
||||
private UserInviteLogService userInviteLogService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建邀请日志")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:create')")
|
||||
public CommonResult<Long> createUserInviteLog(@Valid @RequestBody UserInviteLogCreateReqVO createReqVO) {
|
||||
return success(userInviteLogService.createUserInviteLog(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新邀请日志")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:update')")
|
||||
public CommonResult<Boolean> updateUserInviteLog(@Valid @RequestBody UserInviteLogUpdateReqVO updateReqVO) {
|
||||
userInviteLogService.updateUserInviteLog(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除邀请日志")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:delete')")
|
||||
public CommonResult<Boolean> deleteUserInviteLog(@RequestParam("id") Long id) {
|
||||
userInviteLogService.deleteUserInviteLog(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得邀请日志")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:query')")
|
||||
public CommonResult<UserInviteLogRespVO> getUserInviteLog(@RequestParam("id") Long id) {
|
||||
UserInviteLogDO userInviteLog = userInviteLogService.getUserInviteLog(id);
|
||||
return success(UserInviteLogConvert.INSTANCE.convert(userInviteLog));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得邀请日志列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:query')")
|
||||
public CommonResult<List<UserInviteLogRespVO>> getUserInviteLogList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<UserInviteLogDO> list = userInviteLogService.getUserInviteLogList(ids);
|
||||
return success(UserInviteLogConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得邀请日志分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:query')")
|
||||
public CommonResult<PageResult<UserInviteLogRespVO>> getUserInviteLogPage(@Valid UserInviteLogPageReqVO pageVO) {
|
||||
PageResult<UserInviteLogDO> pageResult = userInviteLogService.getUserInviteLogPage(pageVO);
|
||||
return success(UserInviteLogConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出邀请日志 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-invite-log:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserInviteLogExcel(@Valid UserInviteLogExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserInviteLogDO> list = userInviteLogService.getUserInviteLogList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserInviteLogExcelVO> datas = UserInviteLogConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "邀请日志.xls", "数据", UserInviteLogExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 邀请日志 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserInviteLogBaseVO {
|
||||
|
||||
@Schema(description = "邀请用户id", required = true, example = "19165")
|
||||
@NotNull(message = "邀请用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "被邀请用户id", required = true, example = "8214")
|
||||
@NotNull(message = "被邀请用户id不能为空")
|
||||
private Long beInviteUserId;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 邀请日志创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserInviteLogCreateReqVO extends UserInviteLogBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 邀请日志 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserInviteLogExcelVO {
|
||||
|
||||
@ExcelProperty("评论ID")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("邀请用户id")
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty("被邀请用户id")
|
||||
private Long beInviteUserId;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 邀请日志 Excel 导出 Request VO,参数和 UserInviteLogPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserInviteLogExportReqVO {
|
||||
|
||||
@Schema(description = "邀请用户id", example = "19165")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "被邀请用户id", example = "8214")
|
||||
private Long beInviteUserId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 邀请日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserInviteLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "邀请用户id", example = "19165")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "被邀请用户id", example = "8214")
|
||||
private Long beInviteUserId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 邀请日志 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserInviteLogRespVO extends UserInviteLogBaseVO {
|
||||
|
||||
@Schema(description = "评论ID", required = true, example = "12248")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userinvitelog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 邀请日志更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserInviteLogUpdateReqVO extends UserInviteLogBaseVO {
|
||||
|
||||
@Schema(description = "评论ID", required = true, example = "12248")
|
||||
@NotNull(message = "评论ID不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.userlevelconfig.UserLevelConfigDO;
|
||||
import co.yixiang.yshop.module.member.convert.userlevelconfig.UserLevelConfigConvert;
|
||||
import co.yixiang.yshop.module.member.service.userlevelconfig.UserLevelConfigService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员等级配置")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-level-config")
|
||||
@Validated
|
||||
public class UserLevelConfigController {
|
||||
|
||||
@Resource
|
||||
private UserLevelConfigService userLevelConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员等级配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:create')")
|
||||
public CommonResult<Long> createUserLevelConfig(@Valid @RequestBody UserLevelConfigCreateReqVO createReqVO) {
|
||||
return success(userLevelConfigService.createUserLevelConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员等级配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:update')")
|
||||
public CommonResult<Boolean> updateUserLevelConfig(@Valid @RequestBody UserLevelConfigUpdateReqVO updateReqVO) {
|
||||
userLevelConfigService.updateUserLevelConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员等级配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:delete')")
|
||||
public CommonResult<Boolean> deleteUserLevelConfig(@RequestParam("id") Long id) {
|
||||
userLevelConfigService.deleteUserLevelConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员等级配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:query')")
|
||||
public CommonResult<UserLevelConfigRespVO> getUserLevelConfig(@RequestParam("id") Long id) {
|
||||
UserLevelConfigRespVO vo = userLevelConfigService.getUserLevelConfigVO(id);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员等级配置列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:query')")
|
||||
public CommonResult<List<UserLevelConfigRespVO>> getUserLevelConfigList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<UserLevelConfigDO> list = userLevelConfigService.getUserLevelConfigList(ids);
|
||||
return success(UserLevelConfigConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员等级配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:query')")
|
||||
public CommonResult<PageResult<UserLevelConfigRespVO>> getUserLevelConfigPage(@Valid UserLevelConfigPageReqVO pageVO) {
|
||||
PageResult<UserLevelConfigDO> pageResult = userLevelConfigService.getUserLevelConfigPage(pageVO);
|
||||
return success(UserLevelConfigConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员等级配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-config:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserLevelConfigExcel(@Valid UserLevelConfigExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserLevelConfigDO> list = userLevelConfigService.getUserLevelConfigList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserLevelConfigExcelVO> datas = UserLevelConfigConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员等级配置.xls", "数据", UserLevelConfigExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 会员等级配置 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelConfigBaseVO {
|
||||
|
||||
@Schema(description = "等级名称", required = true, example = "yshop")
|
||||
@NotNull(message = "等级名称不能为空")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "等级", required = true)
|
||||
@NotNull(message = "等级不能为空")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "成长值", required = true)
|
||||
@NotNull(message = "成长值不能为空")
|
||||
private Integer growthValue;
|
||||
|
||||
@Schema(description = "图标", example = "https://www.yixiang.co")
|
||||
private String iconUrl;
|
||||
|
||||
@Schema(description = "背景", example = "https://www.yixiang.co")
|
||||
private String backgroundUrl;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "色号")
|
||||
private String colorNum;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo.UserLevelEquityRefCreateReqVO;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelConfigCreateReqVO extends UserLevelConfigBaseVO {
|
||||
|
||||
@Schema(description = "权益值列表")
|
||||
private List<UserLevelEquityRefCreateReqVO> levelEquityList;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 会员等级配置 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelConfigExcelVO {
|
||||
|
||||
@ExcelProperty("参数主键")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("等级名称")
|
||||
private String levelName;
|
||||
|
||||
@ExcelProperty("等级")
|
||||
private Integer level;
|
||||
|
||||
@ExcelProperty("成长值")
|
||||
private Integer growthValue;
|
||||
|
||||
@ExcelProperty("图标")
|
||||
private String iconUrl;
|
||||
|
||||
@ExcelProperty("背景")
|
||||
private String backgroundUrl;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
private Boolean status;
|
||||
|
||||
@ExcelProperty("说明")
|
||||
private String remarks;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级配置 Excel 导出 Request VO,参数和 UserLevelConfigPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserLevelConfigExportReqVO {
|
||||
|
||||
@Schema(description = "等级名称", example = "yshop")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "成长值")
|
||||
private Integer growthValue;
|
||||
|
||||
@Schema(description = "图标", example = "https://www.yixiang.co")
|
||||
private String iconUrl;
|
||||
|
||||
@Schema(description = "背景", example = "https://www.yixiang.co")
|
||||
private String backgroundUrl;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "等级名称", example = "yshop")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "成长值")
|
||||
private Integer growthValue;
|
||||
|
||||
@Schema(description = "图标", example = "https://www.yixiang.co")
|
||||
private String iconUrl;
|
||||
|
||||
@Schema(description = "背景", example = "https://www.yixiang.co")
|
||||
private String backgroundUrl;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo.UserLevelEquityRefCreateReqVO;
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo.UserLevelEquityRefRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelConfigRespVO extends UserLevelConfigBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "18027")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "权益值列表")
|
||||
private List<UserLevelEquityRefRespVO> levelEquityList;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelconfig.vo;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo.UserLevelEquityRefCreateReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级配置更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelConfigUpdateReqVO extends UserLevelConfigBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "18027")
|
||||
@NotNull(message = "参数主键不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "权益值列表")
|
||||
private List<UserLevelEquityRefCreateReqVO> levelEquityList;
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.userlevelequity.UserLevelEquityDO;
|
||||
import co.yixiang.yshop.module.member.convert.userlevelequity.UserLevelEquityConvert;
|
||||
import co.yixiang.yshop.module.member.service.userlevelequity.UserLevelEquityService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员等级权益配置")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-level-equity")
|
||||
@Validated
|
||||
public class UserLevelEquityController {
|
||||
|
||||
@Resource
|
||||
private UserLevelEquityService userLevelEquityService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员等级权益配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:create')")
|
||||
public CommonResult<Long> createUserLevelEquity(@Valid @RequestBody UserLevelEquityCreateReqVO createReqVO) {
|
||||
return success(userLevelEquityService.createUserLevelEquity(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员等级权益配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:update')")
|
||||
public CommonResult<Boolean> updateUserLevelEquity(@Valid @RequestBody UserLevelEquityUpdateReqVO updateReqVO) {
|
||||
userLevelEquityService.updateUserLevelEquity(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员等级权益配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:delete')")
|
||||
public CommonResult<Boolean> deleteUserLevelEquity(@RequestParam("id") Long id) {
|
||||
userLevelEquityService.deleteUserLevelEquity(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员等级权益配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:query')")
|
||||
public CommonResult<UserLevelEquityRespVO> getUserLevelEquity(@RequestParam("id") Long id) {
|
||||
UserLevelEquityDO userLevelEquity = userLevelEquityService.getUserLevelEquity(id);
|
||||
return success(UserLevelEquityConvert.INSTANCE.convert(userLevelEquity));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员等级权益配置列表")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:query')")
|
||||
public CommonResult<List<UserLevelEquityRespVO>> getUserLevelEquityList() {
|
||||
List<UserLevelEquityDO> list = userLevelEquityService.getUserLevelEquityList();
|
||||
return success(UserLevelEquityConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员等级权益配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:query')")
|
||||
public CommonResult<PageResult<UserLevelEquityRespVO>> getUserLevelEquityPage(@Valid UserLevelEquityPageReqVO pageVO) {
|
||||
PageResult<UserLevelEquityDO> pageResult = userLevelEquityService.getUserLevelEquityPage(pageVO);
|
||||
return success(UserLevelEquityConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员等级权益配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserLevelEquityExcel(@Valid UserLevelEquityExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserLevelEquityDO> list = userLevelEquityService.getUserLevelEquityList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserLevelEquityExcelVO> datas = UserLevelEquityConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员等级权益配置.xls", "数据", UserLevelEquityExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会员等级权益配置 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelEquityBaseVO {
|
||||
|
||||
@Schema(description = "权益类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "张三")
|
||||
private String typeName;
|
||||
|
||||
|
||||
@Schema(description = "图标", example = "https://www.yixiang.co")
|
||||
private String iconUrl;
|
||||
|
||||
@Schema(description = "权益值")
|
||||
private Long equityValue;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityCreateReqVO extends UserLevelEquityBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 会员等级权益配置 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelEquityExcelVO {
|
||||
|
||||
@ExcelProperty("参数主键")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("权益类型")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("类型名称")
|
||||
private String typeName;
|
||||
|
||||
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("图标")
|
||||
private String iconUrl;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益配置 Excel 导出 Request VO,参数和 UserLevelEquityPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserLevelEquityExportReqVO {
|
||||
|
||||
@Schema(description = "权益类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "张三")
|
||||
private String typeName;
|
||||
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "图标", example = "https://www.yixiang.co")
|
||||
private String iconUrl;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "权益类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "张三")
|
||||
private String typeName;
|
||||
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "图标", example = "https://www.yixiang.co")
|
||||
private String iconUrl;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityRespVO extends UserLevelEquityBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "19360")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益配置更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityUpdateReqVO extends UserLevelEquityBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "19360")
|
||||
@NotNull(message = "参数主键不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.userlevelequityref.UserLevelEquityRefDO;
|
||||
import co.yixiang.yshop.module.member.convert.userlevelequityref.UserLevelEquityRefConvert;
|
||||
import co.yixiang.yshop.module.member.service.userlevelequityref.UserLevelEquityRefService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员等级权益中间")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-level-equity-ref")
|
||||
@Validated
|
||||
public class UserLevelEquityRefController {
|
||||
|
||||
@Resource
|
||||
private UserLevelEquityRefService userLevelEquityRefService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员等级权益中间")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:create')")
|
||||
public CommonResult<Long> createUserLevelEquityRef(@Valid @RequestBody UserLevelEquityRefCreateReqVO createReqVO) {
|
||||
return success(userLevelEquityRefService.createUserLevelEquityRef(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员等级权益中间")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:update')")
|
||||
public CommonResult<Boolean> updateUserLevelEquityRef(@Valid @RequestBody UserLevelEquityRefUpdateReqVO updateReqVO) {
|
||||
userLevelEquityRefService.updateUserLevelEquityRef(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员等级权益中间")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:delete')")
|
||||
public CommonResult<Boolean> deleteUserLevelEquityRef(@RequestParam("id") Long id) {
|
||||
userLevelEquityRefService.deleteUserLevelEquityRef(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员等级权益中间")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:query')")
|
||||
public CommonResult<UserLevelEquityRefRespVO> getUserLevelEquityRef(@RequestParam("id") Long id) {
|
||||
UserLevelEquityRefDO userLevelEquityRef = userLevelEquityRefService.getUserLevelEquityRef(id);
|
||||
return success(UserLevelEquityRefConvert.INSTANCE.convert(userLevelEquityRef));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员等级权益中间列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:query')")
|
||||
public CommonResult<List<UserLevelEquityRefRespVO>> getUserLevelEquityRefList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<UserLevelEquityRefDO> list = userLevelEquityRefService.getUserLevelEquityRefList(ids);
|
||||
return success(UserLevelEquityRefConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员等级权益中间分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:query')")
|
||||
public CommonResult<PageResult<UserLevelEquityRefRespVO>> getUserLevelEquityRefPage(@Valid UserLevelEquityRefPageReqVO pageVO) {
|
||||
PageResult<UserLevelEquityRefDO> pageResult = userLevelEquityRefService.getUserLevelEquityRefPage(pageVO);
|
||||
return success(UserLevelEquityRefConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员等级权益中间 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-equity-ref:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserLevelEquityRefExcel(@Valid UserLevelEquityRefExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserLevelEquityRefDO> list = userLevelEquityRefService.getUserLevelEquityRefList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserLevelEquityRefExcelVO> datas = UserLevelEquityRefConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员等级权益中间.xls", "数据", UserLevelEquityRefExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 会员等级权益中间 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelEquityRefBaseVO {
|
||||
|
||||
@Schema(description = "等级ID", required = true, example = "31064")
|
||||
@NotNull(message = "等级ID不能为空")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "权益ID", required = true, example = "6319")
|
||||
@NotNull(message = "权益ID不能为空")
|
||||
private Long equityId;
|
||||
|
||||
@Schema(description = "权益值")
|
||||
private Long equityValue;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益中间创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityRefCreateReqVO extends UserLevelEquityRefBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 会员等级权益中间 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelEquityRefExcelVO {
|
||||
|
||||
@ExcelProperty("参数主键")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("等级ID")
|
||||
private Long levelId;
|
||||
|
||||
@ExcelProperty("权益ID")
|
||||
private Long equityId;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("权益值")
|
||||
private Long equityValue;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益中间 Excel 导出 Request VO,参数和 UserLevelEquityRefPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserLevelEquityRefExportReqVO {
|
||||
|
||||
@Schema(description = "等级ID", example = "31064")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "权益ID", example = "6319")
|
||||
private Long equityId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
@Schema(description = "权益值")
|
||||
private Long equityValue;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益中间分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityRefPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "等级ID", example = "31064")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "权益ID", example = "6319")
|
||||
private Long equityId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益中间 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityRefRespVO extends UserLevelEquityRefBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "11096")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelequityref.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员等级权益中间更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelEquityRefUpdateReqVO extends UserLevelEquityRefBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "11096")
|
||||
@NotNull(message = "参数主键不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.userlevelgrowthvalueconfig.UserLevelGrowthValueConfigDO;
|
||||
import co.yixiang.yshop.module.member.convert.userlevelgrowthvalueconfig.UserLevelGrowthValueConfigConvert;
|
||||
import co.yixiang.yshop.module.member.service.userlevelgrowthvalueconfig.UserLevelGrowthValueConfigService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员成长任务配置")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-level-growth-value-config")
|
||||
@Validated
|
||||
public class UserLevelGrowthValueConfigController {
|
||||
|
||||
@Resource
|
||||
private UserLevelGrowthValueConfigService userLevelGrowthValueConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员成长任务配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:create')")
|
||||
public CommonResult<Integer> createUserLevelGrowthValueConfig(@Valid @RequestBody UserLevelGrowthValueConfigCreateReqVO createReqVO) {
|
||||
return success(userLevelGrowthValueConfigService.createUserLevelGrowthValueConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员成长任务配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:update')")
|
||||
public CommonResult<Boolean> updateUserLevelGrowthValueConfig(@Valid @RequestBody UserLevelGrowthValueConfigUpdateReqVO updateReqVO) {
|
||||
userLevelGrowthValueConfigService.updateUserLevelGrowthValueConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员成长任务配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:delete')")
|
||||
public CommonResult<Boolean> deleteUserLevelGrowthValueConfig(@RequestParam("id") Integer id) {
|
||||
userLevelGrowthValueConfigService.deleteUserLevelGrowthValueConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员成长任务配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:query')")
|
||||
public CommonResult<UserLevelGrowthValueConfigRespVO> getUserLevelGrowthValueConfig(@RequestParam("id") Integer id) {
|
||||
UserLevelGrowthValueConfigDO userLevelGrowthValueConfig = userLevelGrowthValueConfigService.getUserLevelGrowthValueConfig(id);
|
||||
return success(UserLevelGrowthValueConfigConvert.INSTANCE.convert(userLevelGrowthValueConfig));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员成长任务配置列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:query')")
|
||||
public CommonResult<List<UserLevelGrowthValueConfigRespVO>> getUserLevelGrowthValueConfigList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<UserLevelGrowthValueConfigDO> list = userLevelGrowthValueConfigService.getUserLevelGrowthValueConfigList(ids);
|
||||
return success(UserLevelGrowthValueConfigConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员成长任务配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:query')")
|
||||
public CommonResult<PageResult<UserLevelGrowthValueConfigRespVO>> getUserLevelGrowthValueConfigPage(@Valid UserLevelGrowthValueConfigPageReqVO pageVO) {
|
||||
PageResult<UserLevelGrowthValueConfigDO> pageResult = userLevelGrowthValueConfigService.getUserLevelGrowthValueConfigPage(pageVO);
|
||||
return success(UserLevelGrowthValueConfigConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员成长任务配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-level-growth-value-config:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserLevelGrowthValueConfigExcel(@Valid UserLevelGrowthValueConfigExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserLevelGrowthValueConfigDO> list = userLevelGrowthValueConfigService.getUserLevelGrowthValueConfigList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserLevelGrowthValueConfigExcelVO> datas = UserLevelGrowthValueConfigConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员成长任务配置.xls", "数据", UserLevelGrowthValueConfigExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会员成长任务配置 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelGrowthValueConfigBaseVO {
|
||||
|
||||
@Schema(description = "成长任务类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "王五")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "成长值")
|
||||
private Integer growthValue;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String iconUrl;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员成长任务配置创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelGrowthValueConfigCreateReqVO extends UserLevelGrowthValueConfigBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 会员成长任务配置 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserLevelGrowthValueConfigExcelVO {
|
||||
|
||||
@ExcelProperty("参数主键")
|
||||
private Integer id;
|
||||
|
||||
@ExcelProperty("成长任务类型")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ExcelProperty("成长值")
|
||||
private Long growthValue;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员成长任务配置 Excel 导出 Request VO,参数和 UserLevelGrowthValueConfigPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserLevelGrowthValueConfigExportReqVO {
|
||||
|
||||
@Schema(description = "成长任务类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "王五")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "成长值")
|
||||
private Long growthValue;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员成长任务配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelGrowthValueConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "成长任务类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称", example = "王五")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "成长值")
|
||||
private Long growthValue;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员成长任务配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelGrowthValueConfigRespVO extends UserLevelGrowthValueConfigBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "871")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间", required = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.userlevelgrowthvalueconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员成长任务配置更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserLevelGrowthValueConfigUpdateReqVO extends UserLevelGrowthValueConfigBaseVO {
|
||||
|
||||
@Schema(description = "参数主键", required = true, example = "871")
|
||||
@NotNull(message = "参数主键不能为空")
|
||||
private Integer id;
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.usertag.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.usertag.UserTagDO;
|
||||
import co.yixiang.yshop.module.member.convert.usertag.UserTagConvert;
|
||||
import co.yixiang.yshop.module.member.service.usertag.UserTagService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员标签")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-tag")
|
||||
@Validated
|
||||
public class UserTagController {
|
||||
|
||||
@Resource
|
||||
private UserTagService userTagService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员标签")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:create')")
|
||||
public CommonResult<Long> createUserTag(@Valid @RequestBody UserTagCreateReqVO createReqVO) {
|
||||
return success(userTagService.createUserTag(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员标签")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:update')")
|
||||
public CommonResult<Boolean> updateUserTag(@Valid @RequestBody UserTagUpdateReqVO updateReqVO) {
|
||||
userTagService.updateUserTag(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员标签")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:delete')")
|
||||
public CommonResult<Boolean> deleteUserTag(@RequestParam("id") Long id) {
|
||||
userTagService.deleteUserTag(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员标签")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:query')")
|
||||
public CommonResult<UserTagRespVO> getUserTag(@RequestParam("id") Long id) {
|
||||
UserTagDO userTag = userTagService.getUserTag(id);
|
||||
return success(UserTagConvert.INSTANCE.convert(userTag));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员标签分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:query')")
|
||||
public CommonResult<PageResult<UserTagRespVO>> getUserTagPage(@Valid UserTagPageReqVO pageVO) {
|
||||
PageResult<UserTagDO> pageResult = userTagService.getUserTagPage(pageVO);
|
||||
return success(UserTagConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员标签列表")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:query')")
|
||||
public CommonResult<List<UserTagRespVO>> getUserTagList(@Valid UserTagPageReqVO pageVO) {
|
||||
List<UserTagDO> list = userTagService.getUserTagList(pageVO);
|
||||
return success(UserTagConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员标签 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserTagExcel(@Valid UserTagExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserTagDO> list = userTagService.getUserTagList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserTagExcelVO> datas = UserTagConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员标签.xls", "数据", UserTagExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 会员标签 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserTagBaseVO {
|
||||
|
||||
@Schema(description = "标签名称", example = "yshop")
|
||||
private String tagName;
|
||||
|
||||
@Schema(description = "分组ID", example = "14361")
|
||||
private Long groupId;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagCreateReqVO extends UserTagBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 会员标签 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserTagExcelVO {
|
||||
|
||||
@ExcelProperty("用户id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("标签名称")
|
||||
private String tagName;
|
||||
|
||||
@ExcelProperty("分组ID")
|
||||
private Long groupId;
|
||||
|
||||
@ExcelProperty("添加时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签 Excel 导出 Request VO,参数和 UserTagPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserTagExportReqVO {
|
||||
|
||||
@Schema(description = "标签名称", example = "yshop")
|
||||
private String tagName;
|
||||
|
||||
@Schema(description = "分组ID", example = "14361")
|
||||
private Long groupId;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "标签名称", example = "yshop")
|
||||
private String tagName;
|
||||
|
||||
@Schema(description = "分组ID", example = "14361")
|
||||
private Long groupId;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagRespVO extends UserTagBaseVO {
|
||||
|
||||
@Schema(description = "用户id", required = true, example = "8835")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "分组名称")
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "会员数")
|
||||
private Long userCount;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertag.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagUpdateReqVO extends UserTagBaseVO {
|
||||
|
||||
@Schema(description = "用户id", required = true, example = "8835")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import co.yixiang.yshop.framework.common.pojo.PageResult;
|
||||
import co.yixiang.yshop.framework.common.pojo.CommonResult;
|
||||
import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import co.yixiang.yshop.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import co.yixiang.yshop.framework.operatelog.core.annotations.OperateLog;
|
||||
import static co.yixiang.yshop.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo.*;
|
||||
import co.yixiang.yshop.module.member.dal.dataobject.usertaggroup.UserTagGroupDO;
|
||||
import co.yixiang.yshop.module.member.convert.usertaggroup.UserTagGroupConvert;
|
||||
import co.yixiang.yshop.module.member.service.usertaggroup.UserTagGroupService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员标签分组")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-tag-group")
|
||||
@Validated
|
||||
public class UserTagGroupController {
|
||||
|
||||
@Resource
|
||||
private UserTagGroupService userTagGroupService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员标签分组")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:create')")
|
||||
public CommonResult<Long> createUserTagGroup(@Valid @RequestBody UserTagGroupCreateReqVO createReqVO) {
|
||||
return success(userTagGroupService.createUserTagGroup(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员标签分组")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:update')")
|
||||
public CommonResult<Boolean> updateUserTagGroup(@Valid @RequestBody UserTagGroupUpdateReqVO updateReqVO) {
|
||||
userTagGroupService.updateUserTagGroup(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员标签分组")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:delete')")
|
||||
public CommonResult<Boolean> deleteUserTagGroup(@RequestParam("id") Long id) {
|
||||
userTagGroupService.deleteUserTagGroup(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员标签分组")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:query')")
|
||||
public CommonResult<UserTagGroupRespVO> getUserTagGroup(@RequestParam("id") Long id) {
|
||||
UserTagGroupDO userTagGroup = userTagGroupService.getUserTagGroup(id);
|
||||
return success(UserTagGroupConvert.INSTANCE.convert(userTagGroup));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员标签分组列表")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:query')")
|
||||
public CommonResult<List<UserTagGroupRespVO>> getUserTagGroupList() {
|
||||
List<UserTagGroupDO> list = userTagGroupService.getUserTagGroupList();
|
||||
return success(UserTagGroupConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员标签分组分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:query')")
|
||||
public CommonResult<PageResult<UserTagGroupRespVO>> getUserTagGroupPage(@Valid UserTagGroupPageReqVO pageVO) {
|
||||
PageResult<UserTagGroupDO> pageResult = userTagGroupService.getUserTagGroupPage(pageVO);
|
||||
return success(UserTagGroupConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员标签分组 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-tag-group:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserTagGroupExcel(@Valid UserTagGroupExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<UserTagGroupDO> list = userTagGroupService.getUserTagGroupList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<UserTagGroupExcelVO> datas = UserTagGroupConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "会员标签分组.xls", "数据", UserTagGroupExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 会员标签分组 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class UserTagGroupBaseVO {
|
||||
|
||||
@Schema(description = "分组名称", example = "赵六")
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sorted;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签分组创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagGroupCreateReqVO extends UserTagGroupBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 会员标签分组 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class UserTagGroupExcelVO {
|
||||
|
||||
@ExcelProperty("用户id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("分组名称")
|
||||
private String groupName;
|
||||
|
||||
@ExcelProperty("排序")
|
||||
private Integer sorted;
|
||||
|
||||
@ExcelProperty("添加时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签分组 Excel 导出 Request VO,参数和 UserTagGroupPageReqVO 是一致的")
|
||||
@Data
|
||||
public class UserTagGroupExportReqVO {
|
||||
|
||||
@Schema(description = "分组名称", example = "赵六")
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sorted;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import co.yixiang.yshop.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签分组分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagGroupPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分组名称", example = "赵六")
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sorted;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签分组 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagGroupRespVO extends UserTagGroupBaseVO {
|
||||
|
||||
@Schema(description = "用户id", required = true, example = "23630")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "添加时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package co.yixiang.yshop.module.member.controller.admin.usertaggroup.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员标签分组更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserTagGroupUpdateReqVO extends UserTagGroupBaseVO {
|
||||
|
||||
@Schema(description = "用户id", required = true, example = "23630")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user