code review:会员积分配置

This commit is contained in:
YunaiV 2023-06-17 18:33:17 +08:00
parent 798e322f08
commit fd072b7d6e
26 changed files with 212 additions and 557 deletions

View File

@ -0,0 +1,45 @@
package cn.iocoder.yudao.module.member.controller.admin.point;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigRespVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO;
import cn.iocoder.yudao.module.member.convert.point.MemberPointConfigConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import cn.iocoder.yudao.module.member.service.point.MemberPointConfigService;
import io.swagger.v3.oas.annotations.Operation;
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.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 会员积分设置")
@RestController
@RequestMapping("/point/config")
@Validated
public class MemberPointConfigController {
@Resource
private MemberPointConfigService memberPointConfigService;
@PutMapping("/update")
@Operation(summary = "保存会员积分配置")
@PreAuthorize("@ss.hasPermission('member:point-config:save')")
public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) {
memberPointConfigService.saveConfig(saveReqVO);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得会员积分配置")
@PreAuthorize("@ss.hasPermission('member:point-config:query')")
public CommonResult<MemberPointConfigRespVO> getConfig() {
MemberPointConfigDO config = memberPointConfigService.getConfig();
return success(MemberPointConfigConvert.INSTANCE.convert(config));
}
}

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.member.controller.admin.point.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 会员积分配置 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class MemberPointConfigBaseVO {
@Schema(description = "积分抵扣开关", required = true, example = "true")
private Boolean tradeDeductEnable;
@Schema(description = "积分抵扣,单位:分", example = "13506")
private BigDecimal tradeDeductUnitPrice;
@Schema(description = "积分抵扣最大值", example = "32428")
private Long tradeDeductMaxPrice;
@Schema(description = "1 元赠送多少分")
private Long tradeGivePoint;
}

View File

@ -0,0 +1,13 @@
package cn.iocoder.yudao.module.member.controller.admin.point.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 会员积分配置 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MemberPointConfigRespVO extends MemberPointConfigBaseVO {
}

View File

@ -0,0 +1,13 @@
package cn.iocoder.yudao.module.member.controller.admin.point.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 会员积分配置保存 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MemberPointConfigSaveReqVO extends MemberPointConfigBaseVO {
}

View File

@ -0,0 +1 @@
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.member.convert.point;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* 会员积分配置 Convert
*
* @author QingX
*/
@Mapper
public interface MemberPointConfigConvert {
MemberPointConfigConvert INSTANCE = Mappers.getMapper(MemberPointConfigConvert.class);
MemberPointConfigRespVO convert(MemberPointConfigDO bean);
}

View File

@ -1,15 +1,15 @@
package cn.iocoder.yudao.module.point.dal.dataobject.pointconfig;
package cn.iocoder.yudao.module.member.dal.dataobject.point;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import java.math.BigDecimal;
/**
* 积分设置 DO
* 会员积分配 DO
*
* @author QingX
*/
@ -21,7 +21,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PointConfigDO extends BaseDO {
public class MemberPointConfigDO extends BaseDO {
/**
* 自增主键
@ -29,23 +29,22 @@ public class PointConfigDO extends BaseDO {
@TableId
private Integer id;
/**
* 1 开启积分抵扣
0 关闭积分抵扣
*
* 枚举 {@link TODO infra_boolean_string 对应的类}
* 积分抵扣开关
*/
private Integer tradeDeductEnable;
private Boolean tradeDeductEnable;
/**
* 积分抵扣抵扣最低为分 以0.01表示 1积分抵扣0.01元(单位)
* 积分抵扣单位
*
* 1 积分抵扣多少分
*/
private BigDecimal tradeDeductUnitPrice;
/**
* 积分抵扣最大值
*/
private Long tradeDeductMaxPrice;
private Integer tradeDeductMaxPrice;
/**
* 1元赠送多少分
* 1 元赠送多少分
*/
private Long tradeGivePoint;
private Integer tradeGivePoint;
}

View File

@ -0,0 +1,14 @@
package cn.iocoder.yudao.module.member.dal.mysql.point;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 积分设置 Mapper
*
* @author QingX
*/
@Mapper
public interface MemberPointConfigMapper extends BaseMapperX<MemberPointConfigDO> {
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import javax.validation.Valid;
/**
* 会员积分配置 Service 接口
*
* @author QingX
*/
public interface MemberPointConfigService {
/**
* 保存会员积分配置
*
* @param saveReqVO 更新信息
*/
void saveConfig(@Valid MemberPointConfigSaveReqVO saveReqVO);
/**
* 获得会员积分配置
*
* @return 积分配置
*/
MemberPointConfigDO getConfig();
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointConfigMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
/**
* 会员积分配置 Service 实现类
*
* @author QingX
*/
@Service
@Validated
public class MemberPointConfigServiceImpl implements MemberPointConfigService {
@Resource
private MemberPointConfigMapper memberPointConfigMapper;
@Override
public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) {
// TODO qingx配置存在 update不存在则 insert
}
@Override
public MemberPointConfigDO getConfig() {
// TODO qingx直接查询到一条
return null;
}
}

View File

@ -1,102 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig;
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 cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO;
import cn.iocoder.yudao.module.point.convert.pointconfig.PointConfigConvert;
import cn.iocoder.yudao.module.point.service.pointconfig.PointConfigService;
@Tag(name = "管理后台 - 积分设置")
@RestController
@RequestMapping("/point/config")
@Validated
public class PointConfigController {
@Resource
private PointConfigService configService;
@PostMapping("/create")
@Operation(summary = "创建积分设置")
@PreAuthorize("@ss.hasPermission('point:config:create')")
public CommonResult<Integer> createConfig(@Valid @RequestBody PointConfigCreateReqVO createReqVO) {
return success(configService.createConfig(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新积分设置")
@PreAuthorize("@ss.hasPermission('point:config:update')")
public CommonResult<Boolean> updateConfig(@Valid @RequestBody PointConfigUpdateReqVO updateReqVO) {
configService.updateConfig(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除积分设置")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('point:config:delete')")
public CommonResult<Boolean> deleteConfig(@RequestParam("id") Integer id) {
configService.deleteConfig(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得积分设置")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:config:query')")
public CommonResult<PointConfigRespVO> getConfig(@RequestParam("id") Integer id) {
PointConfigDO config = configService.getConfig(id);
return success(PointConfigConvert.INSTANCE.convert(config));
}
@GetMapping("/list")
@Operation(summary = "获得积分设置列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('point:config:query')")
public CommonResult<List<PointConfigRespVO>> getConfigList(@RequestParam("ids") Collection<Integer> ids) {
List<PointConfigDO> list = configService.getConfigList(ids);
return success(PointConfigConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得积分设置分页")
@PreAuthorize("@ss.hasPermission('point:config:query')")
public CommonResult<PageResult<PointConfigRespVO>> getConfigPage(@Valid PointConfigPageReqVO pageVO) {
PageResult<PointConfigDO> pageResult = configService.getConfigPage(pageVO);
return success(PointConfigConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出积分设置 Excel")
@PreAuthorize("@ss.hasPermission('point:config:export')")
@OperateLog(type = EXPORT)
public void exportConfigExcel(@Valid PointConfigExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<PointConfigDO> list = configService.getConfigList(exportReqVO);
// 导出 Excel
List<PointConfigExcelVO> datas = PointConfigConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "积分设置.xls", "数据", PointConfigExcelVO.class, datas);
}
}

View File

@ -1,30 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* 积分设置 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class PointConfigBaseVO {
@Schema(description = "1 开启积分抵扣 0 关闭积分抵扣", example = "1")
private Integer tradeDeductEnable;
@Schema(description = "积分抵扣,抵扣最低为分 以0.01表示 1积分抵扣0.01元(单位:元)", example = "13506")
private BigDecimal tradeDeductUnitPrice;
@Schema(description = "积分抵扣最大值", example = "32428")
private Long tradeDeductMaxPrice;
@Schema(description = "1元赠送多少分")
private Long tradeGivePoint;
}

View File

@ -1,14 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.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 PointConfigCreateReqVO extends PointConfigBaseVO {
}

View File

@ -1,45 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
/**
* 积分设置 Excel VO
*
* @author QingX
*/
@Data
public class PointConfigExcelVO {
@ExcelProperty("自增主键")
private Integer id;
@ExcelProperty(value = "1 开启积分抵扣 0 关闭积分抵扣", converter = DictConvert.class)
@DictFormat("infra_boolean_string") // TODO 代码优化建议设置到对应的 XXXDictTypeConstants 枚举类中
private Integer tradeDeductEnable;
@ExcelProperty("积分抵扣,抵扣最低为分 以0.01表示 1积分抵扣0.01元(单位:元)")
private BigDecimal tradeDeductUnitPrice;
@ExcelProperty("积分抵扣最大值")
private Long tradeDeductMaxPrice;
@ExcelProperty("1元赠送多少分")
private Long tradeGivePoint;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("变更时间")
private LocalDateTime updateTime;
}

View File

@ -1,15 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@Schema(description = "管理后台 - 积分设置 Excel 导出 Request VO参数和 PointConfigPageReqVO 是一致的")
@Data
public class PointConfigExportReqVO {
@Schema(description = "1 开启积分抵扣 0 关闭积分抵扣", example = "1")
private Integer tradeDeductEnable;
}

View File

@ -1,17 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@Schema(description = "管理后台 - 积分设置分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PointConfigPageReqVO extends PageParam {
@Schema(description = "1 开启积分抵扣 0 关闭积分抵扣", example = "1")
private Integer tradeDeductEnable;
}

View File

@ -1,22 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.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 PointConfigRespVO extends PointConfigBaseVO {
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20937")
private Integer id;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "变更时间")
private LocalDateTime updateTime;
}

View File

@ -1,18 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointconfig.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 PointConfigUpdateReqVO extends PointConfigBaseVO {
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20937")
@NotNull(message = "自增主键不能为空")
private Integer id;
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.point.convert.pointconfig;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO;
/**
* 积分设置 Convert
*
* @author QingX
*/
@Mapper
public interface PointConfigConvert {
PointConfigConvert INSTANCE = Mappers.getMapper(PointConfigConvert.class);
PointConfigDO convert(PointConfigCreateReqVO bean);
PointConfigDO convert(PointConfigUpdateReqVO bean);
PointConfigRespVO convert(PointConfigDO bean);
List<PointConfigRespVO> convertList(List<PointConfigDO> list);
PageResult<PointConfigRespVO> convertPage(PageResult<PointConfigDO> page);
List<PointConfigExcelVO> convertList02(List<PointConfigDO> list);
}

View File

@ -1,32 +0,0 @@
package cn.iocoder.yudao.module.point.dal.mysql.pointconfig;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*;
/**
* 积分设置 Mapper
*
* @author QingX
*/
@Mapper
public interface PointConfigMapper extends BaseMapperX<PointConfigDO> {
default PageResult<PointConfigDO> selectPage(PointConfigPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PointConfigDO>()
.eqIfPresent(PointConfigDO::getTradeDeductEnable, reqVO.getTradeDeductEnable())
.orderByDesc(PointConfigDO::getId));
}
default List<PointConfigDO> selectList(PointConfigExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PointConfigDO>()
.eqIfPresent(PointConfigDO::getTradeDeductEnable, reqVO.getTradeDeductEnable())
.orderByDesc(PointConfigDO::getId));
}
}

View File

@ -1,70 +0,0 @@
package cn.iocoder.yudao.module.point.service.pointconfig;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 积分设置 Service 接口
*
* @author QingX
*/
public interface PointConfigService {
/**
* 创建积分设置
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createConfig(@Valid PointConfigCreateReqVO createReqVO);
/**
* 更新积分设置
*
* @param updateReqVO 更新信息
*/
void updateConfig(@Valid PointConfigUpdateReqVO updateReqVO);
/**
* 删除积分设置
*
* @param id 编号
*/
void deleteConfig(Integer id);
/**
* 获得积分设置
*
* @param id 编号
* @return 积分设置
*/
PointConfigDO getConfig(Integer id);
/**
* 获得积分设置列表
*
* @param ids 编号
* @return 积分设置列表
*/
List<PointConfigDO> getConfigList(Collection<Integer> ids);
/**
* 获得积分设置分页
*
* @param pageReqVO 分页查询
* @return 积分设置分页
*/
PageResult<PointConfigDO> getConfigPage(PointConfigPageReqVO pageReqVO);
/**
* 获得积分设置列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 积分设置列表
*/
List<PointConfigDO> getConfigList(PointConfigExportReqVO exportReqVO);
}

View File

@ -1,92 +0,0 @@
package cn.iocoder.yudao.module.point.service.pointconfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.point.convert.pointconfig.PointConfigConvert;
import cn.iocoder.yudao.module.point.dal.mysql.pointconfig.PointConfigMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*;
/**
* 积分设置 Service 实现类
*
* @author QingX
*/
@Service
@Validated
public class PointConfigServiceImpl implements PointConfigService {
@Autowired
private PointConfigMapper configMapper;
@Override
public Integer createConfig(PointConfigCreateReqVO createReqVO) {
// 插入
PointConfigDO config = PointConfigConvert.INSTANCE.convert(createReqVO);
//每个租户只允许存在一条记录
validateConfigExistsOne();
configMapper.insert(config);
// 返回
return config.getId();
}
@Override
public void updateConfig(PointConfigUpdateReqVO updateReqVO) {
// 校验存在
validateConfigExists(updateReqVO.getId());
// 更新
PointConfigDO updateObj = PointConfigConvert.INSTANCE.convert(updateReqVO);
configMapper.updateById(updateObj);
}
@Override
public void deleteConfig(Integer id) {
// 校验存在
validateConfigExists(id);
// 删除
configMapper.deleteById(id);
}
private void validateConfigExists(Integer id) {
if (configMapper.selectById(id) == null) {
throw exception(CONFIG_NOT_EXISTS);
}
}
private void validateConfigExistsOne() {
if (configMapper.selectCount() > 0) {
throw exception(CONFIG_EXISTS);
}
}
@Override
public PointConfigDO getConfig(Integer id) {
return configMapper.selectById(id);
}
@Override
public List<PointConfigDO> getConfigList(Collection<Integer> ids) {
return configMapper.selectBatchIds(ids);
}
@Override
public PageResult<PointConfigDO> getConfigPage(PointConfigPageReqVO pageReqVO) {
return configMapper.selectPage(pageReqVO);
}
@Override
public List<PointConfigDO> getConfigList(PointConfigExportReqVO exportReqVO) {
return configMapper.selectList(exportReqVO);
}
}

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.point.dal.mysql.pointconfig.PointConfigMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.point.dal.mysql.pointrecord.PointRecordMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.point.dal.mysql.signinconfig.SignInConfigMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.point.dal.mysql.signinrecord.SignInRecordMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>