Feat: Code gen V1
This commit is contained in:
parent
3aefaca837
commit
2a23f12188
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -185,7 +185,7 @@ public class SuperiorApiController {
|
|||
|
||||
@GetMapping("/superior-product-config/page")
|
||||
@Operation(summary = "获得产品对接上游配置分页")
|
||||
@Parameter(name = "haokaSuperiorApiId", description = "上游接口ID")
|
||||
@Parameter(name = "haokaSuperiorApiId", description = "ID")
|
||||
@PreAuthorize("@ss.hasPermission('haoka:superior-api:query')")
|
||||
public CommonResult<PageResult<SuperiorProductConfigDO>> getSuperiorProductConfigPage(PageParam pageReqVO,
|
||||
@RequestParam("haokaSuperiorApiId") Long haokaSuperiorApiId) {
|
||||
|
|
|
@ -15,18 +15,27 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
@ToString(callSuper = true)
|
||||
public class SuperiorApiDevConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "ID", example = "2733")
|
||||
@Schema(description = "ID", example = "627")
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
@Schema(description = "标识")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名字", example = "赵六")
|
||||
@Schema(description = "名字", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "输入类型", example = "2")
|
||||
private Integer inputType;
|
||||
|
||||
@Schema(description = "选项(逗号,分割)")
|
||||
private String inputSelectValues;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
|
|
@ -6,19 +6,17 @@ import java.util.*;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 上游API接口开发配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SuperiorApiDevConfigRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10380")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4692")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2733")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "627")
|
||||
@ExcelProperty("ID")
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
|
@ -26,7 +24,7 @@ public class SuperiorApiDevConfigRespVO {
|
|||
@ExcelProperty("标识")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("名字")
|
||||
private String name;
|
||||
|
||||
|
@ -34,18 +32,12 @@ public class SuperiorApiDevConfigRespVO {
|
|||
@ExcelProperty("值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "是否必填", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "是否必填", converter = DictConvert.class)
|
||||
@DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Boolean required;
|
||||
|
||||
@Schema(description = "说明")
|
||||
@ExcelProperty("说明")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "输入类型")
|
||||
@ExcelProperty(value = "输入类型", converter = DictConvert.class)
|
||||
@DictFormat("haoka_superior_api_input_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
@Schema(description = "输入类型", example = "2")
|
||||
@ExcelProperty("输入类型")
|
||||
private Integer inputType;
|
||||
|
||||
@Schema(description = "选项(逗号,分割)")
|
||||
|
|
|
@ -9,10 +9,10 @@ import jakarta.validation.constraints.*;
|
|||
@Data
|
||||
public class SuperiorApiDevConfigSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10380")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4692")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2733")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "627")
|
||||
@NotNull(message = "ID不能为空")
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class SuperiorApiDevConfigSaveReqVO {
|
|||
@NotEmpty(message = "标识不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "名字不能为空")
|
||||
private String name;
|
||||
|
||||
|
@ -28,14 +28,10 @@ public class SuperiorApiDevConfigSaveReqVO {
|
|||
@NotEmpty(message = "值不能为空")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "是否必填", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否必填不能为空")
|
||||
private Boolean required;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "输入类型")
|
||||
@Schema(description = "输入类型", example = "2")
|
||||
private Integer inputType;
|
||||
|
||||
@Schema(description = "选项(逗号,分割)")
|
||||
|
|
|
@ -15,10 +15,10 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
@ToString(callSuper = true)
|
||||
public class SuperiorProductConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "上游接口ID", example = "7050")
|
||||
@Schema(description = "上游接口ID", example = "31755")
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
@Schema(description = "产品", example = "26555")
|
||||
@Schema(description = "产品ID", example = "320")
|
||||
private Long haokaProductId;
|
||||
|
||||
@Schema(description = "是否已配置")
|
||||
|
@ -27,9 +27,6 @@ public class SuperiorProductConfigPageReqVO extends PageParam {
|
|||
@Schema(description = "值")
|
||||
private String config;
|
||||
|
||||
@Schema(description = "是否必填")
|
||||
private Boolean required;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
|
|
|
@ -14,16 +14,16 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
|||
@ExcelIgnoreUnannotated
|
||||
public class SuperiorProductConfigRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21785")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28128")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "上游接口ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7050")
|
||||
@Schema(description = "上游接口ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31755")
|
||||
@ExcelProperty("上游接口ID")
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "26555")
|
||||
@ExcelProperty("产品")
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "320")
|
||||
@ExcelProperty("产品ID")
|
||||
private Long haokaProductId;
|
||||
|
||||
@Schema(description = "是否已配置", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
@ -35,12 +35,7 @@ public class SuperiorProductConfigRespVO {
|
|||
@ExcelProperty("值")
|
||||
private String config;
|
||||
|
||||
@Schema(description = "是否必填")
|
||||
@ExcelProperty(value = "是否必填", converter = DictConvert.class)
|
||||
@DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Boolean required;
|
||||
|
||||
@Schema(description = "说明", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "说明")
|
||||
@ExcelProperty("说明")
|
||||
private String remarks;
|
||||
|
||||
|
|
|
@ -9,26 +9,26 @@ import jakarta.validation.constraints.*;
|
|||
@Data
|
||||
public class SuperiorProductConfigSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21785")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28128")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "上游接口ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7050")
|
||||
@Schema(description = "上游接口ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31755")
|
||||
@NotNull(message = "上游接口ID不能为空")
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "26555")
|
||||
@NotNull(message = "产品不能为空")
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "320")
|
||||
@NotNull(message = "产品ID不能为空")
|
||||
private Long haokaProductId;
|
||||
|
||||
@Schema(description = "是否已配置", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否已配置不能为空")
|
||||
private Boolean isConfined;
|
||||
|
||||
@Schema(description = "值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "值不能为空")
|
||||
private String config;
|
||||
|
||||
@Schema(description = "是否必填")
|
||||
private Boolean required;
|
||||
|
||||
@Schema(description = "说明", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "说明不能为空")
|
||||
@Schema(description = "说明")
|
||||
private String remarks;
|
||||
|
||||
}
|
|
@ -43,20 +43,12 @@ public class SuperiorApiDevConfigDO extends BaseDO {
|
|||
* 值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 是否必填
|
||||
*
|
||||
* 枚举 {@link TODO infra_boolean_string 对应的类}
|
||||
*/
|
||||
private Boolean required;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 输入类型
|
||||
*
|
||||
* 枚举 {@link TODO haoka_superior_api_input_type 对应的类}
|
||||
*/
|
||||
private Integer inputType;
|
||||
/**
|
||||
|
|
|
@ -32,7 +32,7 @@ public class SuperiorProductConfigDO extends BaseDO {
|
|||
*/
|
||||
private Long haokaSuperiorApiId;
|
||||
/**
|
||||
* 产品
|
||||
* 产品ID
|
||||
*/
|
||||
private Long haokaProductId;
|
||||
/**
|
||||
|
@ -45,12 +45,6 @@ public class SuperiorProductConfigDO extends BaseDO {
|
|||
* 值
|
||||
*/
|
||||
private String config;
|
||||
/**
|
||||
* 是否必填
|
||||
*
|
||||
* 枚举 {@link TODO infra_boolean_string 对应的类}
|
||||
*/
|
||||
private Boolean required;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
|
|
|
@ -21,9 +21,12 @@ public interface SuperiorApiDevConfigMapper extends BaseMapperX<SuperiorApiDevCo
|
|||
default PageResult<SuperiorApiDevConfigDO> selectPage(SuperiorApiDevConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SuperiorApiDevConfigDO>()
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getHaokaSuperiorApiId, reqVO.getHaokaSuperiorApiId())
|
||||
.likeIfPresent(SuperiorApiDevConfigDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(SuperiorApiDevConfigDO::getName, reqVO.getName())
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getValue, reqVO.getValue())
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getRemarks, reqVO.getRemarks())
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getInputType, reqVO.getInputType())
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getInputSelectValues, reqVO.getInputSelectValues())
|
||||
.betweenIfPresent(SuperiorApiDevConfigDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SuperiorApiDevConfigDO::getId));
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ public interface SuperiorProductConfigMapper extends BaseMapperX<SuperiorProduct
|
|||
.eqIfPresent(SuperiorProductConfigDO::getHaokaProductId, reqVO.getHaokaProductId())
|
||||
.eqIfPresent(SuperiorProductConfigDO::getIsConfined, reqVO.getIsConfined())
|
||||
.eqIfPresent(SuperiorProductConfigDO::getConfig, reqVO.getConfig())
|
||||
.eqIfPresent(SuperiorProductConfigDO::getRequired, reqVO.getRequired())
|
||||
.eqIfPresent(SuperiorProductConfigDO::getRemarks, reqVO.getRemarks())
|
||||
.betweenIfPresent(SuperiorProductConfigDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SuperiorProductConfigDO::getId));
|
||||
|
|
|
@ -143,7 +143,7 @@ public interface SuperiorApiService {
|
|||
* 获得产品对接上游配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @param haokaSuperiorApiId 上游接口ID
|
||||
* @param haokaSuperiorApiId ID
|
||||
* @return 产品对接上游配置分页
|
||||
*/
|
||||
PageResult<SuperiorProductConfigDO> getSuperiorProductConfigPage(PageParam pageReqVO, Long haokaSuperiorApiId);
|
||||
|
|
|
@ -114,6 +114,9 @@ public class SuperiorApiDevConfigServiceImplTest extends BaseDbUnitTest {
|
|||
o.setCode(null);
|
||||
o.setName(null);
|
||||
o.setValue(null);
|
||||
o.setRemarks(null);
|
||||
o.setInputType(null);
|
||||
o.setInputSelectValues(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
superiorApiDevConfigMapper.insert(dbSuperiorApiDevConfig);
|
||||
|
@ -125,6 +128,12 @@ public class SuperiorApiDevConfigServiceImplTest extends BaseDbUnitTest {
|
|||
superiorApiDevConfigMapper.insert(cloneIgnoreId(dbSuperiorApiDevConfig, o -> o.setName(null)));
|
||||
// 测试 value 不匹配
|
||||
superiorApiDevConfigMapper.insert(cloneIgnoreId(dbSuperiorApiDevConfig, o -> o.setValue(null)));
|
||||
// 测试 remarks 不匹配
|
||||
superiorApiDevConfigMapper.insert(cloneIgnoreId(dbSuperiorApiDevConfig, o -> o.setRemarks(null)));
|
||||
// 测试 inputType 不匹配
|
||||
superiorApiDevConfigMapper.insert(cloneIgnoreId(dbSuperiorApiDevConfig, o -> o.setInputType(null)));
|
||||
// 测试 inputSelectValues 不匹配
|
||||
superiorApiDevConfigMapper.insert(cloneIgnoreId(dbSuperiorApiDevConfig, o -> o.setInputSelectValues(null)));
|
||||
// 测试 createTime 不匹配
|
||||
superiorApiDevConfigMapper.insert(cloneIgnoreId(dbSuperiorApiDevConfig, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
|
@ -133,6 +142,9 @@ public class SuperiorApiDevConfigServiceImplTest extends BaseDbUnitTest {
|
|||
reqVO.setCode(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setValue(null);
|
||||
reqVO.setRemarks(null);
|
||||
reqVO.setInputType(null);
|
||||
reqVO.setInputSelectValues(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
|
|
|
@ -114,7 +114,6 @@ public class SuperiorProductConfigServiceImplTest extends BaseDbUnitTest {
|
|||
o.setHaokaProductId(null);
|
||||
o.setIsConfined(null);
|
||||
o.setConfig(null);
|
||||
o.setRequired(null);
|
||||
o.setRemarks(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
|
@ -127,8 +126,6 @@ public class SuperiorProductConfigServiceImplTest extends BaseDbUnitTest {
|
|||
superiorProductConfigMapper.insert(cloneIgnoreId(dbSuperiorProductConfig, o -> o.setIsConfined(null)));
|
||||
// 测试 config 不匹配
|
||||
superiorProductConfigMapper.insert(cloneIgnoreId(dbSuperiorProductConfig, o -> o.setConfig(null)));
|
||||
// 测试 required 不匹配
|
||||
superiorProductConfigMapper.insert(cloneIgnoreId(dbSuperiorProductConfig, o -> o.setRequired(null)));
|
||||
// 测试 remarks 不匹配
|
||||
superiorProductConfigMapper.insert(cloneIgnoreId(dbSuperiorProductConfig, o -> o.setRemarks(null)));
|
||||
// 测试 createTime 不匹配
|
||||
|
@ -139,7 +136,6 @@ public class SuperiorProductConfigServiceImplTest extends BaseDbUnitTest {
|
|||
reqVO.setHaokaProductId(null);
|
||||
reqVO.setIsConfined(null);
|
||||
reqVO.setConfig(null);
|
||||
reqVO.setRequired(null);
|
||||
reqVO.setRemarks(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@ spring:
|
|||
max-file-size: 16MB # 单个文件大小
|
||||
max-request-size: 32MB # 设置总上传的文件大小
|
||||
|
||||
flyway:
|
||||
out-of-order: true
|
||||
|
||||
# Jackson 配置项
|
||||
jackson:
|
||||
serialization:
|
||||
|
|
|
@ -2,13 +2,12 @@ DROP TABLE IF EXISTS `haoka_superior_product_config`;
|
|||
CREATE TABLE `haoka_superior_product_config`
|
||||
(
|
||||
`id` bigint(20) NOT NULL PRIMARY KEY COMMENT 'ID',
|
||||
`haoka_superior_api_id` bigint(20) NOT NULL COMMENT 'ID',
|
||||
`haoka_product_id` bigint(20) NOT NULL COMMENT 'ID',
|
||||
`haoka_superior_api_id` bigint(20) NOT NULL COMMENT '上游接口ID',
|
||||
`haoka_product_id` bigint(20) NOT NULL COMMENT '产品ID',
|
||||
|
||||
`is_confined` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已配置',
|
||||
`config` text NOT NULL COMMENT '值',
|
||||
`required` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否必填',
|
||||
`remarks` text NOT NULL COMMENT '说明',
|
||||
`remarks` text COMMENT '说明',
|
||||
|
||||
`dept_id` bigint(20) COMMENT '部门ID',
|
||||
`creator` varchar(64) NOT NULL DEFAULT '' COMMENT '创建者',
|
||||
|
|
|
@ -6,7 +6,6 @@ CREATE TABLE `haoka_superior_api_dev_config`
|
|||
`code` varchar(512) NOT NULL DEFAULT '' COMMENT '标识',
|
||||
`name` varchar(512) NOT NULL DEFAULT '' COMMENT '名字',
|
||||
`value` varchar(1024) NOT NULL DEFAULT '' COMMENT '值',
|
||||
`required` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否必填',
|
||||
`remarks` text COMMENT '说明',
|
||||
`input_type` int(11) NOT NULL DEFAULT 1 COMMENT '输入类型', -- 枚举:haoka_superior_api_input_type:输入,单选,多选
|
||||
`input_select_values` varchar(1024) NOT NULL DEFAULT '' COMMENT '选项(逗号,分割)',
|
||||
|
|
Loading…
Reference in New Issue