mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-03 22:57:14 +08:00
feat: 新增保存代码生成配置信息接口
This commit is contained in:
@@ -19,14 +19,16 @@ package top.charles7c.cnadmin.tool.model.entity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -44,47 +46,46 @@ import top.charles7c.cnadmin.tool.enums.FormTypeEnum;
|
||||
*/
|
||||
@Data
|
||||
@TableName("gen_column_mapping")
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "列映射信息")
|
||||
public class ColumnMappingDO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 表名称
|
||||
*/
|
||||
@Schema(description = "表名称")
|
||||
@NotBlank(message = "表名称不能为空")
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 列名称
|
||||
*/
|
||||
@Schema(description = "列名称")
|
||||
@NotBlank(message = "列名称不能为空")
|
||||
private String columnName;
|
||||
|
||||
/**
|
||||
* 列类型
|
||||
*/
|
||||
@Schema(description = "列类型")
|
||||
@NotBlank(message = "列类型不能为空")
|
||||
private String columnType;
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
@Schema(description = "字段名称")
|
||||
@NotBlank(message = "字段名称不能为空")
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*/
|
||||
@Schema(description = "字段类型")
|
||||
@NotBlank(message = "字段类型不能为空")
|
||||
private String fieldType;
|
||||
|
||||
/**
|
||||
@@ -93,12 +94,6 @@ public class ColumnMappingDO implements Serializable {
|
||||
@Schema(description = "注释")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
@@ -142,12 +137,9 @@ public class ColumnMappingDO implements Serializable {
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
public ColumnMappingDO(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public ColumnMappingDO setColumnName(String columnName) {
|
||||
this.columnName = columnName;
|
||||
|
||||
@@ -19,15 +19,16 @@ package top.charles7c.cnadmin.tool.model.entity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
/**
|
||||
* 生成配置实体
|
||||
@@ -37,35 +38,33 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
*/
|
||||
@Data
|
||||
@TableName("gen_config")
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "生成配置信息")
|
||||
public class GenConfigDO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 表名称
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@Schema(description = "表名称")
|
||||
@NotBlank(message = "表名称不能为空")
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
@Schema(description = "模块名称")
|
||||
@NotBlank(message = "模块名称不能为空")
|
||||
private String moduleName;
|
||||
|
||||
/**
|
||||
* 包名称
|
||||
*/
|
||||
@Schema(description = "包名称")
|
||||
@NotBlank(message = "包名称不能为空")
|
||||
private String packageName;
|
||||
|
||||
/**
|
||||
@@ -78,12 +77,14 @@ public class GenConfigDO implements Serializable {
|
||||
* 业务名称
|
||||
*/
|
||||
@Schema(description = "业务名称")
|
||||
@NotBlank(message = "业务名称不能为空")
|
||||
private String businessName;
|
||||
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
@Schema(description = "作者")
|
||||
@NotBlank(message = "作者名称不能为空")
|
||||
private String author;
|
||||
|
||||
/**
|
||||
@@ -96,6 +97,7 @@ public class GenConfigDO implements Serializable {
|
||||
* 是否覆盖
|
||||
*/
|
||||
@Schema(description = "是否覆盖")
|
||||
@NotNull(message = "是否覆盖不能为空")
|
||||
private Boolean isOverride;
|
||||
|
||||
/**
|
||||
@@ -111,4 +113,8 @@ public class GenConfigDO implements Serializable {
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public GenConfigDO(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.tool.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.charles7c.cnadmin.tool.model.entity.ColumnMappingDO;
|
||||
import top.charles7c.cnadmin.tool.model.entity.GenConfigDO;
|
||||
|
||||
/**
|
||||
* 代码生成配置信息
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/8/8 20:40
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "代码生成配置信息")
|
||||
public class GenConfigRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 列映射信息列表
|
||||
*/
|
||||
@Schema(description = "列映射信息列表")
|
||||
private List<ColumnMappingDO> columnMappings = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 生成配置信息
|
||||
*/
|
||||
@Schema(description = "生成配置信息")
|
||||
private GenConfigDO genConfig;
|
||||
}
|
||||
Reference in New Issue
Block a user