From 1505a80dbfc0f3c59482c22c493e04929d91d2e8 Mon Sep 17 00:00:00 2001 From: wangshuai Date: Mon, 21 Sep 2020 17:15:37 +0800 Subject: [PATCH] 'commit' --- .../MyService/DataEX/DataexDAO/DataexDAO.go | 4 +- .../DataEX/DataexService/DataexService.go | 8 +-- .../Utils/ValidationUtil/ValidationUtil.go | 14 +++--- .../DataaccessOpenAPI/DataaccessOpenAPI.go | 20 ++++---- .../DataerrorOpenAPI/DataerrorOpenAPI.go | 2 +- .../DatasourceOpenAPI/DatasourceOpenAPI.go | 20 ++++---- .../JYT2012/Jyt2012OpenAPI/Jyt2012OpenAPI.go | 12 ++--- .../MetadataOpenAPI/MetadataOpenAPI.go | 26 +++++----- .../OrgTree/OrgtreeOpenAPI/OrgtreeOpenAPI.go | 49 +++++++++++++++++++ dsSupport/ReadMe | 4 ++ 10 files changed, 105 insertions(+), 54 deletions(-) create mode 100644 dsSupport/ReadMe diff --git a/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go b/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go index ca4bb6ff..8490fdcf 100644 --- a/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go +++ b/dsDataex/MyService/DataEX/DataexDAO/DataexDAO.go @@ -399,7 +399,7 @@ func SaveDataError2(fails []MySwagger.FailResult,datas []MySwagger.Data ,SystemI * @Return error 错误信息 */ func GetMetadataResults(conditions string) (bool, string, int, []map[string]interface{}, error) { - sql := "SELECT * FROM t_dataex_metadata WHERE 1 = 1 AND " + conditions + " AND eneble_flag = 1 ORDER BY create_time DESC, change_time DESC" + sql := "SELECT * FROM t_dataex_metadata WHERE 1 = 1 AND " + conditions + " AND enable_flag = 1 ORDER BY create_time DESC, change_time DESC" //数据条数 count, _ := DbUtil.Engine.SQL(sql).Query().Count() //分页数据 @@ -456,7 +456,7 @@ func GetJyt2012ResultsByParentId(parentId string) (bool, string, int, []map[stri } func GetJyt2012ResultsByParentIds(parentIds string) (bool, string, int, []map[string]interface{}, error) { - sql := "SELECT * FROM t_dataex_jyt2012 WHERE parent_id IN " + parentIds + " ORDER BY create_time DESC, change_time DESC" + sql := "SELECT * FROM t_dataex_jyt2012 WHERE parent_id IN (" + parentIds + ") ORDER BY create_time DESC, change_time DESC" //数据条数 count, _ := DbUtil.Engine.SQL(sql).Query().Count() if count > 0 { diff --git a/dsDataex/MyService/DataEX/DataexService/DataexService.go b/dsDataex/MyService/DataEX/DataexService/DataexService.go index e4f3df78..b90afe44 100644 --- a/dsDataex/MyService/DataEX/DataexService/DataexService.go +++ b/dsDataex/MyService/DataEX/DataexService/DataexService.go @@ -384,12 +384,12 @@ func DataexSetBatch(systemID string, datas []MySwagger.Data,datasource *models.T var failIDs []string var dataContentFailIDs []map[string]string - // 校验ESDataContent - // add by wangshuai 2020-09-16 + //校验ESDataContent + //add by wangshuai 2020-09-16 //_, _, successDatas, failureIDs := ValidationUtil.ValidESDataContent(esData.DatasourceId, datas) - // 将校验通过数据赋值给datas + //将校验通过数据赋值给datas //datas = successDatas - // 将校验失败数据赋值给failIDs + //将校验失败数据赋值给failIDs //failIDs = failureIDs //四、循环添加索引文档 diff --git a/dsDataex/Utils/ValidationUtil/ValidationUtil.go b/dsDataex/Utils/ValidationUtil/ValidationUtil.go index de7585c2..e9853350 100644 --- a/dsDataex/Utils/ValidationUtil/ValidationUtil.go +++ b/dsDataex/Utils/ValidationUtil/ValidationUtil.go @@ -39,21 +39,19 @@ func ValidESDataContent(datasourceCode string, datas []MySwagger.Data) (bool, st var dicIdsStr string conditions = "datasource_id='" + datasourceCode + "'" - // 从元数据集合获取该数据源对应的含有字典ID的字典ID集合 - //res, _, _, metadataDicIds, _ := DataexDAO.GetMetadataResults(conditions) - //if res == true { - // - //} // 获取该数据源对应的元数据集合 result, _, _, metadatas, _ := DataexDAO.GetMetadataResults(conditions) if result == true { - //dic := make(map[string]interface{}) for _, vv := range metadatas { - dicIds = append(dicIds, "'" + vv["dic_id"].(string) + "'") + // 从元数据集合获取该数据源对应的含有字典ID的字典ID集合 + if vv["dic_id"].(string) != "" { + dicIds = append(dicIds, "'" + vv["dic_id"].(string) + "'") + } } + // 字典ID集合字符串 dicIdsStr = strings.Join(dicIds, ", ") + // 获取含有 _, _, _, dics, _ = DataexDAO.GetJyt2012ResultsByParentIds(dicIdsStr) - for no := 0; no < len(datas) && no < 1000; no++ { r = true var jsonData map[string]interface{} diff --git a/dsSupport/MyModel/DataAccess/DataaccessOpenAPI/DataaccessOpenAPI.go b/dsSupport/MyModel/DataAccess/DataaccessOpenAPI/DataaccessOpenAPI.go index effd4194..a46095d8 100644 --- a/dsSupport/MyModel/DataAccess/DataaccessOpenAPI/DataaccessOpenAPI.go +++ b/dsSupport/MyModel/DataAccess/DataaccessOpenAPI/DataaccessOpenAPI.go @@ -17,8 +17,8 @@ import ( // @Description json:"`consume_systemid`" xorm:"not null comment('数据使用系统编码') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" // @Description json:"query_flag" xorm:"not null default 1 comment('可查【1:是,-1:否】') INT(11)" example:"1" // @Description json:"set_flag" xorm:"not null default -1 comment('可修改【1:是,-1:否】') INT(11)" example:"1" -// @Description json:"consume_type" xorm:"not null comment('使用数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"-1" -// @Description json:"`consume_orgid`" xorm:"not null comment('使用数据机构编码【-1:不限制】') index VARCHAR(36)" example:"-1" +// @Description `*`json:"consume_type" xorm:"not null comment('使用数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"-1" +// @Description `*`json:"consume_orgid" xorm:"not null comment('使用数据机构ID【-1:不限制】') index VARCHAR(36)" example:"-1" // @Description json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-22 17:26:53" @@ -72,14 +72,14 @@ func ReadDataaccess(c *gin.Context) { // 创建数据订阅 godoc // @Summary 创建数据订阅 -// @Description json:"datasource_id" xorm:"not null comment('数据源ID') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" -// @Description json:"datasource_code" xorm:"comment('数据源编码') default 'NULL' VARCHAR(255)" -// @Description json:"`source_systemid`" xorm:"not null comment('源系统编码') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" -// @Description json:"`consume_systemid`" xorm:"not null comment('数据使用系统编码') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" +// @Description `*`json:"datasource_id" xorm:"not null comment('数据源ID') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" +// @Description `*`json:"datasource_code" xorm:"comment('数据源编码') default 'NULL' VARCHAR(255)" +// @Description `*`json:"`source_systemid`" xorm:"not null comment('源系统编码') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" +// @Description `*`json:"`consume_systemid`" xorm:"not null comment('数据使用系统编码') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" // @Description json:"query_flag" xorm:"not null default 1 comment('可查【1:是,-1:否】') INT(11)" example:"1" // @Description json:"set_flag" xorm:"not null default -1 comment('可修改【1:是,-1:否】') INT(11)" example:"1" -// @Description json:"consume_type" xorm:"not null comment('使用数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"-1" -// @Description json:"`consume_orgid`" xorm:"not null comment('使用数据机构编码【-1:不限制】') index VARCHAR(36)" example:"-1" +// @Description `*`json:"consume_type" xorm:"not null comment('使用数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"-1" +// @Description `*`json:"consume_orgid" xorm:"not null comment('使用数据机构ID【-1:不限制】') index VARCHAR(36)" example:"-1" // @Description json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-22 17:26:53" @@ -133,7 +133,7 @@ func CreateDataaccess(c *gin.Context) { // @Description json:"query_flag" xorm:"not null default 1 comment('可查【1:是,-1:否】') INT(11)" example:"1" // @Description json:"set_flag" xorm:"not null default -1 comment('可修改【1:是,-1:否】') INT(11)" example:"1" // @Description json:"consume_type" xorm:"not null comment('使用数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"-1" -// @Description json:"`consume_orgid`" xorm:"not null comment('使用数据机构编码【-1:不限制】') index VARCHAR(36)" example:"-1" +// @Description json:"consume_orgid" xorm:"not null comment('使用数据机构ID【-1:不限制】') index VARCHAR(36)" example:"-1" // @Description json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-22 17:26:53" @@ -183,7 +183,7 @@ func UpdateDataaccess(c *gin.Context) { // 删除数据订阅 godoc // @Summary 删除数据订阅 -// @Description json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" +// @Description `*`json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" // @Tags dataaccess // @ID deleteDataaccess // @Accept json diff --git a/dsSupport/MyModel/DataError/DataerrorOpenAPI/DataerrorOpenAPI.go b/dsSupport/MyModel/DataError/DataerrorOpenAPI/DataerrorOpenAPI.go index d1c0c79e..7515c09a 100644 --- a/dsSupport/MyModel/DataError/DataerrorOpenAPI/DataerrorOpenAPI.go +++ b/dsSupport/MyModel/DataError/DataerrorOpenAPI/DataerrorOpenAPI.go @@ -79,7 +79,7 @@ func ReadDataerror(c *gin.Context) { // 删除数据异常 godoc // @Summary 删除数据异常 -// @Description json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" +// @Description `*`json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" // @Tags dataerror // @ID deleteDataerror // @Accept json diff --git a/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go b/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go index 2027cc77..ed7ac25d 100644 --- a/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go +++ b/dsSupport/MyModel/DataSource/DatasourceOpenAPI/DatasourceOpenAPI.go @@ -71,15 +71,15 @@ func ReadDatasource(c *gin.Context) { // 创建数据源 godoc // @Summary 创建数据源 -// @Description json:"`system_id`" xorm:"not null comment('数据提供系统编码') index VARCHAR(36)" example:"1C0F6832-65C6-4888-BDDE-A3373B11499D" -// @Description json:"datasource_name" xorm:"not null comment('数据源名称') VARCHAR(100)" example:"组织机构信息" -// @Description json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" +// @Description `*`json:"`system_id`" xorm:"not null comment('数据提供系统编码') index VARCHAR(36)" example:"1C0F6832-65C6-4888-BDDE-A3373B11499D" +// @Description `*`json:"datasource_name" xorm:"not null comment('数据源名称') VARCHAR(100)" example:"组织机构信息" +// @Description `*`json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" // @Description json:"datasource_detail" xorm:"default 'NULL' comment('数据源说明') VARCHAR(500)" example:"教育主管单位、教辅单位、各级各类学校机构信息" // @Description json:"set_flag" xorm:"not null default 1 comment('可修改【1:是,-1:否】') INT(11)" example:"1" // @Description json:"collect_flag" xorm:"not null default 1 comment('可汇集【1:是,-1:否】') INT(11)" example:"1" -// @Description json:"provide_type" xorm:"not null comment('提供数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"2" -// @Description json:"provide_orgid" xorm:"not null comment('提供数据机构ID【-1:不限制】') index VARCHAR(36)" example:"-1" -// @Description json:"datastore_type" xorm:"not null comment('数据存储类型【1:DB,2:ES,3:Kafka】') INT(11)" example:"2" +// @Description `*`json:"provide_type" xorm:"not null comment('提供数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') INT(11)" example:"2" +// @Description `*`json:"provide_orgid" xorm:"not null comment('提供数据机构ID【-1:不限制】') index VARCHAR(36)" example:"-1" +// @Description `*`json:"datastore_type" xorm:"not null comment('数据存储类型【1:DB,2:ES,3:Kafka】') INT(11)" example:"2" // @Description json:"dic_id, omitempty" xorm:"default 'NULL' comment('数据字典ID') index VARCHAR(36)" example:"1C0F6832-65C6-4888-BDDE-A3373B11499D" // @Description json:"delete_flag" xorm:"not null default -1 comment('删除标志【默认-1,1:删除,-1:正常】') INT(11)" example:"1" // @Description json:"enable_flag" xorm:"not null default 1 comment('启用标志【默认1,1:启用,-1:禁用】') INT(11)" example:"1" @@ -186,7 +186,7 @@ func UpdateDatasource(c *gin.Context) { // 删除数据源 godoc // @Summary 删除数据源 -// @Description json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" +// @Description `*`json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" // @Tags datasource // @ID deleteDatasource // @Accept json @@ -223,7 +223,7 @@ func DeleteDatasource(c *gin.Context) { // 获取es数据列表 godoc // @Summary 获取es数据列表 -// @Description json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" +// @Description `*`json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" // @Description json:"`orgids`" xorm:"not null comment('提供数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') VARCHAR(36)" example:"[F38BD0DB-0142-4356-8F2B-623813FC2578,F38BD0DB-0142-4356-8F2B-623813FC2578]" // @Description json:"begin_time" example:"2020-06-22 17:26:53"` // @Description json:"conditions" example:"" @@ -281,12 +281,12 @@ func ReadESDoc(c *gin.Context) { // 获取es数据 godoc // @Summary 获取es数据 -// @Description json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" +// @Description `*`json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" // @Description json:"`orgids`" xorm:"not null comment('提供数据范围【1:本机构,2:本机构以及下属机构,-1:不限制】') VARCHAR(36)" example:"[F38BD0DB-0142-4356-8F2B-623813FC2578,F38BD0DB-0142-4356-8F2B-623813FC2578]" // @Description json:"begin_time" example:"2020-06-22 17:26:53"` // @Description json:"conditions" example:"" // @Description json:"sort" example:"" -// @Description json:"data_id" example:"CfBQnRJPyXMEI5nqLT0" +// @Description `*`json:"data_id" example:"CfBQnRJPyXMEI5nqLT0" // @Tags datasource // @ID getESDoc // @Accept json diff --git a/dsSupport/MyModel/JYT2012/Jyt2012OpenAPI/Jyt2012OpenAPI.go b/dsSupport/MyModel/JYT2012/Jyt2012OpenAPI/Jyt2012OpenAPI.go index a8ac2a46..254e4cc0 100644 --- a/dsSupport/MyModel/JYT2012/Jyt2012OpenAPI/Jyt2012OpenAPI.go +++ b/dsSupport/MyModel/JYT2012/Jyt2012OpenAPI/Jyt2012OpenAPI.go @@ -80,13 +80,13 @@ func ReadJyt2012(c *gin.Context) { // 创建标准字典 godoc // @Summary 创建标准字典 -// @Description json:"dic_name" xorm:"not null comment('字典/字典项名称') VARCHAR(100)" example:"sex" -// @Description json:"dic_value" xorm:"not null comment('字典/字典项值') VARCHAR(100)" example:"10" -// @Description json:"dic_type" xorm:"not null default 1 comment('字典类型【1:国标数据、关联数据源,2:国标字典、关联元数据】') INT(11)" example:"1" -// @Description json:"dic_info" xorm:"default ''NULL'' comment('字典项说明') VARCHAR(500)" example:"我是字典项说明" +// @Description `*`json:"dic_name" xorm:"not null comment('字典/字典项名称') VARCHAR(100)" example:"sex" +// @Description `*`json:"dic_value" xorm:"not null comment('字典/字典项值') VARCHAR(100)" example:"10" +// @Description `*`json:"dic_type" xorm:"not null default 1 comment('字典类型【1:国标数据、关联数据源,2:国标字典、关联元数据】') INT(11)" example:"1" +// @Description `*`json:"dic_info" xorm:"default ''NULL'' comment('字典项说明') VARCHAR(500)" example:"我是字典项说明" // @Description json:"root_flag" xorm:"not null default -1 comment('是否是字典【1:是,-1:否】') INT(11)" example:"1" // @Description json:"jyt_flag" xorm:"not null default 1 comment('是否国标【1:是,-1:自定义】') INT(11)" example:"1" -// @Description json:"parent_id" xorm:"default ''NULL'' comment('字典ID【字典项父节点】') VARCHAR(36)" example:"38BD0DB-0142-4356-8F2B-623813FC2578" +// @Description `*`json:"parent_id" xorm:"default ''NULL'' comment('字典ID【字典项父节点】') VARCHAR(36)" example:"38BD0DB-0142-4356-8F2B-623813FC2578" // @Description json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-22 17:26:53" // @Description json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-22 17:26:53" @@ -189,7 +189,7 @@ func UpdateJyt2012(c *gin.Context) { // 删除标准字典 godoc // @Summary 删除标准字典 -// @Description json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" +// @Description `*`json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" // @Tags jyt2012 // @ID deleteJyt2012 // @Accept json diff --git a/dsSupport/MyModel/MetaData/MetadataOpenAPI/MetadataOpenAPI.go b/dsSupport/MyModel/MetaData/MetadataOpenAPI/MetadataOpenAPI.go index 0c8cc65f..1f73c0ad 100644 --- a/dsSupport/MyModel/MetaData/MetadataOpenAPI/MetadataOpenAPI.go +++ b/dsSupport/MyModel/MetaData/MetadataOpenAPI/MetadataOpenAPI.go @@ -70,18 +70,18 @@ func ReadMetadata(c *gin.Context) { // 创建元数据 godoc // @Summary 创建元数据 -// @Description json:"`datasource_id`" xorm:"default ''NULL'' comment('数据源编码') index VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA" -// @Description json:"item_name" xorm:"not null comment('数据项名称【英文】') VARCHAR(50)" example:"org_name" +// @Description `*`json:"`datasource_id`" xorm:"default ''NULL'' comment('数据源编码') index VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA" +// @Description `*`json:"item_name" xorm:"not null comment('数据项名称【英文】') VARCHAR(50)" example:"org_name" // @Description json:"dic_id" xorm:"default ''NULL'' comment('数据字典ID') index VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578" -// @Description json:"item_type" xorm:"default ''NULL'' comment('数据项类型【1:整数、2:浮点、3:字符、4:布尔、5:日期、6:时间、7:日期+时间】') VARCHAR(50)" example:"string" -// @Description json:"item_length" xorm:"default NULL comment('数据最大长度【UTF-8 字符长度】') INT(11)" example:"36" -// @Description json:"item_pattern" xorm:"default 'NULL' comment('数据项模式') VARCHAR(255)" example:"" -// @Description json:"item_info" xorm:"not null comment('数据项说明') VARCHAR(50)" example:"我是数据项说明" -// @Description json:"check_name" xorm:"not null default -1 comment('是否检测名称【1:是,-1:否】') INT(11)" example:"1" -// @Description json:"check_dic" xorm:"not null default -1 comment('是否检测字典') INT(11)" example:"1" -// @Description json:"check_type" xorm:"not null default -1 comment('是否检测类型') INT(11)" example:"1" -// @Description json:"check_pattern" xorm:"not null default -1 comment('是否检测模式') INT(11)" example:"1" -// @Description json:"check_exist" xorm:"not null default -1 comment('是否检测必填') INT(11)" example:"1" +// @Description `*`json:"item_type" xorm:"default ''NULL'' comment('数据项类型【1:整数、2:浮点、3:字符、4:布尔、5:日期、6:时间、7:日期+时间】') VARCHAR(50)" example:"string" +// @Description `*`json:"item_length" xorm:"default NULL comment('数据最大长度【UTF-8 字符长度】') INT(11)" example:"36" +// @Description `*`json:"item_pattern" xorm:"default 'NULL' comment('数据项模式') VARCHAR(255)" example:"" +// @Description `*`json:"item_info" xorm:"not null comment('数据项说明') VARCHAR(50)" example:"我是数据项说明" +// @Description `*`json:"check_name" xorm:"not null default -1 comment('是否检测名称【1:是,-1:否】') INT(11)" example:"1" +// @Description `*`json:"check_dic" xorm:"not null default -1 comment('是否检测字典') INT(11)" example:"1" +// @Description `*`json:"check_type" xorm:"not null default -1 comment('是否检测类型') INT(11)" example:"1" +// @Description `*`json:"check_pattern" xorm:"not null default -1 comment('是否检测模式') INT(11)" example:"1" +// @Description `*`json:"check_exist" xorm:"not null default -1 comment('是否检测必填') INT(11)" example:"1" // @Description json:"delete_flag" xorm:"not null default -1 comment('删除标志【默认-1,1:删除,-1:正常】') INT(11)" example:"1" // @Description json:"enable_flag" xorm:"not null default 1 comment('启用标志【默认1,1:启用,-1:禁用】') INT(11)" example:"1" // @Tags metadata @@ -183,7 +183,7 @@ func UpdateMetadata(c *gin.Context) { // 删除元数据 godoc // @Summary 删除元数据 -// @Description json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" +// @Description `*`json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" // @Tags metadata // @ID deleteMetadata // @Accept json @@ -220,7 +220,7 @@ func DeleteMetadata(c *gin.Context) { // 创建ES元数据 godoc // @Summary 创建ES元数据 -// @Description json:"index_name" xorm:"not null comment('ES Index Name') VARCHAR(50)" example:"org_tree" +// @Description `*`json:"index_name" xorm:"not null comment('ES Index Name') VARCHAR(50)" example:"org_tree" // @Tags metadata // @ID createMetadataES // @Accept json diff --git a/dsSupport/MyModel/OrgTree/OrgtreeOpenAPI/OrgtreeOpenAPI.go b/dsSupport/MyModel/OrgTree/OrgtreeOpenAPI/OrgtreeOpenAPI.go index 2b44f1df..ae0daaaa 100644 --- a/dsSupport/MyModel/OrgTree/OrgtreeOpenAPI/OrgtreeOpenAPI.go +++ b/dsSupport/MyModel/OrgTree/OrgtreeOpenAPI/OrgtreeOpenAPI.go @@ -12,6 +12,22 @@ import ( // 获取机构列表 godoc // @Summary 获取机构列表 // @Description 获取机构列表 +// @Description `json:"id" xorm:"not null pk comment('ID【根节点默认为-1】') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"org_name" xorm:"not null comment('机构名称') VARCHAR(100)" example:"开平区教育局"` +// @Description `json:"org_type" xorm:"not null comment('机构类型【1:教育局、2:学校、3:教辅单位、4:大学区、5:部门、6、主校,7、学段、8:年级、9:班级】') INT(11)" example:"1"` +// @Description `json:"parent_id" xorm:"default ''NULL'' comment('父节点ID') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"cat_id" xorm:"not null comment('层级ID【4位数字一组、右侧多级累加】') VARCHAR(100)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"province_id" xorm:"default 'NULL' comment('省编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"city_id" xorm:"default 'NULL' comment('地市编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"area_id" xorm:"default 'NULL' comment('县区编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"`linksystem_id`" xorm:"default 'NULL' comment('源业务系统编码') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"link_id" xorm:"default 'NULL' comment('业务系统机构原ID') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"delete_flag" xorm:"not null default -1 comment('删除标志【默认-1,1:删除,-1:正常】') INT(11)" example:"1"` +// @Description `json:"enable_flag" xorm:"not null default 1 comment('启用标志【默认1,1:启用,-1:禁用】') INT(11)" example:"1"` +// @Description `json:"page" example:"1"` // @Tags orgtree // @ID readOrgtree // @Accept json @@ -55,6 +71,22 @@ func ReadOrgtree(c *gin.Context) { // 创建机构 godoc // @Summary 创建机构 // @Description 创建机构 +// @Description `json:"id" xorm:"not null pk comment('ID【根节点默认为-1】') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `*`json:"org_name" xorm:"not null comment('机构名称') VARCHAR(100)" example:"开平区教育局"` +// @Description `*`json:"org_type" xorm:"not null comment('机构类型【1:教育局、2:学校、3:教辅单位、4:大学区、5:部门、6、主校,7、学段、8:年级、9:班级】') INT(11)" example:"1"` +// @Description `*`json:"parent_id" xorm:"default ''NULL'' comment('父节点ID') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"cat_id" xorm:"not null comment('层级ID【4位数字一组、右侧多级累加】') VARCHAR(100)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `*`json:"province_id" xorm:"default 'NULL' comment('省编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `*`json:"city_id" xorm:"default 'NULL' comment('地市编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `*`json:"area_id" xorm:"default 'NULL' comment('县区编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `*`json:"`linksystem_id`" xorm:"default 'NULL' comment('源业务系统编码') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"link_id" xorm:"default 'NULL' comment('业务系统机构原ID') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"delete_flag" xorm:"not null default -1 comment('删除标志【默认-1,1:删除,-1:正常】') INT(11)" example:"1"` +// @Description `json:"enable_flag" xorm:"not null default 1 comment('启用标志【默认1,1:启用,-1:禁用】') INT(11)" example:"1"` +// @Description `json:"page" example:"1"` // @Tags orgtree // @ID createOrgtree // @Accept json @@ -97,6 +129,22 @@ func CreateOrgtree(c *gin.Context) { // 修改机构 godoc // @Summary 修改机构 // @Description 修改机构 +// @Description `json:"id" xorm:"not null pk comment('ID【根节点默认为-1】') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"org_name" xorm:"not null comment('机构名称') VARCHAR(100)" example:"开平区教育局"` +// @Description `json:"org_type" xorm:"not null comment('机构类型【1:教育局、2:学校、3:教辅单位、4:大学区、5:部门、6、主校,7、学段、8:年级、9:班级】') INT(11)" example:"1"` +// @Description `json:"parent_id" xorm:"default ''NULL'' comment('父节点ID') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"cat_id" xorm:"not null comment('层级ID【4位数字一组、右侧多级累加】') VARCHAR(100)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"province_id" xorm:"default 'NULL' comment('省编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"city_id" xorm:"default 'NULL' comment('地市编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"area_id" xorm:"default 'NULL' comment('县区编码') VARCHAR(6)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"`linksystem_id`" xorm:"default 'NULL' comment('源业务系统编码') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"link_id" xorm:"default 'NULL' comment('业务系统机构原ID') VARCHAR(36)" example:"0383FF67-CCBA-4256-891E-BAFD487547FA"` +// @Description `json:"create_time" xorm:"default 'NULL' created comment('建立时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"change_time" xorm:"default 'NULL' updated comment('最近修改时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"delete_time" xorm:"default 'NULL' deleted comment('删除时间') DATETIME" example:"2020-06-11 09:19:26"` +// @Description `json:"delete_flag" xorm:"not null default -1 comment('删除标志【默认-1,1:删除,-1:正常】') INT(11)" example:"1"` +// @Description `json:"enable_flag" xorm:"not null default 1 comment('启用标志【默认1,1:启用,-1:禁用】') INT(11)" example:"1"` +// @Description `json:"page" example:"1"` // @Tags orgtree // @ID updateOrgtree // @Accept json @@ -142,6 +190,7 @@ func UpdateOrgtree(c *gin.Context) { // 删除机构 godoc // @Summary 删除机构 // @Description 删除机构 +// @Description `*`json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" // @Tags orgtree // @ID deleteOrgtree // @Accept json diff --git a/dsSupport/ReadMe b/dsSupport/ReadMe new file mode 100644 index 00000000..ac811ae8 --- /dev/null +++ b/dsSupport/ReadMe @@ -0,0 +1,4 @@ +es本身默认限制了查找的量为10000条,即 from+size<=10000 +解决方法: +# 修改es中所有的index配置 +curl -H "Content-Type: application/json" -XPUT http://127.0.0.1:9200/_settings -d '{ "index" : { "max_result_window" : 1000000000}}' \ No newline at end of file