diff --git a/pom.xml b/pom.xml
index bc07be555b4568f829a60887571adcdc1b130086..3327a11caec2d20a3b86844333128ffb547406b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,6 +17,23 @@
1.8
2.4.2
+
+ 3.0.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2.0.8
+
@@ -82,6 +99,7 @@
commons-lang3
3.9
+
com.github.xiaoymin
knife4j-spring-boot-starter
@@ -135,7 +153,6 @@
-
org.apache.poi
poi
@@ -165,6 +182,26 @@
4.3.0
+
+
+ io.springfox
+ springfox-boot-starter
+ ${swagger.version}
+
+
+ io.swagger
+ swagger-models
+
+
+
+
+
+
+ com.github.xiaoymin
+ knife4j-spring-ui
+ ${knife4j-ui.version}
+
+
diff --git a/src/main/java/com/pms/ocp/common/config/SwaggerConfig.java b/src/main/java/com/pms/ocp/common/config/SwaggerConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..66f0b4e996f035848c23963e0e7efefe1b3ba36f
--- /dev/null
+++ b/src/main/java/com/pms/ocp/common/config/SwaggerConfig.java
@@ -0,0 +1,69 @@
+package com.pms.ocp.common.config;
+
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+
+/**
+ * @Auther: wangjian
+ * @Date: 2022/2/23 16:24
+ * @Description:
+ */
+
+@Configuration
+public class SwaggerConfig {
+
+ /**
+ * 是否开启swagger
+ */
+ @Value("${swagger.enabled}")
+ private boolean enabled;
+
+ /**
+ * 创建API
+ */
+ @Bean
+ public Docket api() {
+ return new Docket(DocumentationType.OAS_30)
+ //是否開啓Swagger
+ .enable(enabled)
+ // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
+ .apiInfo(apiInfo())
+ //分组名称
+ .groupName("模型库管理1.0版本")
+ // 设置哪些接口暴露给Swagger展示
+ .select()
+ // 扫描所有有注解的api,用这种方式更灵活
+ .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+ // 扫描指定包中的swagger注解
+ .apis(RequestHandlerSelectors.basePackage("com.pms.ocp"))
+ // 扫描所有 .apis(RequestHandlerSelectors.any())
+ .paths(PathSelectors.any())
+ .build();
+ }
+
+ /**
+ * 添加摘要信息
+ */
+ private ApiInfo apiInfo() {
+ // 用ApiInfoBuilder进行定制
+ return new ApiInfoBuilder()
+ // 设置标题
+ .title("运营管控架构平台_接口文档")
+ // 描述
+ .description("运营管控架构平台_接口文档")
+ // 作者信息
+ .contact(new Contact("", "", ""))
+ // 版本
+ .version("版本号: 1.0")
+ .build();
+ }
+}
diff --git a/src/main/java/com/pms/ocp/model/entity/Model.java b/src/main/java/com/pms/ocp/model/entity/Model.java
index 4b664974a9ccafe19a40fbe70ca0e32e286ccaa3..051d2e2fb0dde1d958756981df93afaa088f20e6 100644
--- a/src/main/java/com/pms/ocp/model/entity/Model.java
+++ b/src/main/java/com/pms/ocp/model/entity/Model.java
@@ -1,6 +1,12 @@
package com.pms.ocp.model.entity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
/**
* @Auther: wangjian
@@ -9,27 +15,126 @@ import lombok.Data;
*/
@Data
-//@TableName("mp_user")
+@Accessors(chain = true)
+@TableName("t_public_manage_model_base")
public class Model {
+ /**
+ * 模型编号
+ */
+ @TableId
+ private String modelId;
+
+ /**
+ * 模型名称
+ */
+ private String modelName;
+
+ /**
+ * 模型编码
+ */
+ private String modelCode;
+
+ /**
+ * 设备类型
+ */
+ private String equipType;
+
+ /**
+ * 所属专业
+ * 0:输电,1:变电,2:配电,3:直流,4:计划,5:技术
+ */
+ private String domainType;
+
+ /**
+ * 模型分类编号
+ */
+ private String modelGroupId;
+
+ /**
+ * 模型分类名称
+ */
+ private String modelGroupName;
+
+ /**
+ * 模型表
+ */
+ private String modelTable;
+
+ /**
+ * 模型关联关系
+ * 存储模型之间的关系json格式;例如[{ model_group_id : t_public_manage_model_group.group_id}]
+ */
+ private String modelRelation;
+
+ /**
+ * 模型是否启用
+ * 0:不启用,1:启用
+ */
+ @TableField(value = "is_use")
+ private String boolUse;
+
+ /**
+ * 模型推广类型
+ * 0:统推,1:自建
+ */
+ private String modelPromotion;
+
+ /**
+ * 省公司编号
+ */
+ private String companyId;
+
+ /**
+ * 省公司名称
+ */
+ private String companyName;
+
+ /**
+ * 模型显示顺序
+ */
+ @TableField(value = "model_dispidx")
+ private String modelDisplayOrder;
+
+ /**
+ * 模型提交人编号
+ */
+ private String modelUserId;
+
+ /**
+ * 提交人姓名
+ */
+ private String modelUserName;
+
+ /**
+ * 模型创建时间
+ */
+ @TableField(value = "model_ctime")
+ private LocalDateTime modelCreateTime;
+ /**
+ * 模型修改时间
+ */
+ @TableField(value = "model_mtime")
+ private LocalDateTime modelUpdateTime;
}
-// model_id
-// model_name
-// model_code
-// equip_type
-// domain_type
-// model_group_id
-// model_group_name
-// model_table
-// model_relation
-// Is_use
-// model_promotion
-// company_id
-// company_name
-// model_dispidx
-// model_user_id
-// model_user_name
-// model_ctime
-// model_mtime
+// 字段名称 字段描述 字段类型 允许为NULL 备注
+// model_id 主键 varchar(40) 否
+// model_name 模型名称 varchar(50) 否
+// model_code 模型编码 varchar(42) 否
+// equip_type 设备类型 varchar(42) 是
+// domain_type 所属专业 int4 是 0:输电,1:变电,2:配电,3:直流,4:计划,5:技术
+// model_group_id 模型分类id varchar(42) 否
+// model_group_name 模型分类名称 varchar(50) 否
+// model_table 模型表 varchar(50) 否
+// model_relation 模型关联关系 text 是 存储模型之间的关系json格式;例如[{ model_group_id : t_public_manage_model_group.group_id}]
+// Is_use 是否启用 int4 否 0:不启用,1:启用
+// model_promotion 推广类型 int4 否 0:统推,1:自建
+// company_id 省公司ID varchar(42) 是
+// company_name 省公司名称 varchar(50) 是
+// model_dispidx 显示顺序 int4 是
+// model_user_id 提交人id varchar(42) 是
+// model_user_name 提交人姓名 varchar(64) 是
+// model_ctime 创建时间 timestamp(6) 是
+// model_mtime 修改时间 timestamp(6) 是
diff --git a/src/main/java/com/pms/ocp/model/entity/ModelProperty.java b/src/main/java/com/pms/ocp/model/entity/ModelProperty.java
index f9c55c55785c1106588369cd25c13bc42e502e70..a3c88d799f5e4afa682b2956ad7a412646c85f15 100644
--- a/src/main/java/com/pms/ocp/model/entity/ModelProperty.java
+++ b/src/main/java/com/pms/ocp/model/entity/ModelProperty.java
@@ -1,5 +1,6 @@
package com.pms.ocp.model.entity;
+import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
/**
@@ -10,4 +11,35 @@ import lombok.Data;
@Data
public class ModelProperty {
+
+ /**
+ * 模型编号
+ */
+ @TableId
+ private String propId;
+
+ /**
+ * 模型名称
+ */
+ private String modelName;
}
+
+// 字段名称 字段描述 字段类型 允许为NULL 备注
+// prop_id 主键 varchar(42) 否
+// model_id 模型id varchar(42) 否
+// column_name 属性名称 varchar(50) 否
+// column_code 属性编码 varchar(42) 否
+// column_comments 属性描述 varchar(50) 否
+// data_type 数据类型 int4 否
+// data_length 数据长度 int4 是
+// data_scale 数据精度 int4 是
+// is_pk 是否主键 int4 否 0:否,1:是
+// is_required 是否必填 int4 是 0:否,1:是
+// prop_promotion 推广类型 int4 是 0:统推,1:自建
+// company_id 省公司ID varchar(42) 是
+// company_name 省公司名称 varchar(50) 是
+// prop _dispidx 显示顺序 int4 否
+// prop_user_id 提交人id varchar(42) 否
+// prop_user_name 提交人姓名 varchar(64) 否
+// prop_ctime 创建时间 timestamp(6) 否
+// prop_mtime 修改时间 timestamp(6) 否