Ver código fonte

fix:后端项目,修正借口参数表字段不正确的问题,将value(值)修正为paramType(数据类型),paramType修正为type(参数类型query|body)

yang yi 10 meses atrás
pai
commit
a52f2aad5d

+ 2 - 2
sql/init.sql

@@ -41,8 +41,8 @@ create table if not exists `interface_param`
     `interface_info_id` bigint not null comment '接口信息id',
     `name` varchar(256) not null comment '参数名称(参数类型为body时,名称使用body)',
     `description` varchar(256) null comment '参数描述',
-    `value` varchar(512) not null comment '参数值',
-    `param_type` int default 0 not null comment '参数类型(0:query,1:body)',
+    `type` int default 0 not null comment '参数类型(0:query,1:body)',
+    `param_type` char(32) default 'string' not null comment '数据类型',
     `user_id` bigint not null comment '创建人',
     `create_time` datetime default CURRENT_TIMESTAMP not null comment '创建时间',
     `update_time` datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',

+ 6 - 7
src/main/java/space/anyi/openAPI/model/interfaceParam/InterfaceParam.java

@@ -37,14 +37,13 @@ public class InterfaceParam implements Serializable {
     private String description;
 
     /**
-     * 参数值
+     * 数据类型
      */
-    private String value;
-
+    private String paramType;
     /**
      * 参数类型(0:query,1:body)
      */
-    private Integer paramType;
+    private Integer type;
 
     /**
      * 创建人
@@ -85,7 +84,7 @@ public class InterfaceParam implements Serializable {
             && (this.getInterfaceInfoId() == null ? other.getInterfaceInfoId() == null : this.getInterfaceInfoId().equals(other.getInterfaceInfoId()))
             && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
             && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
-            && (this.getValue() == null ? other.getValue() == null : this.getValue().equals(other.getValue()))
+            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
             && (this.getParamType() == null ? other.getParamType() == null : this.getParamType().equals(other.getParamType()))
             && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
             && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
@@ -101,7 +100,7 @@ public class InterfaceParam implements Serializable {
         result = prime * result + ((getInterfaceInfoId() == null) ? 0 : getInterfaceInfoId().hashCode());
         result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
         result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
-        result = prime * result + ((getValue() == null) ? 0 : getValue().hashCode());
+        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
         result = prime * result + ((getParamType() == null) ? 0 : getParamType().hashCode());
         result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
         result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
@@ -120,7 +119,7 @@ public class InterfaceParam implements Serializable {
         sb.append(", interfaceInfoId=").append(interfaceInfoId);
         sb.append(", name=").append(name);
         sb.append(", description=").append(description);
-        sb.append(", value=").append(value);
+        sb.append(", type=").append(type);
         sb.append(", paramType=").append(paramType);
         sb.append(", userId=").append(userId);
         sb.append(", createTime=").append(createTime);

+ 3 - 5
src/main/java/space/anyi/openAPI/model/interfaceParam/dto/RequestAddInterfaceParam.java

@@ -44,10 +44,8 @@ public class RequestAddInterfaceParam {
     /**
      * 参数值
      */
-    @ApiModelProperty(value = "参数值",required = true)
-    @NotEmpty(message = "参数值不能为空")
-    @NotBlank(message = "参数值不能为空")
-    private String value;
+    @ApiModelProperty(value = "参数数据类型")
+    private String paramType;
 
     /**
      * 参数类型(0:query,1:body)
@@ -56,6 +54,6 @@ public class RequestAddInterfaceParam {
     @NotNull(message = "参数类型不能为空")
     @Min(value = 0, message = "参数类型不能小于0")
     @Min(value = 1, message = "参数类型不能大于1")
-    private Integer paramType;
+    private Integer type;
 
 }

+ 3 - 4
src/main/java/space/anyi/openAPI/model/interfaceParam/dto/RequestUpdateInterfaceParam.java

@@ -49,9 +49,8 @@ public class RequestUpdateInterfaceParam {
     /**
      * 参数值
      */
-    @ApiModelProperty(value = "参数值",required = true)
-    @NotEmpty(message = "参数值不能为空")
-    private String value;
+    @ApiModelProperty(value = "参数数据类型")
+    private String paramType;
 
     /**
      * 参数类型(0:query,1:body)
@@ -60,6 +59,6 @@ public class RequestUpdateInterfaceParam {
     @NotNull(message = "参数类型不能为空")
     @Min(value = 0, message = "参数类型不能小于0")
     @Max(value = 1, message = "参数类型不能大于1")
-    private Integer paramType;
+    private Integer type;
 
 }

+ 3 - 4
src/main/java/space/anyi/openAPI/model/interfaceParam/vo/InterfaceParamVO.java

@@ -32,13 +32,12 @@ public class InterfaceParamVO {
     private String description;
 
     /**
-     * 参数值
+     * 数据类型
      */
-    private String value;
-
+    private String paramType;
     /**
      * 参数类型(0:query,1:body)
      */
-    private Integer paramType;
+    private Integer type;
 
 }

+ 3 - 3
src/main/resources/mapper/InterfaceParamMapper.xml

@@ -9,8 +9,8 @@
             <result property="interfaceInfoId" column="interface_info_id" jdbcType="BIGINT"/>
             <result property="name" column="name" jdbcType="VARCHAR"/>
             <result property="description" column="description" jdbcType="VARCHAR"/>
-            <result property="value" column="value" jdbcType="VARCHAR"/>
-            <result property="paramType" column="param_type" jdbcType="INTEGER"/>
+            <result property="paramType" column="param_type" jdbcType="CHAR"/>
+            <result property="type" column="type" jdbcType="INTEGER"/>
             <result property="userId" column="user_id" jdbcType="BIGINT"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
@@ -19,7 +19,7 @@
 
     <sql id="Base_Column_List">
         id,interface_info_id,name,
-        description,value,param_type,
+        description,type,param_type,
         user_id,create_time,update_time,
         delete_flag
     </sql>