diff --git a/api/v1/businesses/biocontrolResource.go b/api/v1/businesses/biocontrolResource.go new file mode 100644 index 0000000..06abdbe --- /dev/null +++ b/api/v1/businesses/biocontrolResource.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: api/v1/businesses/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// BiocontrolResourceSearchReq 分页请求参数 +type BiocontrolResourceSearchReq struct { + g.Meta `path:"/list" tags:"生防资源" method:"get" summary:"生防资源列表"` + commonApi.Author + model.BiocontrolResourceSearchReq +} + +// BiocontrolResourceSearchRes 列表返回结果 +type BiocontrolResourceSearchRes struct { + g.Meta `mime:"application/json"` + *model.BiocontrolResourceSearchRes +} + +// BiocontrolResourceAddReq 添加操作请求参数 +type BiocontrolResourceAddReq struct { + g.Meta `path:"/add" tags:"生防资源" method:"post" summary:"生防资源添加"` + commonApi.Author + *model.BiocontrolResourceAddReq +} + +// BiocontrolResourceAddRes 添加操作返回结果 +type BiocontrolResourceAddRes struct { + commonApi.EmptyRes +} + +// BiocontrolResourceEditReq 修改操作请求参数 +type BiocontrolResourceEditReq struct { + g.Meta `path:"/edit" tags:"生防资源" method:"put" summary:"生防资源修改"` + commonApi.Author + *model.BiocontrolResourceEditReq +} + +// BiocontrolResourceEditRes 修改操作返回结果 +type BiocontrolResourceEditRes struct { + commonApi.EmptyRes +} + +// BiocontrolResourceGetReq 获取一条数据请求 +type BiocontrolResourceGetReq struct { + g.Meta `path:"/get" tags:"生防资源" method:"get" summary:"获取生防资源信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// BiocontrolResourceGetRes 获取一条数据结果 +type BiocontrolResourceGetRes struct { + g.Meta `mime:"application/json"` + *model.BiocontrolResourceInfoRes +} + +// BiocontrolResourceDeleteReq 删除数据请求 +type BiocontrolResourceDeleteReq struct { + g.Meta `path:"/delete" tags:"生防资源" method:"delete" summary:"删除生防资源"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `P:"version"` +} + +// BiocontrolResourceDeleteRes 删除数据返回 +type BiocontrolResourceDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/biologyEcology.go b/api/v1/businesses/biologyEcology.go new file mode 100644 index 0000000..99ec884 --- /dev/null +++ b/api/v1/businesses/biologyEcology.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: api/v1/businesses/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// BiologyEcologySearchReq 分页请求参数 +type BiologyEcologySearchReq struct { + g.Meta `path:"/list" tags:"基本生物学与生态学" method:"get" summary:"基本生物学与生态学列表"` + commonApi.Author + model.BiologyEcologySearchReq +} + +// BiologyEcologySearchRes 列表返回结果 +type BiologyEcologySearchRes struct { + g.Meta `mime:"application/json"` + *model.BiologyEcologySearchRes +} + +// BiologyEcologyAddReq 添加操作请求参数 +type BiologyEcologyAddReq struct { + g.Meta `path:"/add" tags:"基本生物学与生态学" method:"post" summary:"基本生物学与生态学添加"` + commonApi.Author + *model.BiologyEcologyAddReq +} + +// BiologyEcologyAddRes 添加操作返回结果 +type BiologyEcologyAddRes struct { + commonApi.EmptyRes +} + +// BiologyEcologyEditReq 修改操作请求参数 +type BiologyEcologyEditReq struct { + g.Meta `path:"/edit" tags:"基本生物学与生态学" method:"put" summary:"基本生物学与生态学修改"` + commonApi.Author + *model.BiologyEcologyEditReq +} + +// BiologyEcologyEditRes 修改操作返回结果 +type BiologyEcologyEditRes struct { + commonApi.EmptyRes +} + +// BiologyEcologyGetReq 获取一条数据请求 +type BiologyEcologyGetReq struct { + g.Meta `path:"/get" tags:"基本生物学与生态学" method:"get" summary:"获取基本生物学与生态学信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// BiologyEcologyGetRes 获取一条数据结果 +type BiologyEcologyGetRes struct { + g.Meta `mime:"application/json"` + *model.BiologyEcologyInfoRes +} + +// BiologyEcologyDeleteReq 删除数据请求 +type BiologyEcologyDeleteReq struct { + g.Meta `path:"/delete" tags:"基本生物学与生态学" method:"delete" summary:"删除基本生物学与生态学"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// BiologyEcologyDeleteRes 删除数据返回 +type BiologyEcologyDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/definiteness.go b/api/v1/businesses/definiteness.go new file mode 100644 index 0000000..21d0ebb --- /dev/null +++ b/api/v1/businesses/definiteness.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: api/v1/businesses/definiteness.go +// 生成人:gfast +// desc:限定性情况相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// DefinitenessSearchReq 分页请求参数 +type DefinitenessSearchReq struct { + g.Meta `path:"/list" tags:"限定性情况" method:"get" summary:"限定性情况列表"` + commonApi.Author + model.DefinitenessSearchReq +} + +// DefinitenessSearchRes 列表返回结果 +type DefinitenessSearchRes struct { + g.Meta `mime:"application/json"` + *model.DefinitenessSearchRes +} + +// DefinitenessAddReq 添加操作请求参数 +type DefinitenessAddReq struct { + g.Meta `path:"/add" tags:"限定性情况" method:"post" summary:"限定性情况添加"` + commonApi.Author + *model.DefinitenessAddReq +} + +// DefinitenessAddRes 添加操作返回结果 +type DefinitenessAddRes struct { + commonApi.EmptyRes +} + +// DefinitenessEditReq 修改操作请求参数 +type DefinitenessEditReq struct { + g.Meta `path:"/edit" tags:"限定性情况" method:"put" summary:"限定性情况修改"` + commonApi.Author + *model.DefinitenessEditReq +} + +// DefinitenessEditRes 修改操作返回结果 +type DefinitenessEditRes struct { + commonApi.EmptyRes +} + +// DefinitenessGetReq 获取一条数据请求 +type DefinitenessGetReq struct { + g.Meta `path:"/get" tags:"限定性情况" method:"get" summary:"获取限定性情况信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// DefinitenessGetRes 获取一条数据结果 +type DefinitenessGetRes struct { + g.Meta `mime:"application/json"` + *model.DefinitenessInfoRes +} + +// DefinitenessDeleteReq 删除数据请求 +type DefinitenessDeleteReq struct { + g.Meta `path:"/delete" tags:"限定性情况" method:"delete" summary:"删除限定性情况"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// DefinitenessDeleteRes 删除数据返回 +type DefinitenessDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/hostBotany.go b/api/v1/businesses/hostBotany.go new file mode 100644 index 0000000..c482716 --- /dev/null +++ b/api/v1/businesses/hostBotany.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: api/v1/businesses/host_botany.go +// 生成人:gfast +// desc:寄主植物相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// HostBotanySearchReq 分页请求参数 +type HostBotanySearchReq struct { + g.Meta `path:"/list" tags:"寄主植物" method:"get" summary:"寄主植物列表"` + commonApi.Author + model.HostBotanySearchReq +} + +// HostBotanySearchRes 列表返回结果 +type HostBotanySearchRes struct { + g.Meta `mime:"application/json"` + *model.HostBotanySearchRes +} + +// HostBotanyAddReq 添加操作请求参数 +type HostBotanyAddReq struct { + g.Meta `path:"/add" tags:"寄主植物" method:"post" summary:"寄主植物添加"` + commonApi.Author + *model.HostBotanyAddReq +} + +// HostBotanyAddRes 添加操作返回结果 +type HostBotanyAddRes struct { + commonApi.EmptyRes +} + +// HostBotanyEditReq 修改操作请求参数 +type HostBotanyEditReq struct { + g.Meta `path:"/edit" tags:"寄主植物" method:"put" summary:"寄主植物修改"` + commonApi.Author + *model.HostBotanyEditReq +} + +// HostBotanyEditRes 修改操作返回结果 +type HostBotanyEditRes struct { + commonApi.EmptyRes +} + +// HostBotanyGetReq 获取一条数据请求 +type HostBotanyGetReq struct { + g.Meta `path:"/get" tags:"寄主植物" method:"get" summary:"获取寄主植物信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// HostBotanyGetRes 获取一条数据结果 +type HostBotanyGetRes struct { + g.Meta `mime:"application/json"` + *model.HostBotanyInfoRes +} + +// HostBotanyDeleteReq 删除数据请求 +type HostBotanyDeleteReq struct { + g.Meta `path:"/delete" tags:"寄主植物" method:"delete" summary:"删除寄主植物"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// HostBotanyDeleteRes 删除数据返回 +type HostBotanyDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/naturalEnemyInsect.go b/api/v1/businesses/naturalEnemyInsect.go new file mode 100644 index 0000000..fb10aab --- /dev/null +++ b/api/v1/businesses/naturalEnemyInsect.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: api/v1/businesses/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// NaturalEnemyInsectSearchReq 分页请求参数 +type NaturalEnemyInsectSearchReq struct { + g.Meta `path:"/list" tags:"天敌昆虫" method:"get" summary:"天敌昆虫列表"` + commonApi.Author + model.NaturalEnemyInsectSearchReq +} + +// NaturalEnemyInsectSearchRes 列表返回结果 +type NaturalEnemyInsectSearchRes struct { + g.Meta `mime:"application/json"` + *model.NaturalEnemyInsectSearchRes +} + +// NaturalEnemyInsectAddReq 添加操作请求参数 +type NaturalEnemyInsectAddReq struct { + g.Meta `path:"/add" tags:"天敌昆虫" method:"post" summary:"天敌昆虫添加"` + commonApi.Author + *model.NaturalEnemyInsectAddReq +} + +// NaturalEnemyInsectAddRes 添加操作返回结果 +type NaturalEnemyInsectAddRes struct { + commonApi.EmptyRes +} + +// NaturalEnemyInsectEditReq 修改操作请求参数 +type NaturalEnemyInsectEditReq struct { + g.Meta `path:"/edit" tags:"天敌昆虫" method:"put" summary:"天敌昆虫修改"` + commonApi.Author + *model.NaturalEnemyInsectEditReq +} + +// NaturalEnemyInsectEditRes 修改操作返回结果 +type NaturalEnemyInsectEditRes struct { + commonApi.EmptyRes +} + +// NaturalEnemyInsectGetReq 获取一条数据请求 +type NaturalEnemyInsectGetReq struct { + g.Meta `path:"/get" tags:"天敌昆虫" method:"get" summary:"获取天敌昆虫信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// NaturalEnemyInsectGetRes 获取一条数据结果 +type NaturalEnemyInsectGetRes struct { + g.Meta `mime:"application/json"` + *model.NaturalEnemyInsectInfoRes +} + +// NaturalEnemyInsectDeleteReq 删除数据请求 +type NaturalEnemyInsectDeleteReq struct { + g.Meta `path:"/delete" tags:"天敌昆虫" method:"delete" summary:"删除天敌昆虫"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// NaturalEnemyInsectDeleteRes 删除数据返回 +type NaturalEnemyInsectDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/prevention.go b/api/v1/businesses/prevention.go new file mode 100644 index 0000000..4dbc5f2 --- /dev/null +++ b/api/v1/businesses/prevention.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: api/v1/businesses/prevention.go +// 生成人:gfast +// desc:防控措施相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// PreventionSearchReq 分页请求参数 +type PreventionSearchReq struct { + g.Meta `path:"/list" tags:"防控措施" method:"get" summary:"防控措施列表"` + commonApi.Author + model.PreventionSearchReq +} + +// PreventionSearchRes 列表返回结果 +type PreventionSearchRes struct { + g.Meta `mime:"application/json"` + *model.PreventionSearchRes +} + +// PreventionAddReq 添加操作请求参数 +type PreventionAddReq struct { + g.Meta `path:"/add" tags:"防控措施" method:"post" summary:"防控措施添加"` + commonApi.Author + *model.PreventionAddReq +} + +// PreventionAddRes 添加操作返回结果 +type PreventionAddRes struct { + commonApi.EmptyRes +} + +// PreventionEditReq 修改操作请求参数 +type PreventionEditReq struct { + g.Meta `path:"/edit" tags:"防控措施" method:"put" summary:"防控措施修改"` + commonApi.Author + *model.PreventionEditReq +} + +// PreventionEditRes 修改操作返回结果 +type PreventionEditRes struct { + commonApi.EmptyRes +} + +// PreventionGetReq 获取一条数据请求 +type PreventionGetReq struct { + g.Meta `path:"/get" tags:"防控措施" method:"get" summary:"获取防控措施信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// PreventionGetRes 获取一条数据结果 +type PreventionGetRes struct { + g.Meta `mime:"application/json"` + *model.PreventionInfoRes +} + +// PreventionDeleteReq 删除数据请求 +type PreventionDeleteReq struct { + g.Meta `path:"/delete" tags:"防控措施" method:"delete" summary:"删除防控措施"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// PreventionDeleteRes 删除数据返回 +type PreventionDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/speciesImgs.go b/api/v1/businesses/speciesImgs.go new file mode 100644 index 0000000..60d33d6 --- /dev/null +++ b/api/v1/businesses/speciesImgs.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: api/v1/businesses/species_imgs.go +// 生成人:gfast +// desc:相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// SpeciesImgsSearchReq 分页请求参数 +type SpeciesImgsSearchReq struct { + g.Meta `path:"/list" tags:"" method:"get" summary:"列表"` + commonApi.Author + model.SpeciesImgsSearchReq +} + +// SpeciesImgsSearchRes 列表返回结果 +type SpeciesImgsSearchRes struct { + g.Meta `mime:"application/json"` + *model.SpeciesImgsSearchRes +} + +// SpeciesImgsAddReq 添加操作请求参数 +type SpeciesImgsAddReq struct { + g.Meta `path:"/add" tags:"" method:"post" summary:"添加"` + commonApi.Author + *model.SpeciesImgsAddReq +} + +// SpeciesImgsAddRes 添加操作返回结果 +type SpeciesImgsAddRes struct { + commonApi.EmptyRes +} + +// SpeciesImgsEditReq 修改操作请求参数 +type SpeciesImgsEditReq struct { + g.Meta `path:"/edit" tags:"" method:"put" summary:"修改"` + commonApi.Author + *model.SpeciesImgsEditReq +} + +// SpeciesImgsEditRes 修改操作返回结果 +type SpeciesImgsEditRes struct { + commonApi.EmptyRes +} + +// SpeciesImgsGetReq 获取一条数据请求 +type SpeciesImgsGetReq struct { + g.Meta `path:"/get" tags:"" method:"get" summary:"获取信息"` + commonApi.Author + Int int `p:"int" v:"required#主键必须"` //通过主键获取 +} + +// SpeciesImgsGetRes 获取一条数据结果 +type SpeciesImgsGetRes struct { + g.Meta `mime:"application/json"` + *model.SpeciesImgsInfoRes +} + +// SpeciesImgsDeleteReq 删除数据请求 +type SpeciesImgsDeleteReq struct { + g.Meta `path:"/delete" tags:"" method:"delete" summary:"删除"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// SpeciesImgsDeleteRes 删除数据返回 +type SpeciesImgsDeleteRes struct { + commonApi.EmptyRes +} diff --git a/api/v1/businesses/speciesSurvey.go b/api/v1/businesses/speciesSurvey.go new file mode 100644 index 0000000..3480d01 --- /dev/null +++ b/api/v1/businesses/speciesSurvey.go @@ -0,0 +1,79 @@ +// ========================================================================== +// GFast自动生成api操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: api/v1/businesses/species_survey.go +// 生成人:gfast +// desc:物种调查相关参数 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package businesses + +import ( + "github.com/gogf/gf/v2/frame/g" + commonApi "github.com/tiger1103/gfast/v3/api/v1/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +// SpeciesSurveySearchReq 分页请求参数 +type SpeciesSurveySearchReq struct { + g.Meta `path:"/list" tags:"物种调查" method:"get" summary:"物种调查列表"` + commonApi.Author + model.SpeciesSurveySearchReq +} + +// SpeciesSurveySearchRes 列表返回结果 +type SpeciesSurveySearchRes struct { + g.Meta `mime:"application/json"` + *model.SpeciesSurveySearchRes +} + +// SpeciesSurveyAddReq 添加操作请求参数 +type SpeciesSurveyAddReq struct { + g.Meta `path:"/add" tags:"物种调查" method:"post" summary:"物种调查添加"` + commonApi.Author + *model.SpeciesSurveyAddReq +} + +// SpeciesSurveyAddRes 添加操作返回结果 +type SpeciesSurveyAddRes struct { + commonApi.EmptyRes +} + +// SpeciesSurveyEditReq 修改操作请求参数 +type SpeciesSurveyEditReq struct { + g.Meta `path:"/edit" tags:"物种调查" method:"put" summary:"物种调查修改"` + commonApi.Author + *model.SpeciesSurveyEditReq +} + +// SpeciesSurveyEditRes 修改操作返回结果 +type SpeciesSurveyEditRes struct { + commonApi.EmptyRes +} + +// SpeciesSurveyGetReq 获取一条数据请求 +type SpeciesSurveyGetReq struct { + g.Meta `path:"/get" tags:"物种调查" method:"get" summary:"获取物种调查信息"` + commonApi.Author + Id int `p:"id" v:"required#主键必须"` //通过主键获取 +} + +// SpeciesSurveyGetRes 获取一条数据结果 +type SpeciesSurveyGetRes struct { + g.Meta `mime:"application/json"` + *model.SpeciesSurveyInfoRes +} + +// SpeciesSurveyDeleteReq 删除数据请求 +type SpeciesSurveyDeleteReq struct { + g.Meta `path:"/delete" tags:"物种调查" method:"delete" summary:"删除物种调查"` + commonApi.Author + Ids []int `p:"ids" v:"required#主键必须"` //通过主键删除 + Version []int `p:"version"` +} + +// SpeciesSurveyDeleteRes 删除数据返回 +type SpeciesSurveyDeleteRes struct { + commonApi.EmptyRes +} diff --git a/internal/app/businesses/controller/biocontrolResource.go b/internal/app/businesses/controller/biocontrolResource.go new file mode 100644 index 0000000..f4994ca --- /dev/null +++ b/internal/app/businesses/controller/biocontrolResource.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/controller/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type biocontrolResourceController struct { + systemController.BaseController +} + +var BiocontrolResource = new(biocontrolResourceController) + +// List 列表 +func (c *biocontrolResourceController) List(ctx context.Context, req *businesses.BiocontrolResourceSearchReq) (res *businesses.BiocontrolResourceSearchRes, err error) { + res = new(businesses.BiocontrolResourceSearchRes) + res.BiocontrolResourceSearchRes, err = service.BiocontrolResource().List(ctx, &req.BiocontrolResourceSearchReq) + return +} + +// Get 获取生防资源 +func (c *biocontrolResourceController) Get(ctx context.Context, req *businesses.BiocontrolResourceGetReq) (res *businesses.BiocontrolResourceGetRes, err error) { + res = new(businesses.BiocontrolResourceGetRes) + res.BiocontrolResourceInfoRes, err = service.BiocontrolResource().GetById(ctx, req.Id) + return +} + +// Add 添加生防资源 +func (c *biocontrolResourceController) Add(ctx context.Context, req *businesses.BiocontrolResourceAddReq) (res *businesses.BiocontrolResourceAddRes, err error) { + err = service.BiocontrolResource().Add(ctx, req.BiocontrolResourceAddReq) + return +} + +// Edit 修改生防资源 +func (c *biocontrolResourceController) Edit(ctx context.Context, req *businesses.BiocontrolResourceEditReq) (res *businesses.BiocontrolResourceEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.BiocontrolResource.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.BiocontrolResource().Edit(ctx, req.BiocontrolResourceEditReq) + return +} + +// Delete 删除生防资源 +func (c *biocontrolResourceController) Delete(ctx context.Context, req *businesses.BiocontrolResourceDeleteReq) (res *businesses.BiocontrolResourceDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.BiocontrolResource.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.BiocontrolResource().Delete(ctx, req.Ids) + return +} + +func (c *biocontrolResourceController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.BiocontrolResource.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.BiocontrolResource.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/biologyEcology.go b/internal/app/businesses/controller/biologyEcology.go new file mode 100644 index 0000000..8e39600 --- /dev/null +++ b/internal/app/businesses/controller/biologyEcology.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/controller/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type biologyEcologyController struct { + systemController.BaseController +} + +var BiologyEcology = new(biologyEcologyController) + +// List 列表 +func (c *biologyEcologyController) List(ctx context.Context, req *businesses.BiologyEcologySearchReq) (res *businesses.BiologyEcologySearchRes, err error) { + res = new(businesses.BiologyEcologySearchRes) + res.BiologyEcologySearchRes, err = service.BiologyEcology().List(ctx, &req.BiologyEcologySearchReq) + return +} + +// Get 获取基本生物学与生态学 +func (c *biologyEcologyController) Get(ctx context.Context, req *businesses.BiologyEcologyGetReq) (res *businesses.BiologyEcologyGetRes, err error) { + res = new(businesses.BiologyEcologyGetRes) + res.BiologyEcologyInfoRes, err = service.BiologyEcology().GetById(ctx, req.Id) + return +} + +// Add 添加基本生物学与生态学 +func (c *biologyEcologyController) Add(ctx context.Context, req *businesses.BiologyEcologyAddReq) (res *businesses.BiologyEcologyAddRes, err error) { + err = service.BiologyEcology().Add(ctx, req.BiologyEcologyAddReq) + return +} + +// Edit 修改基本生物学与生态学 +func (c *biologyEcologyController) Edit(ctx context.Context, req *businesses.BiologyEcologyEditReq) (res *businesses.BiologyEcologyEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.BiologyEcology.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.BiologyEcology().Edit(ctx, req.BiologyEcologyEditReq) + return +} + +// Delete 删除基本生物学与生态学 +func (c *biologyEcologyController) Delete(ctx context.Context, req *businesses.BiologyEcologyDeleteReq) (res *businesses.BiologyEcologyDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.BiologyEcology.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.BiologyEcology().Delete(ctx, req.Ids) + return +} + +func (c *biologyEcologyController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.BiologyEcology.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.BiologyEcology.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/definiteness.go b/internal/app/businesses/controller/definiteness.go new file mode 100644 index 0000000..28b4981 --- /dev/null +++ b/internal/app/businesses/controller/definiteness.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/controller/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type definitenessController struct { + systemController.BaseController +} + +var Definiteness = new(definitenessController) + +// List 列表 +func (c *definitenessController) List(ctx context.Context, req *businesses.DefinitenessSearchReq) (res *businesses.DefinitenessSearchRes, err error) { + res = new(businesses.DefinitenessSearchRes) + res.DefinitenessSearchRes, err = service.Definiteness().List(ctx, &req.DefinitenessSearchReq) + return +} + +// Get 获取限定性情况 +func (c *definitenessController) Get(ctx context.Context, req *businesses.DefinitenessGetReq) (res *businesses.DefinitenessGetRes, err error) { + res = new(businesses.DefinitenessGetRes) + res.DefinitenessInfoRes, err = service.Definiteness().GetById(ctx, req.Id) + return +} + +// Add 添加限定性情况 +func (c *definitenessController) Add(ctx context.Context, req *businesses.DefinitenessAddReq) (res *businesses.DefinitenessAddRes, err error) { + err = service.Definiteness().Add(ctx, req.DefinitenessAddReq) + return +} + +// Edit 修改限定性情况 +func (c *definitenessController) Edit(ctx context.Context, req *businesses.DefinitenessEditReq) (res *businesses.DefinitenessEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.Definiteness.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.Definiteness().Edit(ctx, req.DefinitenessEditReq) + return +} + +// Delete 删除限定性情况 +func (c *definitenessController) Delete(ctx context.Context, req *businesses.DefinitenessDeleteReq) (res *businesses.DefinitenessDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.Definiteness.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.Definiteness().Delete(ctx, req.Ids) + return +} + +func (c *definitenessController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.Definiteness.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.Definiteness.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/hostBotany.go b/internal/app/businesses/controller/hostBotany.go new file mode 100644 index 0000000..5e92f03 --- /dev/null +++ b/internal/app/businesses/controller/hostBotany.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/controller/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type hostBotanyController struct { + systemController.BaseController +} + +var HostBotany = new(hostBotanyController) + +// List 列表 +func (c *hostBotanyController) List(ctx context.Context, req *businesses.HostBotanySearchReq) (res *businesses.HostBotanySearchRes, err error) { + res = new(businesses.HostBotanySearchRes) + res.HostBotanySearchRes, err = service.HostBotany().List(ctx, &req.HostBotanySearchReq) + return +} + +// Get 获取寄主生物 +func (c *hostBotanyController) Get(ctx context.Context, req *businesses.HostBotanyGetReq) (res *businesses.HostBotanyGetRes, err error) { + res = new(businesses.HostBotanyGetRes) + res.HostBotanyInfoRes, err = service.HostBotany().GetById(ctx, req.Id) + return +} + +// Add 添加寄主生物 +func (c *hostBotanyController) Add(ctx context.Context, req *businesses.HostBotanyAddReq) (res *businesses.HostBotanyAddRes, err error) { + err = service.HostBotany().Add(ctx, req.HostBotanyAddReq) + return +} + +// Edit 修改寄主生物 +func (c *hostBotanyController) Edit(ctx context.Context, req *businesses.HostBotanyEditReq) (res *businesses.HostBotanyEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.HostBotany.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.HostBotany().Edit(ctx, req.HostBotanyEditReq) + return +} + +// Delete 删除寄主生物 +func (c *hostBotanyController) Delete(ctx context.Context, req *businesses.HostBotanyDeleteReq) (res *businesses.HostBotanyDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.HostBotany.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.HostBotany().Delete(ctx, req.Ids) + return +} + +func (c *hostBotanyController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.HostBotany.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.HostBotany.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/naturalEnemyInsect.go b/internal/app/businesses/controller/naturalEnemyInsect.go new file mode 100644 index 0000000..3cf66d0 --- /dev/null +++ b/internal/app/businesses/controller/naturalEnemyInsect.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/controller/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type naturalEnemyInsectController struct { + systemController.BaseController +} + +var NaturalEnemyInsect = new(naturalEnemyInsectController) + +// List 列表 +func (c *naturalEnemyInsectController) List(ctx context.Context, req *businesses.NaturalEnemyInsectSearchReq) (res *businesses.NaturalEnemyInsectSearchRes, err error) { + res = new(businesses.NaturalEnemyInsectSearchRes) + res.NaturalEnemyInsectSearchRes, err = service.NaturalEnemyInsect().List(ctx, &req.NaturalEnemyInsectSearchReq) + return +} + +// Get 获取天敌昆虫 +func (c *naturalEnemyInsectController) Get(ctx context.Context, req *businesses.NaturalEnemyInsectGetReq) (res *businesses.NaturalEnemyInsectGetRes, err error) { + res = new(businesses.NaturalEnemyInsectGetRes) + res.NaturalEnemyInsectInfoRes, err = service.NaturalEnemyInsect().GetById(ctx, req.Id) + return +} + +// Add 添加天敌昆虫 +func (c *naturalEnemyInsectController) Add(ctx context.Context, req *businesses.NaturalEnemyInsectAddReq) (res *businesses.NaturalEnemyInsectAddRes, err error) { + err = service.NaturalEnemyInsect().Add(ctx, req.NaturalEnemyInsectAddReq) + return +} + +// Edit 修改天敌昆虫 +func (c *naturalEnemyInsectController) Edit(ctx context.Context, req *businesses.NaturalEnemyInsectEditReq) (res *businesses.NaturalEnemyInsectEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.NaturalEnemyInsect.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.NaturalEnemyInsect().Edit(ctx, req.NaturalEnemyInsectEditReq) + return +} + +// Delete 删除天敌昆虫 +func (c *naturalEnemyInsectController) Delete(ctx context.Context, req *businesses.NaturalEnemyInsectDeleteReq) (res *businesses.NaturalEnemyInsectDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.NaturalEnemyInsect.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.NaturalEnemyInsect().Delete(ctx, req.Ids) + return +} + +func (c *naturalEnemyInsectController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.NaturalEnemyInsect.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.NaturalEnemyInsect.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/prevention.go b/internal/app/businesses/controller/prevention.go new file mode 100644 index 0000000..1d45cd9 --- /dev/null +++ b/internal/app/businesses/controller/prevention.go @@ -0,0 +1,83 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/controller/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type preventionController struct { + systemController.BaseController +} + +var Prevention = new(preventionController) + +// List 列表 +func (c *preventionController) List(ctx context.Context, req *businesses.PreventionSearchReq) (res *businesses.PreventionSearchRes, err error) { + res = new(businesses.PreventionSearchRes) + res.PreventionSearchRes, err = service.Prevention().List(ctx, &req.PreventionSearchReq) + return +} + +// Get 获取防控措施 +func (c *preventionController) Get(ctx context.Context, req *businesses.PreventionGetReq) (res *businesses.PreventionGetRes, err error) { + res = new(businesses.PreventionGetRes) + res.PreventionInfoRes, err = service.Prevention().GetById(ctx, req.Id) + return +} + +// Add 添加防控措施 +func (c *preventionController) Add(ctx context.Context, req *businesses.PreventionAddReq) (res *businesses.PreventionAddRes, err error) { + err = service.Prevention().Add(ctx, req.PreventionAddReq) + return +} + +// Edit 修改防控措施 +func (c *preventionController) Edit(ctx context.Context, req *businesses.PreventionEditReq) (res *businesses.PreventionEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.Prevention.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.Prevention().Edit(ctx, req.PreventionEditReq) + return +} + +// Delete 删除防控措施 +func (c *preventionController) Delete(ctx context.Context, req *businesses.PreventionDeleteReq) (res *businesses.PreventionDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.Prevention.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.Prevention().Delete(ctx, req.Ids) + return +} +func (c *preventionController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.Prevention.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.Prevention.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/speciesImgs.go b/internal/app/businesses/controller/speciesImgs.go new file mode 100644 index 0000000..7714b53 --- /dev/null +++ b/internal/app/businesses/controller/speciesImgs.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/controller/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type speciesImgsController struct { + systemController.BaseController +} + +var SpeciesImgs = new(speciesImgsController) + +// List 列表 +func (c *speciesImgsController) List(ctx context.Context, req *businesses.SpeciesImgsSearchReq) (res *businesses.SpeciesImgsSearchRes, err error) { + res = new(businesses.SpeciesImgsSearchRes) + res.SpeciesImgsSearchRes, err = service.SpeciesImgs().List(ctx, &req.SpeciesImgsSearchReq) + return +} + +// Get 获取 +func (c *speciesImgsController) Get(ctx context.Context, req *businesses.SpeciesImgsGetReq) (res *businesses.SpeciesImgsGetRes, err error) { + res = new(businesses.SpeciesImgsGetRes) + res.SpeciesImgsInfoRes, err = service.SpeciesImgs().GetByInt(ctx, req.Int) + return +} + +// Add 添加 +func (c *speciesImgsController) Add(ctx context.Context, req *businesses.SpeciesImgsAddReq) (res *businesses.SpeciesImgsAddRes, err error) { + err = service.SpeciesImgs().Add(ctx, req.SpeciesImgsAddReq) + return +} + +// Edit 修改 +func (c *speciesImgsController) Edit(ctx context.Context, req *businesses.SpeciesImgsEditReq) (res *businesses.SpeciesImgsEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.SpeciesImgs.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.SpeciesImgs().Edit(ctx, req.SpeciesImgsEditReq) + return +} + +// Delete 删除 +func (c *speciesImgsController) Delete(ctx context.Context, req *businesses.SpeciesImgsDeleteReq) (res *businesses.SpeciesImgsDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.SpeciesImgs.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.SpeciesImgs().Delete(ctx, req.Ids) + return +} + +func (c *speciesImgsController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.SpeciesImgs.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.SpeciesImgs.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/controller/speciesSurvey.go b/internal/app/businesses/controller/speciesSurvey.go new file mode 100644 index 0000000..26b9d8a --- /dev/null +++ b/internal/app/businesses/controller/speciesSurvey.go @@ -0,0 +1,84 @@ +// ========================================================================== +// GFast自动生成controller操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/controller/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package controller + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/tiger1103/gfast/v3/api/v1/businesses" + "github.com/tiger1103/gfast/v3/internal/app/businesses/common" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/lock" + systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller" +) + +type speciesSurveyController struct { + systemController.BaseController +} + +var SpeciesSurvey = new(speciesSurveyController) + +// List 列表 +func (c *speciesSurveyController) List(ctx context.Context, req *businesses.SpeciesSurveySearchReq) (res *businesses.SpeciesSurveySearchRes, err error) { + res = new(businesses.SpeciesSurveySearchRes) + res.SpeciesSurveySearchRes, err = service.SpeciesSurvey().List(ctx, &req.SpeciesSurveySearchReq) + return +} + +// Get 获取物种调查 +func (c *speciesSurveyController) Get(ctx context.Context, req *businesses.SpeciesSurveyGetReq) (res *businesses.SpeciesSurveyGetRes, err error) { + res = new(businesses.SpeciesSurveyGetRes) + res.SpeciesSurveyInfoRes, err = service.SpeciesSurvey().GetById(ctx, req.Id) + return +} + +// Add 添加物种调查 +func (c *speciesSurveyController) Add(ctx context.Context, req *businesses.SpeciesSurveyAddReq) (res *businesses.SpeciesSurveyAddRes, err error) { + err = service.SpeciesSurvey().Add(ctx, req.SpeciesSurveyAddReq) + return +} + +// Edit 修改物种调查 +func (c *speciesSurveyController) Edit(ctx context.Context, req *businesses.SpeciesSurveyEditReq) (res *businesses.SpeciesSurveyEditRes, err error) { + newVersion, err := lock.TryOptimisticLock(ctx, dao.SpeciesSurvey.Ctx(ctx), "id", req.Id, req.Version) + if err != nil { + return nil, err + } + req.Version = newVersion + err = service.SpeciesSurvey().Edit(ctx, req.SpeciesSurveyEditReq) + return +} + +// Delete 删除物种调查 +func (c *speciesSurveyController) Delete(ctx context.Context, req *businesses.SpeciesSurveyDeleteReq) (res *businesses.SpeciesSurveyDeleteRes, err error) { + for i, id := range req.Ids { + _, err = lock.TryOptimisticLock(ctx, dao.SpeciesSurvey.Ctx(ctx), "id", id, req.Version[i]) + if err != nil { + return nil, err + } + } + err = service.SpeciesSurvey().Delete(ctx, req.Ids) + return +} + +func (c *speciesSurveyController) Audit(ctx context.Context, req *common.AuditReq) (res *g.Map, err error) { + err = common.Audit.Audit(ctx, dao.SpeciesSurvey.Ctx(ctx), req, func(ctx context.Context, req *common.AuditReq) error { + return common.Audit.SaveAudit(dao.SpeciesSurvey.Ctx(ctx), req) + }) + if err != nil { + return nil, err + } + return &g.Map{ + "msg": "审核成功", + "newVersion": req.Version, + }, nil +} diff --git a/internal/app/businesses/dao/biocontrolResource.go b/internal/app/businesses/dao/biocontrolResource.go new file mode 100644 index 0000000..c6ca2ff --- /dev/null +++ b/internal/app/businesses/dao/biocontrolResource.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/dao/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// biocontrolResourceDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type biocontrolResourceDao struct { + *internal.BiocontrolResourceDao +} + +var ( + // BiocontrolResource is globally public accessible object for table tools_gen_table operations. + BiocontrolResource = biocontrolResourceDao{ + internal.NewBiocontrolResourceDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/biologyEcology.go b/internal/app/businesses/dao/biologyEcology.go new file mode 100644 index 0000000..6f93d1e --- /dev/null +++ b/internal/app/businesses/dao/biologyEcology.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/dao/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// biologyEcologyDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type biologyEcologyDao struct { + *internal.BiologyEcologyDao +} + +var ( + // BiologyEcology is globally public accessible object for table tools_gen_table operations. + BiologyEcology = biologyEcologyDao{ + internal.NewBiologyEcologyDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/definiteness.go b/internal/app/businesses/dao/definiteness.go new file mode 100644 index 0000000..04e93aa --- /dev/null +++ b/internal/app/businesses/dao/definiteness.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/dao/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// definitenessDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type definitenessDao struct { + *internal.DefinitenessDao +} + +var ( + // Definiteness is globally public accessible object for table tools_gen_table operations. + Definiteness = definitenessDao{ + internal.NewDefinitenessDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/hostBotany.go b/internal/app/businesses/dao/hostBotany.go new file mode 100644 index 0000000..ffe8411 --- /dev/null +++ b/internal/app/businesses/dao/hostBotany.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/dao/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// hostBotanyDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type hostBotanyDao struct { + *internal.HostBotanyDao +} + +var ( + // HostBotany is globally public accessible object for table tools_gen_table operations. + HostBotany = hostBotanyDao{ + internal.NewHostBotanyDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/internal/biocontrolResource.go b/internal/app/businesses/dao/internal/biocontrolResource.go new file mode 100644 index 0000000..b7852c1 --- /dev/null +++ b/internal/app/businesses/dao/internal/biocontrolResource.go @@ -0,0 +1,115 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/dao/internal/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// BiocontrolResourceDao is the manager for logic model data accessing and custom defined data operations functions management. +type BiocontrolResourceDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns BiocontrolResourceColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// BiocontrolResourceColumns defines and stores column names for table biocontrol_resource. +type BiocontrolResourceColumns struct { + Id string // + SpeciesCode string // 物种编码 + ZhName string // 中文学名 + ZhSynonym string // 中文异名 + EnName string // 英文学名 + LatinName string // 拉丁学名 + LatinSynonym string // 拉丁异名 + BiocontrolType string // 生防物类型 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var biocontrolResourceColumns = BiocontrolResourceColumns{ + Id: "id", + SpeciesCode: "species_code", + ZhName: "zh_name", + ZhSynonym: "zh_synonym", + EnName: "en_name", + LatinName: "latin_name", + LatinSynonym: "latin_synonym", + BiocontrolType: "biocontrol_type", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewBiocontrolResourceDao creates and returns a new DAO object for table data access. +func NewBiocontrolResourceDao() *BiocontrolResourceDao { + return &BiocontrolResourceDao{ + group: "default", + table: "biocontrol_resource", + columns: biocontrolResourceColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *BiocontrolResourceDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *BiocontrolResourceDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *BiocontrolResourceDao) Columns() BiocontrolResourceColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *BiocontrolResourceDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *BiocontrolResourceDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *BiocontrolResourceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/biologyEcology.go b/internal/app/businesses/dao/internal/biologyEcology.go new file mode 100644 index 0000000..42210cd --- /dev/null +++ b/internal/app/businesses/dao/internal/biologyEcology.go @@ -0,0 +1,121 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/dao/internal/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// BiologyEcologyDao is the manager for logic model data accessing and custom defined data operations functions management. +type BiologyEcologyDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns BiologyEcologyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// BiologyEcologyColumns defines and stores column names for table biology_ecology. +type BiologyEcologyColumns struct { + Id string // + SpeciesCode string // 编码 + LifeHistory string // 生活史/侵染循环 + Character string // 发生与危害特性 + HabitatType string // 生境类型 + ZoologyDescribe string // 生态、经济和社会影响描述 + SpecimenGather string // 模式标本采集地 + SpecimenSave string // 模式标本保存地 + IntroduceDesc string // 首次发现或引入的地点及时间 + Diffuse string // 传播与扩散途径 + RiskAssessment string // 风险评估结果 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var biologyEcologyColumns = BiologyEcologyColumns{ + Id: "id", + SpeciesCode: "species_code", + LifeHistory: "life_history", + Character: "character", + HabitatType: "habitat_type", + ZoologyDescribe: "zoology_describe", + SpecimenGather: "specimen_gather", + SpecimenSave: "specimen_save", + IntroduceDesc: "introduce_desc", + Diffuse: "diffuse", + RiskAssessment: "risk_assessment", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewBiologyEcologyDao creates and returns a new DAO object for table data access. +func NewBiologyEcologyDao() *BiologyEcologyDao { + return &BiologyEcologyDao{ + group: "default", + table: "biology_ecology", + columns: biologyEcologyColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *BiologyEcologyDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *BiologyEcologyDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *BiologyEcologyDao) Columns() BiologyEcologyColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *BiologyEcologyDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *BiologyEcologyDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *BiologyEcologyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/definiteness.go b/internal/app/businesses/dao/internal/definiteness.go new file mode 100644 index 0000000..7004328 --- /dev/null +++ b/internal/app/businesses/dao/internal/definiteness.go @@ -0,0 +1,109 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/dao/internal/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// DefinitenessDao is the manager for logic model data accessing and custom defined data operations functions management. +type DefinitenessDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns DefinitenessColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// DefinitenessColumns defines and stores column names for table definiteness. +type DefinitenessColumns struct { + Id string // + SpeciesCode string // 物种编码 + CountryName string // 国家名称 + Definiteness string // 限定性情况 + Year string // 制定年份 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var definitenessColumns = DefinitenessColumns{ + Id: "id", + SpeciesCode: "species_code", + CountryName: "country_name", + Definiteness: "definiteness", + Year: "year", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewDefinitenessDao creates and returns a new DAO object for table data access. +func NewDefinitenessDao() *DefinitenessDao { + return &DefinitenessDao{ + group: "default", + table: "definiteness", + columns: definitenessColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *DefinitenessDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *DefinitenessDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *DefinitenessDao) Columns() DefinitenessColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *DefinitenessDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *DefinitenessDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *DefinitenessDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/hostBotany.go b/internal/app/businesses/dao/internal/hostBotany.go new file mode 100644 index 0000000..656c462 --- /dev/null +++ b/internal/app/businesses/dao/internal/hostBotany.go @@ -0,0 +1,131 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/dao/internal/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// HostBotanyDao is the manager for logic model data accessing and custom defined data operations functions management. +type HostBotanyDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns HostBotanyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// HostBotanyColumns defines and stores column names for table host_botany. +type HostBotanyColumns struct { + Id string // + SpeciesCode string // 物种编码 + ZhName string // 中文学名 + ZhSynonym string // 中文异名 + EnName string // 英文学名 + LatinName string // 拉丁学名 + LatinSynonym string // 拉丁异名 + Mu string // 目 + OrderTitle string // Order + Ke string // 科 + Family string // Family + Shu string // 属 + Genus string // Genus + Zhong string // 种 + Species string // Species + HostType string // 寄主类型 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var hostBotanyColumns = HostBotanyColumns{ + Id: "id", + SpeciesCode: "species_code", + ZhName: "zh_name", + ZhSynonym: "zh_synonym", + EnName: "en_name", + LatinName: "latin_name", + LatinSynonym: "latin_synonym", + Mu: "mu", + OrderTitle: "order_title", + Ke: "ke", + Family: "family", + Shu: "shu", + Genus: "genus", + Zhong: "zhong", + Species: "species", + HostType: "host_type", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewHostBotanyDao creates and returns a new DAO object for table data access. +func NewHostBotanyDao() *HostBotanyDao { + return &HostBotanyDao{ + group: "default", + table: "host_botany", + columns: hostBotanyColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *HostBotanyDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *HostBotanyDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *HostBotanyDao) Columns() HostBotanyColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *HostBotanyDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *HostBotanyDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *HostBotanyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/naturalEnemyInsect.go b/internal/app/businesses/dao/internal/naturalEnemyInsect.go new file mode 100644 index 0000000..8fc1f27 --- /dev/null +++ b/internal/app/businesses/dao/internal/naturalEnemyInsect.go @@ -0,0 +1,145 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/dao/internal/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// NaturalEnemyInsectDao is the manager for logic model data accessing and custom defined data operations functions management. +type NaturalEnemyInsectDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns NaturalEnemyInsectColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// NaturalEnemyInsectColumns defines and stores column names for table natural_enemy_insect. +type NaturalEnemyInsectColumns struct { + Id string // + SpeciesCode string // 物种编码(入侵种) + ZhName string // 中文名称(天敌) + LatinName string // 拉丁学名(天敌) + Mu string // 目 + OrderTitle string // Order + Ke string // 科 + Family string // Family + Shu string // 属 + Genus string // Genus + SourceArea string // 原产地 + Source string // 来源地 + StudyPlot string // 释放地/实验地 + ExperimentDate string // 引进时间/实验时间 + Selectivity string // 专一性 + FeedingHarm string // 取食/危害阶段 + FeedingPart string // 取食/危害部位 + AnswerIndicator string // 响应指标 + ReleaseRecord string // 释放记录 + IsCreateGroup string // 是否建群 + FeedingStage string // 取食阶段 + IsTarget string // 有无非目标影响 + FeedingDate string // 取食时间/活跃时间 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var naturalEnemyInsectColumns = NaturalEnemyInsectColumns{ + Id: "id", + SpeciesCode: "species_code", + ZhName: "zh_name", + LatinName: "latin_name", + Mu: "mu", + OrderTitle: "order_title", + Ke: "ke", + Family: "family", + Shu: "shu", + Genus: "genus", + SourceArea: "source_area", + Source: "source", + StudyPlot: "study_plot", + ExperimentDate: "experiment_date", + Selectivity: "selectivity", + FeedingHarm: "feeding_harm", + FeedingPart: "feeding_part", + AnswerIndicator: "answer_indicator", + ReleaseRecord: "release_record", + IsCreateGroup: "is_create_group", + FeedingStage: "feeding_stage", + IsTarget: "is_target", + FeedingDate: "feeding_date", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewNaturalEnemyInsectDao creates and returns a new DAO object for table data access. +func NewNaturalEnemyInsectDao() *NaturalEnemyInsectDao { + return &NaturalEnemyInsectDao{ + group: "default", + table: "natural_enemy_insect", + columns: naturalEnemyInsectColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *NaturalEnemyInsectDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *NaturalEnemyInsectDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *NaturalEnemyInsectDao) Columns() NaturalEnemyInsectColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *NaturalEnemyInsectDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *NaturalEnemyInsectDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *NaturalEnemyInsectDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/prevention.go b/internal/app/businesses/dao/internal/prevention.go new file mode 100644 index 0000000..8111b50 --- /dev/null +++ b/internal/app/businesses/dao/internal/prevention.go @@ -0,0 +1,113 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/dao/internal/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// PreventionDao is the manager for logic model data accessing and custom defined data operations functions management. +type PreventionDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns PreventionColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// PreventionColumns defines and stores column names for table prevention. +type PreventionColumns struct { + Id string // + SpeciesCode string // 物种编码 + BotanyQuarantine string // 植物检疫 + Physics string // 物理防治 + Chemistry string // 化学防治 + Biology string // 生物防治 + Other string // 其他防控措施 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var preventionColumns = PreventionColumns{ + Id: "id", + SpeciesCode: "species_code", + BotanyQuarantine: "botany_quarantine", + Physics: "physics", + Chemistry: "chemistry", + Biology: "biology", + Other: "other", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewPreventionDao creates and returns a new DAO object for table data access. +func NewPreventionDao() *PreventionDao { + return &PreventionDao{ + group: "default", + table: "prevention", + columns: preventionColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *PreventionDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *PreventionDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *PreventionDao) Columns() PreventionColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *PreventionDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *PreventionDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *PreventionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/speciesImgs.go b/internal/app/businesses/dao/internal/speciesImgs.go new file mode 100644 index 0000000..4403657 --- /dev/null +++ b/internal/app/businesses/dao/internal/speciesImgs.go @@ -0,0 +1,107 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/dao/internal/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SpeciesImgsDao is the manager for logic model data accessing and custom defined data operations functions management. +type SpeciesImgsDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns SpeciesImgsColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// SpeciesImgsColumns defines and stores column names for table species_imgs. +type SpeciesImgsColumns struct { + Id string // + SpeciesCode string // 物种编码 + Imgs string // 图片 + ImgType string // 图片类型 + ImgSource string // 图片来源 + CreateUser string // 图片拍摄/提供人 + CreateDate string // 图片拍摄/提供日期 + AuditUser string // 图片核查人 + AuditDate string // 图片核查日期 + AuditStatus string // 核查 + AuditView string // 核查意见 + Remark string // 备注 + Version string // 版本 + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var speciesImgsColumns = SpeciesImgsColumns{ + Id: "id", + SpeciesCode: "species_code", + Imgs: "imgs", + ImgType: "img_type", + ImgSource: "img_source", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewSpeciesImgsDao creates and returns a new DAO object for table data access. +func NewSpeciesImgsDao() *SpeciesImgsDao { + return &SpeciesImgsDao{ + group: "default", + table: "species_imgs", + columns: speciesImgsColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *SpeciesImgsDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *SpeciesImgsDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *SpeciesImgsDao) Columns() SpeciesImgsColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *SpeciesImgsDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *SpeciesImgsDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *SpeciesImgsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/internal/speciesSurvey.go b/internal/app/businesses/dao/internal/speciesSurvey.go new file mode 100644 index 0000000..4d444dd --- /dev/null +++ b/internal/app/businesses/dao/internal/speciesSurvey.go @@ -0,0 +1,151 @@ +// ========================================================================== +// GFast自动生成dao internal操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/dao/internal/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SpeciesSurveyDao is the manager for logic model data accessing and custom defined data operations functions management. +type SpeciesSurveyDao struct { + table string // Table is the underlying table name of the DAO. + group string // Group is the database configuration group name of current DAO. + columns SpeciesSurveyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. +} + +// SpeciesSurveyColumns defines and stores column names for table species_survey. +type SpeciesSurveyColumns struct { + Id string // + SpeciesCode string // 调查记录编码 + Province string // 省(自治区、直辖市) + City string // 市(地、州、盟) + County string // 县(区、市、旗) + Code string // 区划代码 + CourseName string // 踏查路线名称 + MarkArea string // 踏查总面积(平方千米) + MarkName string // 踏查点名称 + Longitude string // 经度 + Dimensionality string // 纬度 + Elevation string // 海拔 + Temperature string // 温度 + Precipitation string // 降水 + MarkAreaM string // 踏查点面积(亩) + HabitatType string // 生境类型 + SoilType string // 土壤类型 + SpeciesName string // 物种名称 + HarmObject string // 危害对象 + HappenArea string // 发生面积(亩) + Treatment string // 治理措施(有 无) + IsStandard string // 是否设置标准样地 + StandardCode string // 标准样地编号 + IsSpecimen string // 是否采集标本 + SpecimenCode string // 标本编号 + Img string // 图片 + SourcesData string // 数据来源 + CreateUser string // 数据采集人 + CreateDate string // 数据采集日期 + AuditUser string // 数据核查人 + AuditDate string // 数据核查日期 + AuditStatus string // + AuditView string // + Remark string // + Version string // + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +var speciesSurveyColumns = SpeciesSurveyColumns{ + Id: "id", + SpeciesCode: "species_code", + Province: "province", + City: "city", + County: "county", + Code: "code", + CourseName: "course_name", + MarkArea: "mark_area", + MarkName: "mark_name", + Longitude: "longitude", + Dimensionality: "dimensionality", + Elevation: "elevation", + Temperature: "temperature", + Precipitation: "precipitation", + MarkAreaM: "mark_area_m", + HabitatType: "habitat_type", + SoilType: "soil_type", + SpeciesName: "species_name", + HarmObject: "harm_object", + HappenArea: "happen_area", + Treatment: "treatment", + IsStandard: "is_standard", + StandardCode: "standard_code", + IsSpecimen: "is_specimen", + SpecimenCode: "specimen_code", + Img: "img", + SourcesData: "sources_data", + CreateUser: "create_user", + CreateDate: "create_date", + AuditUser: "audit_user", + AuditDate: "audit_date", + AuditStatus: "audit_status", + AuditView: "audit_view", + Remark: "remark", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewSpeciesSurveyDao creates and returns a new DAO object for table data access. +func NewSpeciesSurveyDao() *SpeciesSurveyDao { + return &SpeciesSurveyDao{ + group: "default", + table: "species_survey", + columns: speciesSurveyColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *SpeciesSurveyDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *SpeciesSurveyDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *SpeciesSurveyDao) Columns() SpeciesSurveyColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *SpeciesSurveyDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *SpeciesSurveyDao) Ctx(ctx context.Context) *gdb.Model { + return dao.DB().Model(dao.table).Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note that, you should not Commit or Rollback the transaction in function f +// as it is automatically handled by this function. +func (dao *SpeciesSurveyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/internal/app/businesses/dao/naturalEnemyInsect.go b/internal/app/businesses/dao/naturalEnemyInsect.go new file mode 100644 index 0000000..a1c3b42 --- /dev/null +++ b/internal/app/businesses/dao/naturalEnemyInsect.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/dao/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// naturalEnemyInsectDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type naturalEnemyInsectDao struct { + *internal.NaturalEnemyInsectDao +} + +var ( + // NaturalEnemyInsect is globally public accessible object for table tools_gen_table operations. + NaturalEnemyInsect = naturalEnemyInsectDao{ + internal.NewNaturalEnemyInsectDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/prevention.go b/internal/app/businesses/dao/prevention.go new file mode 100644 index 0000000..e19a026 --- /dev/null +++ b/internal/app/businesses/dao/prevention.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/dao/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// preventionDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type preventionDao struct { + *internal.PreventionDao +} + +var ( + // Prevention is globally public accessible object for table tools_gen_table operations. + Prevention = preventionDao{ + internal.NewPreventionDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/speciesImgs.go b/internal/app/businesses/dao/speciesImgs.go new file mode 100644 index 0000000..dec47dc --- /dev/null +++ b/internal/app/businesses/dao/speciesImgs.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/dao/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// speciesImgsDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type speciesImgsDao struct { + *internal.SpeciesImgsDao +} + +var ( + // SpeciesImgs is globally public accessible object for table tools_gen_table operations. + SpeciesImgs = speciesImgsDao{ + internal.NewSpeciesImgsDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/dao/speciesSurvey.go b/internal/app/businesses/dao/speciesSurvey.go new file mode 100644 index 0000000..24ae31d --- /dev/null +++ b/internal/app/businesses/dao/speciesSurvey.go @@ -0,0 +1,29 @@ +// ========================================================================== +// GFast自动生成dao操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/dao/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package dao + +import ( + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao/internal" +) + +// speciesSurveyDao is the manager for logic model data accessing and custom defined data operations functions management. +// You can define custom methods on it to extend its functionality as you wish. +type speciesSurveyDao struct { + *internal.SpeciesSurveyDao +} + +var ( + // SpeciesSurvey is globally public accessible object for table tools_gen_table operations. + SpeciesSurvey = speciesSurveyDao{ + internal.NewSpeciesSurveyDao(), + } +) + +// Fill with you ideas below. diff --git a/internal/app/businesses/logic/biocontrolResource.go b/internal/app/businesses/logic/biocontrolResource.go new file mode 100644 index 0000000..3f68c88 --- /dev/null +++ b/internal/app/businesses/logic/biocontrolResource.go @@ -0,0 +1,227 @@ +package logic + +import ( + "context" + "errors" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterBiocontrolResource(NewIBiocontrolResource()) +} + +func NewIBiocontrolResource() service.IBiocontrolResource { + return &sBiocontrolResource{} +} + +type sBiocontrolResource struct{} + +func (s *sBiocontrolResource) List(ctx context.Context, req *model.BiocontrolResourceSearchReq) (listRes *model.BiocontrolResourceSearchRes, err error) { + listRes = new(model.BiocontrolResourceSearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.BiocontrolResource.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.BiocontrolResource.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.BiocontrolResource.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.ZhName != "" { + m = m.Where(dao.BiocontrolResource.Columns().ZhName+" like ?", "%"+req.ZhName+"%") + } + if req.ZhSynonym != "" { + m = m.Where(dao.BiocontrolResource.Columns().ZhSynonym+" like ?", "%"+req.ZhSynonym+"%") + } + if req.EnName != "" { + m = m.Where(dao.BiocontrolResource.Columns().EnName+" like ?", "%"+req.EnName+"%") + } + if req.LatinName != "" { + m = m.Where(dao.BiocontrolResource.Columns().LatinName+" like ?", "%"+req.LatinName+"%") + } + if req.LatinSynonym != "" { + m = m.Where(dao.BiocontrolResource.Columns().LatinSynonym+" like ?", "%"+req.LatinSynonym+"%") + } + if req.BiocontrolType != "" { + m = m.Where(dao.BiocontrolResource.Columns().BiocontrolType+" = ?", gconv.Int(req.BiocontrolType)) + } + if req.SourcesData != "" { + m = m.Where(dao.BiocontrolResource.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.BiocontrolResource.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.CreateDate != nil { + start := req.CreateDate[0] + end := req.CreateDate[1] + if start != nil && end != nil { + m = m.Where( + dao.BiocontrolResource.Columns().CreateDate+" >= ? AND "+ + dao.BiocontrolResource.Columns().CreateDate+" <= ?", + start, + end, + ) + } + } + if req.AuditStatus != "" { + m = m.Where(dao.BiocontrolResource.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.BiocontrolResourceListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.BiocontrolResourceListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.BiocontrolResourceListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + ZhName: v.ZhName, + ZhSynonym: v.ZhSynonym, + EnName: v.EnName, + LatinName: v.LatinName, + LatinSynonym: v.LatinSynonym, + BiocontrolType: v.BiocontrolType, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sBiocontrolResource) GetById(ctx context.Context, id int) (res *model.BiocontrolResourceInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.BiocontrolResource.Ctx(ctx).WithAll().Where(dao.BiocontrolResource.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sBiocontrolResource) Add(ctx context.Context, req *model.BiocontrolResourceAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + //查重 + count, err := dao.BiocontrolResource.Ctx(ctx).Where(dao.BiocontrolResource.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + + } + if count > 0 { + liberr.ErrIsNil(ctx, errors.New("请勿重复添加"), "请勿重复添加") + return + } + _, err = dao.BiocontrolResource.Ctx(ctx).Insert(do.BiocontrolResource{ + Id: req.Id, + SpeciesCode: req.SpeciesCode, + ZhName: req.ZhName, + ZhSynonym: req.ZhSynonym, + EnName: req.EnName, + LatinName: req.LatinName, + LatinSynonym: req.LatinSynonym, + BiocontrolType: req.BiocontrolType, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sBiocontrolResource) Edit(ctx context.Context, req *model.BiocontrolResourceEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "物种编码不存在") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + count, err := dao.BiocontrolResource.Ctx(ctx). + Where(dao.BiocontrolResource.Columns().SpeciesCode+" = ?", req.SpeciesCode). + WhereNot(dao.BiocontrolResource.Columns().Id, req.Id). // 排除当前记录 + Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if count > 0 { + // 使用非nil错误触发错误处理 + liberr.ErrIsNil(ctx, errors.New("物种编码已存在"), "请勿重复添加") + return + } + _, err = dao.BiocontrolResource.Ctx(ctx).WherePri(req.Id).Update(do.BiocontrolResource{ + SpeciesCode: req.SpeciesCode, + ZhName: req.ZhName, + ZhSynonym: req.ZhSynonym, + EnName: req.EnName, + LatinName: req.LatinName, + LatinSynonym: req.LatinSynonym, + BiocontrolType: req.BiocontrolType, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sBiocontrolResource) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.BiocontrolResource.Ctx(ctx).Delete(dao.BiocontrolResource.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/biologyEcology.go b/internal/app/businesses/logic/biologyEcology.go new file mode 100644 index 0000000..3c15f8b --- /dev/null +++ b/internal/app/businesses/logic/biologyEcology.go @@ -0,0 +1,191 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/logic/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterBiologyEcology(NewIBiologyEcology()) +} + +func NewIBiologyEcology() service.IBiologyEcology { + return &sBiologyEcology{} +} + +type sBiologyEcology struct{} + +func (s *sBiologyEcology) List(ctx context.Context, req *model.BiologyEcologySearchReq) (listRes *model.BiologyEcologySearchRes, err error) { + listRes = new(model.BiologyEcologySearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.BiologyEcology.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.BiologyEcology.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.BiologyEcology.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.LifeHistory != "" { + m = m.Where(dao.BiologyEcology.Columns().LifeHistory+" like ?", "%"+req.LifeHistory+"%") + } + if req.HabitatType != "" { + m = m.Where(dao.BiologyEcology.Columns().HabitatType+" like ?", "%"+req.HabitatType+"%") + } + if req.SpecimenGather != "" { + m = m.Where(dao.BiologyEcology.Columns().SpecimenGather+" like ?", "%"+req.SpecimenGather+"%") + } + if req.SpecimenSave != "" { + m = m.Where(dao.BiologyEcology.Columns().SpecimenSave+" like ?", "%"+req.SpecimenSave+"%") + } + if req.IntroduceDesc != "" { + m = m.Where(dao.BiologyEcology.Columns().IntroduceDesc+" like ?", "%"+req.IntroduceDesc+"%") + } + if req.Diffuse != "" { + m = m.Where(dao.BiologyEcology.Columns().Diffuse+" like ?", "%"+req.Diffuse+"%") + } + if req.RiskAssessment != "" { + m = m.Where(dao.BiologyEcology.Columns().RiskAssessment+" like ?", "%"+req.RiskAssessment+"%") + } + if req.SourcesData != "" { + m = m.Where(dao.BiologyEcology.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.BiologyEcology.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.AuditStatus != "" { + m = m.Where(dao.BiologyEcology.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.BiologyEcologyListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.BiologyEcologyListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.BiologyEcologyListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + LifeHistory: v.LifeHistory, + Character: v.Character, + HabitatType: v.HabitatType, + ZoologyDescribe: v.ZoologyDescribe, + SpecimenGather: v.SpecimenGather, + SpecimenSave: v.SpecimenSave, + IntroduceDesc: v.IntroduceDesc, + Diffuse: v.Diffuse, + RiskAssessment: v.RiskAssessment, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sBiologyEcology) GetById(ctx context.Context, id int) (res *model.BiologyEcologyInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.BiologyEcology.Ctx(ctx).WithAll().Where(dao.BiologyEcology.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sBiologyEcology) Add(ctx context.Context, req *model.BiologyEcologyAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.BiologyEcology.Ctx(ctx).Insert(do.BiologyEcology{ + SpeciesCode: req.SpeciesCode, + LifeHistory: req.LifeHistory, + Character: req.Character, + HabitatType: req.HabitatType, + ZoologyDescribe: req.ZoologyDescribe, + SpecimenGather: req.SpecimenGather, + SpecimenSave: req.SpecimenSave, + IntroduceDesc: req.IntroduceDesc, + Diffuse: req.Diffuse, + RiskAssessment: req.RiskAssessment, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sBiologyEcology) Edit(ctx context.Context, req *model.BiologyEcologyEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.BiologyEcology.Ctx(ctx).WherePri(req.Id).Update(do.BiologyEcology{ + SpeciesCode: req.SpeciesCode, + LifeHistory: req.LifeHistory, + Character: req.Character, + HabitatType: req.HabitatType, + ZoologyDescribe: req.ZoologyDescribe, + SpecimenGather: req.SpecimenGather, + SpecimenSave: req.SpecimenSave, + IntroduceDesc: req.IntroduceDesc, + Diffuse: req.Diffuse, + RiskAssessment: req.RiskAssessment, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sBiologyEcology) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.BiologyEcology.Ctx(ctx).Delete(dao.BiologyEcology.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/definiteness.go b/internal/app/businesses/logic/definiteness.go new file mode 100644 index 0000000..152ce13 --- /dev/null +++ b/internal/app/businesses/logic/definiteness.go @@ -0,0 +1,217 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/logic/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + "errors" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterDefiniteness(NewIDefiniteness()) +} + +func NewIDefiniteness() service.IDefiniteness { + return &sDefiniteness{} +} + +type sDefiniteness struct{} + +func (s *sDefiniteness) List(ctx context.Context, req *model.DefinitenessSearchReq) (listRes *model.DefinitenessSearchRes, err error) { + listRes = new(model.DefinitenessSearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.Definiteness.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.Definiteness.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.Definiteness.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.CountryName != "" { + m = m.Where(dao.Definiteness.Columns().CountryName+" like ?", "%"+req.CountryName+"%") + } + if req.Definiteness != "" { + m = m.Where(dao.Definiteness.Columns().Definiteness+" like ?", "%"+req.Definiteness+"%") + } + if req.Year != "" { + m = m.Where(dao.Definiteness.Columns().Year+" like ?", "%"+req.Year+"%") + } + if req.SourcesData != "" { + m = m.Where(dao.Definiteness.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.Definiteness.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.CreateDate != nil { + start := req.CreateDate[0] + end := req.CreateDate[1] + if start != nil && end != nil { + m = m.Where( + dao.Definiteness.Columns().CreateDate+" >= ? AND "+ + dao.Definiteness.Columns().CreateDate+" <= ?", + start, + end, + ) + } + } + if req.AuditStatus != "" { + m = m.Where(dao.Definiteness.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.DefinitenessListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.DefinitenessListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.DefinitenessListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + CountryName: v.CountryName, + Definiteness: v.Definiteness, + Year: v.Year, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sDefiniteness) GetById(ctx context.Context, id int) (res *model.DefinitenessInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.Definiteness.Ctx(ctx).WithAll().Where(dao.Definiteness.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sDefiniteness) Add(ctx context.Context, req *model.DefinitenessAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + //查重 + count, err := dao.Definiteness.Ctx(ctx).Where(dao.Definiteness.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + + } + if count > 0 { + liberr.ErrIsNil(ctx, errors.New("请勿重复添加"), "请勿重复添加") + return + } + _, err = dao.Definiteness.Ctx(ctx).Insert(do.Definiteness{ + Id: req.Id, + SpeciesCode: req.SpeciesCode, + CountryName: req.CountryName, + Definiteness: req.Definiteness, + Year: req.Year, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sDefiniteness) Edit(ctx context.Context, req *model.DefinitenessEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "物种编码不存在") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + count, err := dao.Definiteness.Ctx(ctx). + Where(dao.Definiteness.Columns().SpeciesCode+" = ?", req.SpeciesCode). + WhereNot(dao.Definiteness.Columns().Id, req.Id). // 排除当前记录 + Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if count > 0 { + // 使用非nil错误触发错误处理 + liberr.ErrIsNil(ctx, errors.New("物种编码已存在"), "请勿重复添加") + return + } + _, err = dao.Definiteness.Ctx(ctx).WherePri(req.Id).Update(do.Definiteness{ + SpeciesCode: req.SpeciesCode, + CountryName: req.CountryName, + Definiteness: req.Definiteness, + Year: req.Year, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sDefiniteness) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.Definiteness.Ctx(ctx).Delete(dao.Definiteness.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/hostBotany.go b/internal/app/businesses/logic/hostBotany.go new file mode 100644 index 0000000..77edcbd --- /dev/null +++ b/internal/app/businesses/logic/hostBotany.go @@ -0,0 +1,271 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/logic/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + "errors" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterHostBotany(NewIHostBotany()) +} + +func NewIHostBotany() service.IHostBotany { + return &sHostBotany{} +} + +type sHostBotany struct{} + +func (s *sHostBotany) List(ctx context.Context, req *model.HostBotanySearchReq) (listRes *model.HostBotanySearchRes, err error) { + listRes = new(model.HostBotanySearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.HostBotany.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.HostBotany.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.HostBotany.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.ZhName != "" { + m = m.Where(dao.HostBotany.Columns().ZhName+" like ?", "%"+req.ZhName+"%") + } + if req.ZhSynonym != "" { + m = m.Where(dao.HostBotany.Columns().ZhSynonym+" like ?", "%"+req.ZhSynonym+"%") + } + if req.EnName != "" { + m = m.Where(dao.HostBotany.Columns().EnName+" like ?", "%"+req.EnName+"%") + } + if req.LatinName != "" { + m = m.Where(dao.HostBotany.Columns().LatinName+" like ?", "%"+req.LatinName+"%") + } + if req.LatinSynonym != "" { + m = m.Where(dao.HostBotany.Columns().LatinSynonym+" like ?", "%"+req.LatinSynonym+"%") + } + if req.Mu != "" { + m = m.Where(dao.HostBotany.Columns().Mu+" like ?", "%"+req.Mu+"%") + } + if req.OrderTitle != "" { + m = m.Where(dao.HostBotany.Columns().OrderTitle+" like ?", "%"+req.OrderTitle+"%") + } + if req.Ke != "" { + m = m.Where(dao.HostBotany.Columns().Ke+" like ?", "%"+req.Ke+"%") + } + if req.Family != "" { + m = m.Where(dao.HostBotany.Columns().Family+" like ?", "%"+req.Family+"%") + } + if req.Shu != "" { + m = m.Where(dao.HostBotany.Columns().Shu+" like ?", "%"+req.Shu+"%") + } + if req.Genus != "" { + m = m.Where(dao.HostBotany.Columns().Genus+" like ?", "%"+req.Genus+"%") + } + if req.Zhong != "" { + m = m.Where(dao.HostBotany.Columns().Zhong+" like ?", "%"+req.Zhong+"%") + } + if req.Species != "" { + m = m.Where(dao.HostBotany.Columns().Species+" like ?", "%"+req.Species+"%") + } + if req.HostType != "" { + m = m.Where(dao.HostBotany.Columns().HostType+" = ?", req.HostType) + } + if req.SourcesData != "" { + m = m.Where(dao.HostBotany.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.HostBotany.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.AuditStatus != "" { + m = m.Where(dao.HostBotany.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.HostBotanyListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.HostBotanyListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.HostBotanyListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + ZhName: v.ZhName, + ZhSynonym: v.ZhSynonym, + EnName: v.EnName, + LatinName: v.LatinName, + LatinSynonym: v.LatinSynonym, + Mu: v.Mu, + OrderTitle: v.OrderTitle, + Ke: v.Ke, + Family: v.Family, + Shu: v.Shu, + Genus: v.Genus, + Zhong: v.Zhong, + Species: v.Species, + HostType: v.HostType, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sHostBotany) GetById(ctx context.Context, id int) (res *model.HostBotanyInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.HostBotany.Ctx(ctx).WithAll().Where(dao.HostBotany.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sHostBotany) Add(ctx context.Context, req *model.HostBotanyAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + //查重 + count, err := dao.HostBotany.Ctx(ctx).Where(dao.HostBotany.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + + } + if count > 0 { + liberr.ErrIsNil(ctx, errors.New("请勿重复添加"), "请勿重复添加") + return + } + _, err = dao.HostBotany.Ctx(ctx).Insert(do.HostBotany{ + Id: req.Id, + SpeciesCode: req.SpeciesCode, + ZhName: req.ZhName, + ZhSynonym: req.ZhSynonym, + EnName: req.EnName, + LatinName: req.LatinName, + LatinSynonym: req.LatinSynonym, + Mu: req.Mu, + OrderTitle: req.OrderTitle, + Ke: req.Ke, + Family: req.Family, + Shu: req.Shu, + Genus: req.Genus, + Zhong: req.Zhong, + Species: req.Species, + HostType: req.HostType, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sHostBotany) Edit(ctx context.Context, req *model.HostBotanyEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "物种编码不存在") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + count, err := dao.HostBotany.Ctx(ctx). + Where(dao.HostBotany.Columns().SpeciesCode+" = ?", req.SpeciesCode). + WhereNot(dao.HostBotany.Columns().Id, req.Id). // 排除当前记录 + Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if count > 0 { + // 使用非nil错误触发错误处理 + liberr.ErrIsNil(ctx, errors.New("物种编码已存在"), "请勿重复添加") + return + } + _, err = dao.HostBotany.Ctx(ctx).WherePri(req.Id).Update(do.HostBotany{ + SpeciesCode: req.SpeciesCode, + ZhName: req.ZhName, + ZhSynonym: req.ZhSynonym, + EnName: req.EnName, + LatinName: req.LatinName, + LatinSynonym: req.LatinSynonym, + Mu: req.Mu, + OrderTitle: req.OrderTitle, + Ke: req.Ke, + Family: req.Family, + Shu: req.Shu, + Genus: req.Genus, + Zhong: req.Zhong, + Species: req.Species, + HostType: req.HostType, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sHostBotany) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.HostBotany.Ctx(ctx).Delete(dao.HostBotany.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/naturalEnemyInsect.go b/internal/app/businesses/logic/naturalEnemyInsect.go new file mode 100644 index 0000000..a6c6530 --- /dev/null +++ b/internal/app/businesses/logic/naturalEnemyInsect.go @@ -0,0 +1,301 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/logic/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + "errors" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterNaturalEnemyInsect(NewINaturalEnemyInsect()) +} + +func NewINaturalEnemyInsect() service.INaturalEnemyInsect { + return &sNaturalEnemyInsect{} +} + +type sNaturalEnemyInsect struct{} + +func (s *sNaturalEnemyInsect) List(ctx context.Context, req *model.NaturalEnemyInsectSearchReq) (listRes *model.NaturalEnemyInsectSearchRes, err error) { + listRes = new(model.NaturalEnemyInsectSearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.NaturalEnemyInsect.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.ZhName != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().ZhName+" like ?", "%"+req.ZhName+"%") + } + if req.LatinName != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().LatinName+" like ?", "%"+req.LatinName+"%") + } + if req.Mu != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Mu+" like ?", "%"+req.Mu+"%") + } + if req.OrderTitle != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().OrderTitle+" like ?", "%"+req.OrderTitle+"%") + } + if req.Ke != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Ke+" like ?", "%"+req.Ke+"%") + } + if req.Family != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Family+" like ?", "%"+req.Family+"%") + } + if req.Shu != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Shu+" like ?", "%"+req.Shu+"%") + } + if req.Genus != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Genus+" like ?", "%"+req.Genus+"%") + } + if req.SourceArea != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().SourceArea+" like ?", "%"+req.SourceArea+"%") + } + if req.Source != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Source+" like ?", "%"+req.Source+"%") + } + if req.StudyPlot != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().StudyPlot+" like ?", "%"+req.StudyPlot+"%") + } + if req.Selectivity != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().Selectivity+" like ?", "%"+req.Selectivity+"%") + } + if req.FeedingHarm != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().FeedingHarm+" like ?", "%"+req.FeedingHarm+"%") + } + if req.FeedingPart != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().FeedingPart+" like ?", "%"+req.FeedingPart+"%") + } + if req.AnswerIndicator != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().AnswerIndicator+" like ?", "%"+req.AnswerIndicator+"%") + } + if req.ReleaseRecord != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().ReleaseRecord+" like ?", "%"+req.ReleaseRecord+"%") + } + if req.FeedingStage != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().FeedingStage+" like ?", "%"+req.FeedingStage+"%") + } + if req.SourcesData != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.AuditStatus != "" { + m = m.Where(dao.NaturalEnemyInsect.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.NaturalEnemyInsectListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.NaturalEnemyInsectListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.NaturalEnemyInsectListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + ZhName: v.ZhName, + LatinName: v.LatinName, + Mu: v.Mu, + OrderTitle: v.OrderTitle, + Ke: v.Ke, + Family: v.Family, + Shu: v.Shu, + Genus: v.Genus, + SourceArea: v.SourceArea, + Source: v.Source, + StudyPlot: v.StudyPlot, + ExperimentDate: v.ExperimentDate, + Selectivity: v.Selectivity, + FeedingHarm: v.FeedingHarm, + FeedingPart: v.FeedingPart, + AnswerIndicator: v.AnswerIndicator, + ReleaseRecord: v.ReleaseRecord, + IsCreateGroup: v.IsCreateGroup, + FeedingStage: v.FeedingStage, + IsTarget: v.IsTarget, + FeedingDate: v.FeedingDate, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sNaturalEnemyInsect) GetById(ctx context.Context, id int) (res *model.NaturalEnemyInsectInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.NaturalEnemyInsect.Ctx(ctx).WithAll().Where(dao.NaturalEnemyInsect.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sNaturalEnemyInsect) Add(ctx context.Context, req *model.NaturalEnemyInsectAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + //查重 + count, err := dao.NaturalEnemyInsect.Ctx(ctx).Where(dao.NaturalEnemyInsect.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + + } + if count > 0 { + liberr.ErrIsNil(ctx, errors.New("请勿重复添加"), "请勿重复添加") + return + } + _, err = dao.NaturalEnemyInsect.Ctx(ctx).Insert(do.NaturalEnemyInsect{ + Id: req.Id, + SpeciesCode: req.SpeciesCode, + ZhName: req.ZhName, + LatinName: req.LatinName, + Mu: req.Mu, + OrderTitle: req.OrderTitle, + Ke: req.Ke, + Family: req.Family, + Shu: req.Shu, + Genus: req.Genus, + SourceArea: req.SourceArea, + Source: req.Source, + StudyPlot: req.StudyPlot, + ExperimentDate: req.ExperimentDate, + Selectivity: req.Selectivity, + FeedingHarm: req.FeedingHarm, + FeedingPart: req.FeedingPart, + AnswerIndicator: req.AnswerIndicator, + ReleaseRecord: req.ReleaseRecord, + IsCreateGroup: req.IsCreateGroup, + FeedingStage: req.FeedingStage, + IsTarget: req.IsTarget, + FeedingDate: req.FeedingDate, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sNaturalEnemyInsect) Edit(ctx context.Context, req *model.NaturalEnemyInsectEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "物种编码不存在") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + count, err := dao.NaturalEnemyInsect.Ctx(ctx). + Where(dao.NaturalEnemyInsect.Columns().SpeciesCode+" = ?", req.SpeciesCode). + WhereNot(dao.NaturalEnemyInsect.Columns().Id, req.Id). // 排除当前记录 + Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if count > 0 { + // 使用非nil错误触发错误处理 + liberr.ErrIsNil(ctx, errors.New("物种编码已存在"), "请勿重复添加") + return + } + _, err = dao.NaturalEnemyInsect.Ctx(ctx).WherePri(req.Id).Update(do.NaturalEnemyInsect{ + SpeciesCode: req.SpeciesCode, + ZhName: req.ZhName, + LatinName: req.LatinName, + Mu: req.Mu, + OrderTitle: req.OrderTitle, + Ke: req.Ke, + Family: req.Family, + Shu: req.Shu, + Genus: req.Genus, + SourceArea: req.SourceArea, + Source: req.Source, + StudyPlot: req.StudyPlot, + ExperimentDate: req.ExperimentDate, + Selectivity: req.Selectivity, + FeedingHarm: req.FeedingHarm, + FeedingPart: req.FeedingPart, + AnswerIndicator: req.AnswerIndicator, + ReleaseRecord: req.ReleaseRecord, + IsCreateGroup: req.IsCreateGroup, + FeedingStage: req.FeedingStage, + IsTarget: req.IsTarget, + FeedingDate: req.FeedingDate, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sNaturalEnemyInsect) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.NaturalEnemyInsect.Ctx(ctx).Delete(dao.NaturalEnemyInsect.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/prevention.go b/internal/app/businesses/logic/prevention.go new file mode 100644 index 0000000..5ebc4bf --- /dev/null +++ b/internal/app/businesses/logic/prevention.go @@ -0,0 +1,229 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/logic/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + "errors" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterPrevention(NewIPrevention()) +} + +func NewIPrevention() service.IPrevention { + return &sPrevention{} +} + +type sPrevention struct{} + +func (s *sPrevention) List(ctx context.Context, req *model.PreventionSearchReq) (listRes *model.PreventionSearchRes, err error) { + listRes = new(model.PreventionSearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.Prevention.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.Prevention.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.Prevention.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.BotanyQuarantine != "" { + m = m.Where(dao.Prevention.Columns().BotanyQuarantine+" like ?", "%"+req.BotanyQuarantine+"%") + } + if req.Physics != "" { + m = m.Where(dao.Prevention.Columns().Physics+" like ?", "%"+req.Physics+"%") + } + if req.Chemistry != "" { + m = m.Where(dao.Prevention.Columns().Chemistry+" like ?", "%"+req.Chemistry+"%") + } + if req.Biology != "" { + m = m.Where(dao.Prevention.Columns().Biology+" like ?", "%"+req.Biology+"%") + } + if req.Other != "" { + m = m.Where(dao.Prevention.Columns().Other+" like ?", "%"+req.Other+"%") + } + if req.SourcesData != "" { + m = m.Where(dao.Prevention.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.Prevention.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.CreateDate != nil { + start := req.CreateDate[0] + end := req.CreateDate[1] + if start != nil && end != nil { + m = m.Where( + dao.Prevention.Columns().CreateDate+" >= ? AND "+ + dao.Prevention.Columns().CreateDate+" <= ?", + start, + end, + ) + } + } + if req.AuditStatus != "" { + m = m.Where(dao.Prevention.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.PreventionListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.PreventionListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.PreventionListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + BotanyQuarantine: v.BotanyQuarantine, + Physics: v.Physics, + Chemistry: v.Chemistry, + Biology: v.Biology, + Other: v.Other, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sPrevention) GetById(ctx context.Context, id int) (res *model.PreventionInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.Prevention.Ctx(ctx).WithAll().Where(dao.Prevention.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sPrevention) Add(ctx context.Context, req *model.PreventionAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + //查重 + count, err := dao.Prevention.Ctx(ctx).Where(dao.Prevention.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + + } + if count > 0 { + liberr.ErrIsNil(ctx, errors.New("请勿重复添加"), "请勿重复添加") + return + } + _, err = dao.Prevention.Ctx(ctx).Insert(do.Prevention{ + Id: req.Id, + SpeciesCode: req.SpeciesCode, + BotanyQuarantine: req.BotanyQuarantine, + Physics: req.Physics, + Chemistry: req.Chemistry, + Biology: req.Biology, + Other: req.Other, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sPrevention) Edit(ctx context.Context, req *model.PreventionEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "物种编码不存在") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + count, err := dao.Prevention.Ctx(ctx). + Where(dao.Prevention.Columns().SpeciesCode+" = ?", req.SpeciesCode). + WhereNot(dao.Prevention.Columns().Id, req.Id). // 排除当前记录 + Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if count > 0 { + // 使用非nil错误触发错误处理 + liberr.ErrIsNil(ctx, errors.New("物种编码已存在"), "请勿重复添加") + return + } + _, err = dao.Prevention.Ctx(ctx).WherePri(req.Id).Update(do.Prevention{ + SpeciesCode: req.SpeciesCode, + BotanyQuarantine: req.BotanyQuarantine, + Physics: req.Physics, + Chemistry: req.Chemistry, + Biology: req.Biology, + Other: req.Other, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sPrevention) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.Prevention.Ctx(ctx).Delete(dao.Prevention.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/speciesImgs.go b/internal/app/businesses/logic/speciesImgs.go new file mode 100644 index 0000000..0b93e0d --- /dev/null +++ b/internal/app/businesses/logic/speciesImgs.go @@ -0,0 +1,207 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/logic/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + "errors" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterSpeciesImgs(NewISpeciesImgs()) +} + +func NewISpeciesImgs() service.ISpeciesImgs { + return &sSpeciesImgs{} +} + +type sSpeciesImgs struct{} + +func (s *sSpeciesImgs) List(ctx context.Context, req *model.SpeciesImgsSearchReq) (listRes *model.SpeciesImgsSearchRes, err error) { + listRes = new(model.SpeciesImgsSearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.SpeciesImgs.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.SpeciesImgs.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.SpeciesImgs.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.ImgType != "" { + m = m.Where(dao.SpeciesImgs.Columns().ImgType+" like ?", "%"+req.ImgType+"%") + } + if req.ImgSource != "" { + m = m.Where(dao.SpeciesImgs.Columns().ImgSource+" like ?", "%"+req.ImgSource+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.SpeciesImgs.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + if req.CreateDate != nil { + start := req.CreateDate[0] + end := req.CreateDate[1] + if start != nil && end != nil { + m = m.Where( + dao.SpeciesImgs.Columns().CreateDate+" >= ? AND "+ + dao.SpeciesImgs.Columns().CreateDate+" <= ?", + start, + end, + ) + } + } + if req.AuditStatus != "" { + m = m.Where(dao.SpeciesImgs.Columns().AuditStatus+" = ?", gconv.Int(req.AuditStatus)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.SpeciesImgsListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.SpeciesImgsListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.SpeciesImgsListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + Imgs: v.Imgs, + ImgType: v.ImgType, + ImgSource: v.ImgSource, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sSpeciesImgs) GetByInt(ctx context.Context, int int) (res *model.SpeciesImgsInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.SpeciesImgs.Ctx(ctx).WithAll().Where(dao.SpeciesImgs.Columns().Id, int).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sSpeciesImgs) Add(ctx context.Context, req *model.SpeciesImgsAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + //查重 + count, err := dao.SpeciesImgs.Ctx(ctx).Where(dao.SpeciesImgs.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + + } + if count > 0 { + liberr.ErrIsNil(ctx, errors.New("请勿重复添加"), "请勿重复添加") + return + } + _, err = dao.SpeciesImgs.Ctx(ctx).Insert(do.SpeciesImgs{ + SpeciesCode: req.SpeciesCode, + Imgs: req.Imgs, + ImgType: req.ImgType, + ImgSource: req.ImgSource, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sSpeciesImgs) Edit(ctx context.Context, req *model.SpeciesImgsEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + speciesNameCount, err := dao.SpeciesName.Ctx(ctx).Where(dao.SpeciesName.Columns().SpeciesCode+" = ?", req.SpeciesCode).Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "物种编码不存在") + return + } + if speciesNameCount == 0 { + liberr.ErrIsNil(ctx, errors.New("物种编码不存在"), "物种编码不存在") + return + } + count, err := dao.SpeciesImgs.Ctx(ctx). + Where(dao.SpeciesImgs.Columns().SpeciesCode+" = ?", req.SpeciesCode). + WhereNot(dao.SpeciesImgs.Columns().Id, req.Id). // 排除当前记录 + Count() + if err != nil { + liberr.ErrIsNil(ctx, err, "获取物种编码失败") + return + } + if count > 0 { + // 使用非nil错误触发错误处理 + liberr.ErrIsNil(ctx, errors.New("物种编码已存在"), "请勿重复添加") + return + } + _, err = dao.SpeciesImgs.Ctx(ctx).WherePri(req.Id).Update(do.SpeciesImgs{ + SpeciesCode: req.SpeciesCode, + Imgs: req.Imgs, + ImgType: req.ImgType, + ImgSource: req.ImgSource, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sSpeciesImgs) Delete(ctx context.Context, ints []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.SpeciesImgs.Ctx(ctx).Delete(dao.SpeciesImgs.Columns().Id+" in (?)", ints) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/speciesSurvey.go b/internal/app/businesses/logic/speciesSurvey.go new file mode 100644 index 0000000..ed45d68 --- /dev/null +++ b/internal/app/businesses/logic/speciesSurvey.go @@ -0,0 +1,248 @@ +// ========================================================================== +// GFast自动生成logic操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/logic/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package logic + +import ( + "context" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/util/gconv" + "github.com/tiger1103/gfast/v3/internal/app/businesses/dao" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model/do" + "github.com/tiger1103/gfast/v3/internal/app/businesses/service" + "github.com/tiger1103/gfast/v3/internal/app/system/consts" + "github.com/tiger1103/gfast/v3/library/liberr" +) + +func init() { + service.RegisterSpeciesSurvey(NewISpeciesSurvey()) +} + +func NewISpeciesSurvey() service.ISpeciesSurvey { + return &sSpeciesSurvey{} +} + +type sSpeciesSurvey struct{} + +func (s *sSpeciesSurvey) List(ctx context.Context, req *model.SpeciesSurveySearchReq) (listRes *model.SpeciesSurveySearchRes, err error) { + listRes = new(model.SpeciesSurveySearchRes) + err = g.Try(ctx, func(ctx context.Context) { + m := dao.SpeciesSurvey.Ctx(ctx).WithAll() + if req.Id != "" { + m = m.Where(dao.SpeciesSurvey.Columns().Id+" = ?", req.Id) + } + if req.SpeciesCode != "" { + m = m.Where(dao.SpeciesSurvey.Columns().SpeciesCode+" like ?", "%"+req.SpeciesCode+"%") + } + if req.Province != "" { + m = m.Where(dao.SpeciesSurvey.Columns().Province+" like ?", "%"+req.Province+"%") + } + if req.City != "" { + m = m.Where(dao.SpeciesSurvey.Columns().City+" like ?", "%"+req.City+"%") + } + if req.County != "" { + m = m.Where(dao.SpeciesSurvey.Columns().County+" like ?", "%"+req.County+"%") + } + if req.Code != "" { + m = m.Where(dao.SpeciesSurvey.Columns().Code+" like ?", "%"+req.Code+"%") + } + if req.CourseName != "" { + m = m.Where(dao.SpeciesSurvey.Columns().CourseName+" like ?", "%"+req.CourseName+"%") + } + if req.MarkName != "" { + m = m.Where(dao.SpeciesSurvey.Columns().MarkName+" like ?", "%"+req.MarkName+"%") + } + if req.HabitatType != "" { + m = m.Where(dao.SpeciesSurvey.Columns().HabitatType+" like ?", "%"+req.HabitatType+"%") + } + if req.SoilType != "" { + m = m.Where(dao.SpeciesSurvey.Columns().SoilType+" like ?", "%"+req.SoilType+"%") + } + if req.SpeciesName != "" { + m = m.Where(dao.SpeciesSurvey.Columns().SpeciesName+" like ?", "%"+req.SpeciesName+"%") + } + if req.HarmObject != "" { + m = m.Where(dao.SpeciesSurvey.Columns().HarmObject+" like ?", "%"+req.HarmObject+"%") + } + if req.StandardCode != "" { + m = m.Where(dao.SpeciesSurvey.Columns().StandardCode+" like ?", "%"+req.StandardCode+"%") + } + if req.SpecimenCode != "" { + m = m.Where(dao.SpeciesSurvey.Columns().SpecimenCode+" like ?", "%"+req.SpecimenCode+"%") + } + if req.SourcesData != "" { + m = m.Where(dao.SpeciesSurvey.Columns().SourcesData+" like ?", "%"+req.SourcesData+"%") + } + if req.CreateUser != "" { + m = m.Where(dao.SpeciesSurvey.Columns().CreateUser+" = ?", gconv.Int(req.CreateUser)) + } + listRes.Total, err = m.Count() + liberr.ErrIsNil(ctx, err, "获取总行数失败") + if req.PageNum == 0 { + req.PageNum = 1 + } + listRes.CurrentPage = req.PageNum + if req.PageSize == 0 { + req.PageSize = consts.PageSize + } + order := "id asc" + if req.OrderBy != "" { + order = req.OrderBy + } + var res []*model.SpeciesSurveyListRes + err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取数据失败") + listRes.List = make([]*model.SpeciesSurveyListRes, len(res)) + for k, v := range res { + listRes.List[k] = &model.SpeciesSurveyListRes{ + Id: v.Id, + SpeciesCode: v.SpeciesCode, + Province: v.Province, + City: v.City, + County: v.County, + Code: v.Code, + CourseName: v.CourseName, + MarkArea: v.MarkArea, + MarkName: v.MarkName, + Longitude: v.Longitude, + Dimensionality: v.Dimensionality, + Elevation: v.Elevation, + Temperature: v.Temperature, + Precipitation: v.Precipitation, + MarkAreaM: v.MarkAreaM, + HabitatType: v.HabitatType, + SoilType: v.SoilType, + SpeciesName: v.SpeciesName, + HarmObject: v.HarmObject, + HappenArea: v.HappenArea, + Treatment: v.Treatment, + IsStandard: v.IsStandard, + StandardCode: v.StandardCode, + IsSpecimen: v.IsSpecimen, + SpecimenCode: v.SpecimenCode, + Img: v.Img, + SourcesData: v.SourcesData, + CreateUser: v.CreateUser, + CreateDate: v.CreateDate, + AuditUser: v.AuditUser, + AuditDate: v.AuditDate, + AuditStatus: v.AuditStatus, + AuditView: v.AuditView, + Remark: v.Remark, + Version: v.Version, + CreatedAt: v.CreatedAt, + } + } + }) + return +} + +func (s *sSpeciesSurvey) GetById(ctx context.Context, id int) (res *model.SpeciesSurveyInfoRes, err error) { + err = g.Try(ctx, func(ctx context.Context) { + err = dao.SpeciesSurvey.Ctx(ctx).WithAll().Where(dao.SpeciesSurvey.Columns().Id, id).Scan(&res) + liberr.ErrIsNil(ctx, err, "获取信息失败") + }) + return +} + +func (s *sSpeciesSurvey) Add(ctx context.Context, req *model.SpeciesSurveyAddReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.SpeciesSurvey.Ctx(ctx).Insert(do.SpeciesSurvey{ + SpeciesCode: req.SpeciesCode, + Province: req.Province, + City: req.City, + County: req.County, + Code: req.Code, + CourseName: req.CourseName, + MarkArea: req.MarkArea, + MarkName: req.MarkName, + Longitude: req.Longitude, + Dimensionality: req.Dimensionality, + Elevation: req.Elevation, + Temperature: req.Temperature, + Precipitation: req.Precipitation, + MarkAreaM: req.MarkAreaM, + HabitatType: req.HabitatType, + SoilType: req.SoilType, + SpeciesName: req.SpeciesName, + HarmObject: req.HarmObject, + HappenArea: req.HappenArea, + Treatment: req.Treatment, + IsStandard: req.IsStandard, + StandardCode: req.StandardCode, + IsSpecimen: req.IsSpecimen, + SpecimenCode: req.SpecimenCode, + Img: req.Img, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + //Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "添加失败") + }) + return +} + +func (s *sSpeciesSurvey) Edit(ctx context.Context, req *model.SpeciesSurveyEditReq) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.SpeciesSurvey.Ctx(ctx).WherePri(req.Id).Update(do.SpeciesSurvey{ + SpeciesCode: req.SpeciesCode, + Province: req.Province, + City: req.City, + County: req.County, + Code: req.Code, + CourseName: req.CourseName, + MarkArea: req.MarkArea, + MarkName: req.MarkName, + Longitude: req.Longitude, + Dimensionality: req.Dimensionality, + Elevation: req.Elevation, + Temperature: req.Temperature, + Precipitation: req.Precipitation, + MarkAreaM: req.MarkAreaM, + HabitatType: req.HabitatType, + SoilType: req.SoilType, + SpeciesName: req.SpeciesName, + HarmObject: req.HarmObject, + HappenArea: req.HappenArea, + Treatment: req.Treatment, + IsStandard: req.IsStandard, + StandardCode: req.StandardCode, + IsSpecimen: req.IsSpecimen, + SpecimenCode: req.SpecimenCode, + Img: req.Img, + SourcesData: req.SourcesData, + CreateUser: req.CreateUser, + CreateDate: req.CreateDate, + //AuditUser: req.AuditUser, + //AuditDate: req.AuditDate, + AuditStatus: req.AuditStatus, + //AuditView: req.AuditView, + Remark: req.Remark, + Version: req.Version, + }) + liberr.ErrIsNil(ctx, err, "修改失败") + }) + return +} + +func (s *sSpeciesSurvey) Delete(ctx context.Context, ids []int) (err error) { + err = g.Try(ctx, func(ctx context.Context) { + _, err = dao.SpeciesSurvey.Ctx(ctx).Delete(dao.SpeciesSurvey.Columns().Id+" in (?)", ids) + liberr.ErrIsNil(ctx, err, "删除失败") + }) + return +} diff --git a/internal/app/businesses/logic/species_name.go b/internal/app/businesses/logic/species_name.go index 1b3d51d..66dbe1f 100644 --- a/internal/app/businesses/logic/species_name.go +++ b/internal/app/businesses/logic/species_name.go @@ -2,6 +2,7 @@ package logic import ( "context" + "errors" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/util/gconv" @@ -160,7 +161,10 @@ func (s *sSpeciesName) Edit(ctx context.Context, req *model.SpeciesNameEditReq) func (s *sSpeciesName) Delete(ctx context.Context, ids []int) (err error) { err = g.Try(ctx, func(ctx context.Context) { - _, err = dao.SpeciesName.Ctx(ctx).Delete(dao.SpeciesName.Columns().Id+" in (?)", ids) + if len(ids) == 0 { + liberr.ErrIsNil(ctx, errors.New("删除失败"), "删除失败") + } + _, err = dao.SpeciesName.Ctx(ctx).Delete(dao.SpeciesName.Columns().Id+" in (?)", g.Slice{ids}) liberr.ErrIsNil(ctx, err, "删除失败") }) return diff --git a/internal/app/businesses/model/biocontrolResource.go b/internal/app/businesses/model/biocontrolResource.go new file mode 100644 index 0000000..090f297 --- /dev/null +++ b/internal/app/businesses/model/biocontrolResource.go @@ -0,0 +1,132 @@ +// ========================================================================== +// GFast自动生成model操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/model/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// BiocontrolResourceInfoRes is the golang structure for table biocontrol_resource. +type BiocontrolResourceInfoRes struct { + gmeta.Meta `orm:"table:biocontrol_resource"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"物种编码"` // 物种编码 + ZhName string `orm:"zh_name" json:"zhName" dc:"中文学名"` // 中文学名 + ZhSynonym string `orm:"zh_synonym" json:"zhSynonym" dc:"中文异名"` // 中文异名 + EnName string `orm:"en_name" json:"enName" dc:"英文学名"` // 英文学名 + LatinName string `orm:"latin_name" json:"latinName" dc:"拉丁学名"` // 拉丁学名 + LatinSynonym string `orm:"latin_synonym" json:"latinSynonym" dc:"拉丁异名"` // 拉丁异名 + BiocontrolType int `orm:"biocontrol_type" json:"biocontrolType" dc:"生防物类型"` // 生防物类型 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type BiocontrolResourceListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"物种编码"` + ZhName string `json:"zhName" dc:"中文学名"` + ZhSynonym string `json:"zhSynonym" dc:"中文异名"` + EnName string `json:"enName" dc:"英文学名"` + LatinName string `json:"latinName" dc:"拉丁学名"` + LatinSynonym string `json:"latinSynonym" dc:"拉丁异名"` + BiocontrolType int `json:"biocontrolType" dc:"生防物类型"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// BiocontrolResourceSearchReq 分页请求参数 +type BiocontrolResourceSearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"物种编码"` //物种编码 + ZhName string `p:"zhName" dc:"中文学名"` //中文学名 + ZhSynonym string `p:"zhSynonym" dc:"中文异名"` //中文异名 + EnName string `p:"enName" dc:"英文学名"` //英文学名 + LatinName string `p:"latinName" dc:"拉丁学名"` //拉丁学名 + LatinSynonym string `p:"latinSynonym" dc:"拉丁异名"` //拉丁异名 + BiocontrolType string `p:"biocontrolType" v:"biocontrolType@integer#生防物类型需为整数" dc:"生防物类型"` //生防物类型 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" v:"createUser@integer#数据采集人需为整数" dc:"数据采集人"` //数据采集人 + CreateDate []*gtime.Time `p:"createDate" dc:"数据采集日期"` //数据采集日期 + //AuditUser string `p:"auditUser" v:"auditUser@integer#数据核查人需为整数" dc:"数据核查人"` //数据核查人 + //AuditDate string `p:"auditDate" v:"auditDate@date#数据核查日期需为YYYY-MM-DD格式" dc:"数据核查日期"` //数据核查日期 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 + //AuditView string `p:"auditView" dc:"核查意见"` //核查意见 + //Version string `p:"version" v:"version@integer#版本需为整数" dc:"版本"` //版本 + //CreatedAt string `p:"createdAt" v:"createdAt@datetime#需为YYYY-MM-DD hh:mm:ss格式" dc:""` // +} + +// BiocontrolResourceSearchRes 列表返回结果 +type BiocontrolResourceSearchRes struct { + comModel.ListRes + List []*BiocontrolResourceListRes `json:"list"` +} + +// BiocontrolResourceAddReq 添加操作请求参数 +type BiocontrolResourceAddReq struct { + Id int `p:"id" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + ZhName string `p:"zhName" v:"required#中文学名不能为空" dc:"中文学名"` + ZhSynonym string `p:"zhSynonym" dc:"中文异名"` + EnName string `p:"enName" v:"required#英文学名不能为空" dc:"英文学名"` + LatinName string `p:"latinName" v:"required#拉丁学名不能为空" dc:"拉丁学名"` + LatinSynonym string `p:"latinSynonym" dc:"拉丁异名"` + BiocontrolType int `p:"biocontrolType" dc:"生防物类型"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// BiocontrolResourceEditReq 修改操作请求参数 +type BiocontrolResourceEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + ZhName string `p:"zhName" v:"required#中文学名不能为空" dc:"中文学名"` + ZhSynonym string `p:"zhSynonym" dc:"中文异名"` + EnName string `p:"enName" v:"required#英文学名不能为空" dc:"英文学名"` + LatinName string `p:"latinName" v:"required#拉丁学名不能为空" dc:"拉丁学名"` + LatinSynonym string `p:"latinSynonym" dc:"拉丁异名"` + BiocontrolType int `p:"biocontrolType" dc:"生防物类型"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/biologyEcology.go b/internal/app/businesses/model/biologyEcology.go new file mode 100644 index 0000000..e90b2f3 --- /dev/null +++ b/internal/app/businesses/model/biologyEcology.go @@ -0,0 +1,129 @@ +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// BiologyEcologyInfoRes is the golang structure for table biology_ecology. +type BiologyEcologyInfoRes struct { + gmeta.Meta `orm:"table:biology_ecology"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"编码"` // 编码 + LifeHistory string `orm:"life_history" json:"lifeHistory" dc:"生活史/侵染循环"` // 生活史/侵染循环 + Character string `orm:"character" json:"character" dc:"发生与危害特性"` // 发生与危害特性 + HabitatType string `orm:"habitat_type" json:"habitatType" dc:"生境类型"` // 生境类型 + ZoologyDescribe string `orm:"zoology_describe" json:"zoologyDescribe" dc:"生态、经济和社会影响描述"` // 生态、经济和社会影响描述 + SpecimenGather string `orm:"specimen_gather" json:"specimenGather" dc:"模式标本采集地"` // 模式标本采集地 + SpecimenSave string `orm:"specimen_save" json:"specimenSave" dc:"模式标本保存地"` // 模式标本保存地 + IntroduceDesc string `orm:"introduce_desc" json:"introduceDesc" dc:"首次发现或引入的地点及时间"` // 首次发现或引入的地点及时间 + Diffuse string `orm:"diffuse" json:"diffuse" dc:"传播与扩散途径"` // 传播与扩散途径 + RiskAssessment string `orm:"risk_assessment" json:"riskAssessment" dc:"风险评估结果"` // 风险评估结果 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type BiologyEcologyListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"编码"` + LifeHistory string `json:"lifeHistory" dc:"生活史/侵染循环"` + Character string `json:"character" dc:"发生与危害特性"` + HabitatType string `json:"habitatType" dc:"生境类型"` + ZoologyDescribe string `json:"zoologyDescribe" dc:"生态、经济和社会影响描述"` + SpecimenGather string `json:"specimenGather" dc:"模式标本采集地"` + SpecimenSave string `json:"specimenSave" dc:"模式标本保存地"` + IntroduceDesc string `json:"introduceDesc" dc:"首次发现或引入的地点及时间"` + Diffuse string `json:"diffuse" dc:"传播与扩散途径"` + RiskAssessment string `json:"riskAssessment" dc:"风险评估结果"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// BiologyEcologySearchReq 分页请求参数 +type BiologyEcologySearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"编码"` //编码 + LifeHistory string `p:"lifeHistory" dc:"生活史/侵染循环"` //生活史/侵染循环 + HabitatType string `p:"habitatType" dc:"生境类型"` //生境类型 + SpecimenGather string `p:"specimenGather" dc:"模式标本采集地"` //模式标本采集地 + SpecimenSave string `p:"specimenSave" dc:"模式标本保存地"` //模式标本保存地 + IntroduceDesc string `p:"introduceDesc" dc:"首次发现或引入的地点及时间"` //首次发现或引入的地点及时间 + Diffuse string `p:"diffuse" dc:"传播与扩散途径"` //传播与扩散途径 + RiskAssessment string `p:"riskAssessment" dc:"风险评估结果"` //风险评估结果 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" dc:"数据采集人"` //数据采集人 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 +} + +// BiologyEcologySearchRes 列表返回结果 +type BiologyEcologySearchRes struct { + comModel.ListRes + List []*BiologyEcologyListRes `json:"list"` +} + +// BiologyEcologyAddReq 添加操作请求参数 +type BiologyEcologyAddReq struct { + SpeciesCode string `p:"speciesCode" dc:"编码"` + LifeHistory string `p:"lifeHistory" dc:"生活史/侵染循环"` + Character string `p:"character" dc:"发生与危害特性"` + HabitatType string `p:"habitatType" dc:"生境类型"` + ZoologyDescribe string `p:"zoologyDescribe" dc:"生态、经济和社会影响描述"` + SpecimenGather string `p:"specimenGather" dc:"模式标本采集地"` + SpecimenSave string `p:"specimenSave" dc:"模式标本保存地"` + IntroduceDesc string `p:"introduceDesc" dc:"首次发现或引入的地点及时间"` + Diffuse string `p:"diffuse" dc:"传播与扩散途径"` + RiskAssessment string `p:"riskAssessment" dc:"风险评估结果"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// BiologyEcologyEditReq 修改操作请求参数 +type BiologyEcologyEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"编码"` + LifeHistory string `p:"lifeHistory" dc:"生活史/侵染循环"` + Character string `p:"character" dc:"发生与危害特性"` + HabitatType string `p:"habitatType" dc:"生境类型"` + ZoologyDescribe string `p:"zoologyDescribe" dc:"生态、经济和社会影响描述"` + SpecimenGather string `p:"specimenGather" dc:"模式标本采集地"` + SpecimenSave string `p:"specimenSave" dc:"模式标本保存地"` + IntroduceDesc string `p:"introduceDesc" dc:"首次发现或引入的地点及时间"` + Diffuse string `p:"diffuse" dc:"传播与扩散途径"` + RiskAssessment string `p:"riskAssessment" dc:"风险评估结果"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/definiteness.go b/internal/app/businesses/model/definiteness.go new file mode 100644 index 0000000..5ffbba8 --- /dev/null +++ b/internal/app/businesses/model/definiteness.go @@ -0,0 +1,112 @@ +// ========================================================================== +// GFast自动生成model操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/model/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// DefinitenessInfoRes is the golang structure for table definiteness. +type DefinitenessInfoRes struct { + gmeta.Meta `orm:"table:definiteness"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"物种编码"` // 物种编码 + CountryName string `orm:"country_name" json:"countryName" dc:"国家名称"` // 国家名称 + Definiteness string `orm:"definiteness" json:"definiteness" dc:"限定性情况"` // 限定性情况 + Year string `orm:"year" json:"year" dc:"制定年份"` // 制定年份 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type DefinitenessListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"物种编码"` + CountryName string `json:"countryName" dc:"国家名称"` + Definiteness string `json:"definiteness" dc:"限定性情况"` + Year string `json:"year" dc:"制定年份"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// DefinitenessSearchReq 分页请求参数 +type DefinitenessSearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"物种编码"` //物种编码 + CountryName string `p:"countryName" dc:"国家名称"` //国家名称 + Definiteness string `p:"definiteness" dc:"限定性情况"` //限定性情况 + Year string `p:"year" dc:"制定年份"` //制定年份 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" v:"createUser@integer#数据采集人需为整数" dc:"数据采集人"` //数据采集人 + CreateDate []*gtime.Time `p:"createDate" dc:"数据采集日期"` //数据采集日期 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 +} + +// DefinitenessSearchRes 列表返回结果 +type DefinitenessSearchRes struct { + comModel.ListRes + List []*DefinitenessListRes `json:"list"` +} + +// DefinitenessAddReq 添加操作请求参数 +type DefinitenessAddReq struct { + Id int `p:"id" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + CountryName string `p:"countryName" v:"required#国家名称不能为空" dc:"国家名称"` + Definiteness string `p:"definiteness" dc:"限定性情况"` + Year string `p:"year" dc:"制定年份"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// DefinitenessEditReq 修改操作请求参数 +type DefinitenessEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + CountryName string `p:"countryName" v:"required#国家名称不能为空" dc:"国家名称"` + Definiteness string `p:"definiteness" dc:"限定性情况"` + Year string `p:"year" dc:"制定年份"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/do/biocontrolResource.go b/internal/app/businesses/model/do/biocontrolResource.go new file mode 100644 index 0000000..a403f33 --- /dev/null +++ b/internal/app/businesses/model/do/biocontrolResource.go @@ -0,0 +1,40 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/model/entity/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// BiocontrolResource is the golang structure for table biocontrol_resource. +type BiocontrolResource struct { + gmeta.Meta `orm:"table:biocontrol_resource, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 物种编码 + ZhName interface{} `orm:"zh_name" json:"zhName"` // 中文学名 + ZhSynonym interface{} `orm:"zh_synonym" json:"zhSynonym"` // 中文异名 + EnName interface{} `orm:"en_name" json:"enName"` // 英文学名 + LatinName interface{} `orm:"latin_name" json:"latinName"` // 拉丁学名 + LatinSynonym interface{} `orm:"latin_synonym" json:"latinSynonym"` // 拉丁异名 + BiocontrolType interface{} `orm:"biocontrol_type" json:"biocontrolType"` // 生防物类型 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/biologyEcology.go b/internal/app/businesses/model/do/biologyEcology.go new file mode 100644 index 0000000..d5bd9c0 --- /dev/null +++ b/internal/app/businesses/model/do/biologyEcology.go @@ -0,0 +1,43 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/model/entity/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// BiologyEcology is the golang structure for table biology_ecology. +type BiologyEcology struct { + gmeta.Meta `orm:"table:biology_ecology, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 编码 + LifeHistory interface{} `orm:"life_history" json:"lifeHistory"` // 生活史/侵染循环 + Character interface{} `orm:"character" json:"character"` // 发生与危害特性 + HabitatType interface{} `orm:"habitat_type" json:"habitatType"` // 生境类型 + ZoologyDescribe interface{} `orm:"zoology_describe" json:"zoologyDescribe"` // 生态、经济和社会影响描述 + SpecimenGather interface{} `orm:"specimen_gather" json:"specimenGather"` // 模式标本采集地 + SpecimenSave interface{} `orm:"specimen_save" json:"specimenSave"` // 模式标本保存地 + IntroduceDesc interface{} `orm:"introduce_desc" json:"introduceDesc"` // 首次发现或引入的地点及时间 + Diffuse interface{} `orm:"diffuse" json:"diffuse"` // 传播与扩散途径 + RiskAssessment interface{} `orm:"risk_assessment" json:"riskAssessment"` // 风险评估结果 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/definiteness.go b/internal/app/businesses/model/do/definiteness.go new file mode 100644 index 0000000..7dbd059 --- /dev/null +++ b/internal/app/businesses/model/do/definiteness.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/model/entity/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// Definiteness is the golang structure for table definiteness. +type Definiteness struct { + gmeta.Meta `orm:"table:definiteness, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 物种编码 + CountryName interface{} `orm:"country_name" json:"countryName"` // 国家名称 + Definiteness interface{} `orm:"definiteness" json:"definiteness"` // 限定性情况 + Year interface{} `orm:"year" json:"year"` // 制定年份 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/hostBotany.go b/internal/app/businesses/model/do/hostBotany.go new file mode 100644 index 0000000..563a437 --- /dev/null +++ b/internal/app/businesses/model/do/hostBotany.go @@ -0,0 +1,48 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/model/entity/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// HostBotany is the golang structure for table host_botany. +type HostBotany struct { + gmeta.Meta `orm:"table:host_botany, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 物种编码 + ZhName interface{} `orm:"zh_name" json:"zhName"` // 中文学名 + ZhSynonym interface{} `orm:"zh_synonym" json:"zhSynonym"` // 中文异名 + EnName interface{} `orm:"en_name" json:"enName"` // 英文学名 + LatinName interface{} `orm:"latin_name" json:"latinName"` // 拉丁学名 + LatinSynonym interface{} `orm:"latin_synonym" json:"latinSynonym"` // 拉丁异名 + Mu interface{} `orm:"mu" json:"mu"` // 目 + OrderTitle interface{} `orm:"order_title" json:"orderTitle"` // Order + Ke interface{} `orm:"ke" json:"ke"` // 科 + Family interface{} `orm:"family" json:"family"` // Family + Shu interface{} `orm:"shu" json:"shu"` // 属 + Genus interface{} `orm:"genus" json:"genus"` // Genus + Zhong interface{} `orm:"zhong" json:"zhong"` // 种 + Species interface{} `orm:"species" json:"species"` // Species + HostType interface{} `orm:"host_type" json:"hostType"` // 寄主类型 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/naturalEnemyInsect.go b/internal/app/businesses/model/do/naturalEnemyInsect.go new file mode 100644 index 0000000..c4d974d --- /dev/null +++ b/internal/app/businesses/model/do/naturalEnemyInsect.go @@ -0,0 +1,55 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/model/entity/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// NaturalEnemyInsect is the golang structure for table natural_enemy_insect. +type NaturalEnemyInsect struct { + gmeta.Meta `orm:"table:natural_enemy_insect, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 物种编码(入侵种) + ZhName interface{} `orm:"zh_name" json:"zhName"` // 中文名称(天敌) + LatinName interface{} `orm:"latin_name" json:"latinName"` // 拉丁学名(天敌) + Mu interface{} `orm:"mu" json:"mu"` // 目 + OrderTitle interface{} `orm:"order_title" json:"orderTitle"` // Order + Ke interface{} `orm:"ke" json:"ke"` // 科 + Family interface{} `orm:"family" json:"family"` // Family + Shu interface{} `orm:"shu" json:"shu"` // 属 + Genus interface{} `orm:"genus" json:"genus"` // Genus + SourceArea interface{} `orm:"source_area" json:"sourceArea"` // 原产地 + Source interface{} `orm:"source" json:"source"` // 来源地 + StudyPlot interface{} `orm:"study_plot" json:"studyPlot"` // 释放地/实验地 + ExperimentDate *gtime.Time `orm:"experiment_date" json:"experimentDate"` // 引进时间/实验时间 + Selectivity interface{} `orm:"selectivity" json:"selectivity"` // 专一性 + FeedingHarm interface{} `orm:"feeding_harm" json:"feedingHarm"` // 取食/危害阶段 + FeedingPart interface{} `orm:"feeding_part" json:"feedingPart"` // 取食/危害部位 + AnswerIndicator interface{} `orm:"answer_indicator" json:"answerIndicator"` // 响应指标 + ReleaseRecord interface{} `orm:"release_record" json:"releaseRecord"` // 释放记录 + IsCreateGroup interface{} `orm:"is_create_group" json:"isCreateGroup"` // 是否建群 + FeedingStage interface{} `orm:"feeding_stage" json:"feedingStage"` // 取食阶段 + IsTarget interface{} `orm:"is_target" json:"isTarget"` // 有无非目标影响 + FeedingDate *gtime.Time `orm:"feeding_date" json:"feedingDate"` // 取食时间/活跃时间 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/prevention.go b/internal/app/businesses/model/do/prevention.go new file mode 100644 index 0000000..a2cb1b9 --- /dev/null +++ b/internal/app/businesses/model/do/prevention.go @@ -0,0 +1,39 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/model/entity/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// Prevention is the golang structure for table prevention. +type Prevention struct { + gmeta.Meta `orm:"table:prevention, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 物种编码 + BotanyQuarantine interface{} `orm:"botany_quarantine" json:"botanyQuarantine"` // 植物检疫 + Physics interface{} `orm:"physics" json:"physics"` // 物理防治 + Chemistry interface{} `orm:"chemistry" json:"chemistry"` // 化学防治 + Biology interface{} `orm:"biology" json:"biology"` // 生物防治 + Other interface{} `orm:"other" json:"other"` // 其他防控措施 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/speciesImgs.go b/internal/app/businesses/model/do/speciesImgs.go new file mode 100644 index 0000000..cb96b3f --- /dev/null +++ b/internal/app/businesses/model/do/speciesImgs.go @@ -0,0 +1,36 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/model/entity/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// SpeciesImgs is the golang structure for table species_imgs. +type SpeciesImgs struct { + gmeta.Meta `orm:"table:species_imgs, do:true"` + Id interface{} `orm:"Id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 物种编码 + Imgs interface{} `orm:"imgs" json:"imgs"` // 图片 + ImgType interface{} `orm:"img_type" json:"imgType"` // 图片类型 + ImgSource interface{} `orm:"img_source" json:"imgSource"` // 图片来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 图片拍摄/提供人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 图片拍摄/提供日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 图片核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 图片核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView interface{} `orm:"audit_view" json:"auditView"` // 核查意见 + Remark interface{} `orm:"remark" json:"remark"` // 备注 + Version interface{} `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/do/speciesSurvey.go b/internal/app/businesses/model/do/speciesSurvey.go new file mode 100644 index 0000000..30d3ef2 --- /dev/null +++ b/internal/app/businesses/model/do/speciesSurvey.go @@ -0,0 +1,58 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/model/entity/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package do + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// SpeciesSurvey is the golang structure for table species_survey. +type SpeciesSurvey struct { + gmeta.Meta `orm:"table:species_survey, do:true"` + Id interface{} `orm:"id,primary" json:"id"` // + SpeciesCode interface{} `orm:"species_code" json:"speciesCode"` // 调查记录编码 + Province interface{} `orm:"province" json:"province"` // 省(自治区、直辖市) + City interface{} `orm:"city" json:"city"` // 市(地、州、盟) + County interface{} `orm:"county" json:"county"` // 县(区、市、旗) + Code interface{} `orm:"code" json:"code"` // 区划代码 + CourseName interface{} `orm:"course_name" json:"courseName"` // 踏查路线名称 + MarkArea interface{} `orm:"mark_area" json:"markArea"` // 踏查总面积(平方千米) + MarkName interface{} `orm:"mark_name" json:"markName"` // 踏查点名称 + Longitude interface{} `orm:"longitude" json:"longitude"` // 经度 + Dimensionality interface{} `orm:"dimensionality" json:"dimensionality"` // 纬度 + Elevation interface{} `orm:"elevation" json:"elevation"` // 海拔 + Temperature interface{} `orm:"temperature" json:"temperature"` // 温度 + Precipitation interface{} `orm:"precipitation" json:"precipitation"` // 降水 + MarkAreaM interface{} `orm:"mark_area_m" json:"markAreaM"` // 踏查点面积(亩) + HabitatType interface{} `orm:"habitat_type" json:"habitatType"` // 生境类型 + SoilType interface{} `orm:"soil_type" json:"soilType"` // 土壤类型 + SpeciesName interface{} `orm:"species_name" json:"speciesName"` // 物种名称 + HarmObject interface{} `orm:"harm_object" json:"harmObject"` // 危害对象 + HappenArea interface{} `orm:"happen_area" json:"happenArea"` // 发生面积(亩) + Treatment interface{} `orm:"treatment" json:"treatment"` // 治理措施(有 无) + IsStandard interface{} `orm:"is_standard" json:"isStandard"` // 是否设置标准样地 + StandardCode interface{} `orm:"standard_code" json:"standardCode"` // 标准样地编号 + IsSpecimen interface{} `orm:"is_specimen" json:"isSpecimen"` // 是否采集标本 + SpecimenCode interface{} `orm:"specimen_code" json:"specimenCode"` // 标本编号 + Img interface{} `orm:"img" json:"img"` // 图片 + SourcesData interface{} `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser interface{} `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser interface{} `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus interface{} `orm:"audit_status" json:"auditStatus"` // + AuditView interface{} `orm:"audit_view" json:"auditView"` // + Remark interface{} `orm:"remark" json:"remark"` // + Version interface{} `orm:"version" json:"version"` // + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/biocontrolResource.go b/internal/app/businesses/model/entity/biocontrolResource.go new file mode 100644 index 0000000..f7eeec4 --- /dev/null +++ b/internal/app/businesses/model/entity/biocontrolResource.go @@ -0,0 +1,40 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/model/entity/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// BiocontrolResource is the golang structure for table biocontrol_resource. +type BiocontrolResource struct { + gmeta.Meta `orm:"table:biocontrol_resource"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 物种编码 + ZhName string `orm:"zh_name" json:"zhName"` // 中文学名 + ZhSynonym string `orm:"zh_synonym" json:"zhSynonym"` // 中文异名 + EnName string `orm:"en_name" json:"enName"` // 英文学名 + LatinName string `orm:"latin_name" json:"latinName"` // 拉丁学名 + LatinSynonym string `orm:"latin_synonym" json:"latinSynonym"` // 拉丁异名 + BiocontrolType int `orm:"biocontrol_type" json:"biocontrolType"` // 生防物类型 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/biologyEcology.go b/internal/app/businesses/model/entity/biologyEcology.go new file mode 100644 index 0000000..7b0a304 --- /dev/null +++ b/internal/app/businesses/model/entity/biologyEcology.go @@ -0,0 +1,43 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/model/entity/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// BiologyEcology is the golang structure for table biology_ecology. +type BiologyEcology struct { + gmeta.Meta `orm:"table:biology_ecology"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 编码 + LifeHistory string `orm:"life_history" json:"lifeHistory"` // 生活史/侵染循环 + Character string `orm:"character" json:"character"` // 发生与危害特性 + HabitatType string `orm:"habitat_type" json:"habitatType"` // 生境类型 + ZoologyDescribe string `orm:"zoology_describe" json:"zoologyDescribe"` // 生态、经济和社会影响描述 + SpecimenGather string `orm:"specimen_gather" json:"specimenGather"` // 模式标本采集地 + SpecimenSave string `orm:"specimen_save" json:"specimenSave"` // 模式标本保存地 + IntroduceDesc string `orm:"introduce_desc" json:"introduceDesc"` // 首次发现或引入的地点及时间 + Diffuse string `orm:"diffuse" json:"diffuse"` // 传播与扩散途径 + RiskAssessment string `orm:"risk_assessment" json:"riskAssessment"` // 风险评估结果 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/definiteness.go b/internal/app/businesses/model/entity/definiteness.go new file mode 100644 index 0000000..7001161 --- /dev/null +++ b/internal/app/businesses/model/entity/definiteness.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/model/entity/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// Definiteness is the golang structure for table definiteness. +type Definiteness struct { + gmeta.Meta `orm:"table:definiteness"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 物种编码 + CountryName string `orm:"country_name" json:"countryName"` // 国家名称 + Definiteness string `orm:"definiteness" json:"definiteness"` // 限定性情况 + Year string `orm:"year" json:"year"` // 制定年份 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/hostBotany.go b/internal/app/businesses/model/entity/hostBotany.go new file mode 100644 index 0000000..9b44fab --- /dev/null +++ b/internal/app/businesses/model/entity/hostBotany.go @@ -0,0 +1,48 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/model/entity/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// HostBotany is the golang structure for table host_botany. +type HostBotany struct { + gmeta.Meta `orm:"table:host_botany"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 物种编码 + ZhName string `orm:"zh_name" json:"zhName"` // 中文学名 + ZhSynonym string `orm:"zh_synonym" json:"zhSynonym"` // 中文异名 + EnName string `orm:"en_name" json:"enName"` // 英文学名 + LatinName string `orm:"latin_name" json:"latinName"` // 拉丁学名 + LatinSynonym string `orm:"latin_synonym" json:"latinSynonym"` // 拉丁异名 + Mu string `orm:"mu" json:"mu"` // 目 + OrderTitle string `orm:"order_title" json:"orderTitle"` // Order + Ke string `orm:"ke" json:"ke"` // 科 + Family string `orm:"family" json:"family"` // Family + Shu string `orm:"shu" json:"shu"` // 属 + Genus string `orm:"genus" json:"genus"` // Genus + Zhong string `orm:"zhong" json:"zhong"` // 种 + Species string `orm:"species" json:"species"` // Species + HostType string `orm:"host_type" json:"hostType"` // 寄主类型 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/naturalEnemyInsect.go b/internal/app/businesses/model/entity/naturalEnemyInsect.go new file mode 100644 index 0000000..4486889 --- /dev/null +++ b/internal/app/businesses/model/entity/naturalEnemyInsect.go @@ -0,0 +1,55 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/model/entity/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// NaturalEnemyInsect is the golang structure for table natural_enemy_insect. +type NaturalEnemyInsect struct { + gmeta.Meta `orm:"table:natural_enemy_insect"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 物种编码(入侵种) + ZhName string `orm:"zh_name" json:"zhName"` // 中文名称(天敌) + LatinName string `orm:"latin_name" json:"latinName"` // 拉丁学名(天敌) + Mu string `orm:"mu" json:"mu"` // 目 + OrderTitle string `orm:"order_title" json:"orderTitle"` // Order + Ke string `orm:"ke" json:"ke"` // 科 + Family string `orm:"family" json:"family"` // Family + Shu string `orm:"shu" json:"shu"` // 属 + Genus string `orm:"genus" json:"genus"` // Genus + SourceArea string `orm:"source_area" json:"sourceArea"` // 原产地 + Source string `orm:"source" json:"source"` // 来源地 + StudyPlot string `orm:"study_plot" json:"studyPlot"` // 释放地/实验地 + ExperimentDate *gtime.Time `orm:"experiment_date" json:"experimentDate"` // 引进时间/实验时间 + Selectivity string `orm:"selectivity" json:"selectivity"` // 专一性 + FeedingHarm string `orm:"feeding_harm" json:"feedingHarm"` // 取食/危害阶段 + FeedingPart string `orm:"feeding_part" json:"feedingPart"` // 取食/危害部位 + AnswerIndicator string `orm:"answer_indicator" json:"answerIndicator"` // 响应指标 + ReleaseRecord string `orm:"release_record" json:"releaseRecord"` // 释放记录 + IsCreateGroup int `orm:"is_create_group" json:"isCreateGroup"` // 是否建群 + FeedingStage string `orm:"feeding_stage" json:"feedingStage"` // 取食阶段 + IsTarget int `orm:"is_target" json:"isTarget"` // 有无非目标影响 + FeedingDate *gtime.Time `orm:"feeding_date" json:"feedingDate"` // 取食时间/活跃时间 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/prevention.go b/internal/app/businesses/model/entity/prevention.go new file mode 100644 index 0000000..425d566 --- /dev/null +++ b/internal/app/businesses/model/entity/prevention.go @@ -0,0 +1,39 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/model/entity/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// Prevention is the golang structure for table prevention. +type Prevention struct { + gmeta.Meta `orm:"table:prevention"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 物种编码 + BotanyQuarantine string `orm:"botany_quarantine" json:"botanyQuarantine"` // 植物检疫 + Physics string `orm:"physics" json:"physics"` // 物理防治 + Chemistry string `orm:"chemistry" json:"chemistry"` // 化学防治 + Biology string `orm:"biology" json:"biology"` // 生物防治 + Other string `orm:"other" json:"other"` // 其他防控措施 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/speciesImgs.go b/internal/app/businesses/model/entity/speciesImgs.go new file mode 100644 index 0000000..6d2a706 --- /dev/null +++ b/internal/app/businesses/model/entity/speciesImgs.go @@ -0,0 +1,36 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/model/entity/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// SpeciesImgs is the golang structure for table species_imgs. +type SpeciesImgs struct { + gmeta.Meta `orm:"table:species_imgs"` + Id int `orm:"Id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 物种编码 + Imgs string `orm:"imgs" json:"imgs"` // 图片 + ImgType string `orm:"img_type" json:"imgType"` // 图片类型 + ImgSource string `orm:"img_source" json:"imgSource"` // 图片来源 + CreateUser int `orm:"create_user" json:"createUser"` // 图片拍摄/提供人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 图片拍摄/提供日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 图片核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 图片核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // 核查 + AuditView string `orm:"audit_view" json:"auditView"` // 核查意见 + Remark string `orm:"remark" json:"remark"` // 备注 + Version int `orm:"version" json:"version"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/entity/speciesSurvey.go b/internal/app/businesses/model/entity/speciesSurvey.go new file mode 100644 index 0000000..939c564 --- /dev/null +++ b/internal/app/businesses/model/entity/speciesSurvey.go @@ -0,0 +1,58 @@ +// ========================================================================== +// GFast自动生成model entity操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/model/entity/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" +) + +// SpeciesSurvey is the golang structure for table species_survey. +type SpeciesSurvey struct { + gmeta.Meta `orm:"table:species_survey"` + Id int `orm:"id,primary" json:"id"` // + SpeciesCode string `orm:"species_code" json:"speciesCode"` // 调查记录编码 + Province string `orm:"province" json:"province"` // 省(自治区、直辖市) + City string `orm:"city" json:"city"` // 市(地、州、盟) + County string `orm:"county" json:"county"` // 县(区、市、旗) + Code string `orm:"code" json:"code"` // 区划代码 + CourseName string `orm:"course_name" json:"courseName"` // 踏查路线名称 + MarkArea string `orm:"mark_area" json:"markArea"` // 踏查总面积(平方千米) + MarkName string `orm:"mark_name" json:"markName"` // 踏查点名称 + Longitude string `orm:"longitude" json:"longitude"` // 经度 + Dimensionality string `orm:"dimensionality" json:"dimensionality"` // 纬度 + Elevation string `orm:"elevation" json:"elevation"` // 海拔 + Temperature string `orm:"temperature" json:"temperature"` // 温度 + Precipitation string `orm:"precipitation" json:"precipitation"` // 降水 + MarkAreaM string `orm:"mark_area_m" json:"markAreaM"` // 踏查点面积(亩) + HabitatType string `orm:"habitat_type" json:"habitatType"` // 生境类型 + SoilType string `orm:"soil_type" json:"soilType"` // 土壤类型 + SpeciesName string `orm:"species_name" json:"speciesName"` // 物种名称 + HarmObject string `orm:"harm_object" json:"harmObject"` // 危害对象 + HappenArea string `orm:"happen_area" json:"happenArea"` // 发生面积(亩) + Treatment string `orm:"treatment" json:"treatment"` // 治理措施(有 无) + IsStandard int `orm:"is_standard" json:"isStandard"` // 是否设置标准样地 + StandardCode string `orm:"standard_code" json:"standardCode"` // 标准样地编号 + IsSpecimen int `orm:"is_specimen" json:"isSpecimen"` // 是否采集标本 + SpecimenCode string `orm:"specimen_code" json:"specimenCode"` // 标本编号 + Img string `orm:"img" json:"img"` // 图片 + SourcesData string `orm:"sources_data" json:"sourcesData"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus"` // + AuditView string `orm:"audit_view" json:"auditView"` // + Remark string `orm:"remark" json:"remark"` // + Version int `orm:"version" json:"version"` // + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // +} diff --git a/internal/app/businesses/model/hostBotany.go b/internal/app/businesses/model/hostBotany.go new file mode 100644 index 0000000..b1f97c3 --- /dev/null +++ b/internal/app/businesses/model/hostBotany.go @@ -0,0 +1,166 @@ +// ========================================================================== +// GFast自动生成model操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/model/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// HostBotanyInfoRes is the golang structure for table host_botany. +type HostBotanyInfoRes struct { + gmeta.Meta `orm:"table:host_botany"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"物种编码"` // 物种编码 + ZhName string `orm:"zh_name" json:"zhName" dc:"中文学名"` // 中文学名 + ZhSynonym string `orm:"zh_synonym" json:"zhSynonym" dc:"中文异名"` // 中文异名 + EnName string `orm:"en_name" json:"enName" dc:"英文学名"` // 英文学名 + LatinName string `orm:"latin_name" json:"latinName" dc:"拉丁学名"` // 拉丁学名 + LatinSynonym string `orm:"latin_synonym" json:"latinSynonym" dc:"拉丁异名"` // 拉丁异名 + Mu string `orm:"mu" json:"mu" dc:"目"` // 目 + OrderTitle string `orm:"order_title" json:"orderTitle" dc:"Order"` // Order + Ke string `orm:"ke" json:"ke" dc:"科"` // 科 + Family string `orm:"family" json:"family" dc:"Family"` // Family + Shu string `orm:"shu" json:"shu" dc:"属"` // 属 + Genus string `orm:"genus" json:"genus" dc:"Genus"` // Genus + Zhong string `orm:"zhong" json:"zhong" dc:"种"` // 种 + Species string `orm:"species" json:"species" dc:"Species"` // Species + HostType string `orm:"host_type" json:"hostType" dc:"寄主类型"` // 寄主类型 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type HostBotanyListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"物种编码"` + ZhName string `json:"zhName" dc:"中文学名"` + ZhSynonym string `json:"zhSynonym" dc:"中文异名"` + EnName string `json:"enName" dc:"英文学名"` + LatinName string `json:"latinName" dc:"拉丁学名"` + LatinSynonym string `json:"latinSynonym" dc:"拉丁异名"` + Mu string `json:"mu" dc:"目"` + OrderTitle string `json:"orderTitle" dc:"Order"` + Ke string `json:"ke" dc:"科"` + Family string `json:"family" dc:"Family"` + Shu string `json:"shu" dc:"属"` + Genus string `json:"genus" dc:"Genus"` + Zhong string `json:"zhong" dc:"种"` + Species string `json:"species" dc:"Species"` + HostType string `json:"hostType" dc:"寄主类型"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// HostBotanySearchReq 分页请求参数 +type HostBotanySearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"物种编码"` //物种编码 + ZhName string `p:"zhName" dc:"中文学名"` //中文学名 + ZhSynonym string `p:"zhSynonym" dc:"中文异名"` //中文异名 + EnName string `p:"enName" dc:"英文学名"` //英文学名 + LatinName string `p:"latinName" dc:"拉丁学名"` //拉丁学名 + LatinSynonym string `p:"latinSynonym" dc:"拉丁异名"` //拉丁异名 + Mu string `p:"mu" dc:"目"` //目 + OrderTitle string `p:"orderTitle" dc:"Order"` //Order + Ke string `p:"ke" dc:"科"` //科 + Family string `p:"family" dc:"Family"` //Family + Shu string `p:"shu" dc:"属"` //属 + Genus string `p:"genus" dc:"Genus"` //Genus + Zhong string `p:"zhong" dc:"种"` //种 + Species string `p:"species" dc:"Species"` //Species + HostType string `p:"hostType" dc:"寄主类型"` //寄主类型 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" v:"createUser@integer#数据采集人需为整数" dc:"数据采集人"` //数据采集人 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 +} + +// HostBotanySearchRes 列表返回结果 +type HostBotanySearchRes struct { + comModel.ListRes + List []*HostBotanyListRes `json:"list"` +} + +// HostBotanyAddReq 添加操作请求参数 +type HostBotanyAddReq struct { + Id int `p:"id" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + ZhName string `p:"zhName" v:"required#中文学名不能为空" dc:"中文学名"` + ZhSynonym string `p:"zhSynonym" dc:"中文异名"` + EnName string `p:"enName" v:"required#英文学名不能为空" dc:"英文学名"` + LatinName string `p:"latinName" v:"required#拉丁学名不能为空" dc:"拉丁学名"` + LatinSynonym string `p:"latinSynonym" dc:"拉丁异名"` + Mu string `p:"mu" dc:"目"` + OrderTitle string `p:"orderTitle" dc:"Order"` + Ke string `p:"ke" dc:"科"` + Family string `p:"family" dc:"Family"` + Shu string `p:"shu" dc:"属"` + Genus string `p:"genus" dc:"Genus"` + Zhong string `p:"zhong" dc:"种"` + Species string `p:"species" dc:"Species"` + HostType string `p:"hostType" dc:"寄主类型"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// HostBotanyEditReq 修改操作请求参数 +type HostBotanyEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + ZhName string `p:"zhName" v:"required#中文学名不能为空" dc:"中文学名"` + ZhSynonym string `p:"zhSynonym" dc:"中文异名"` + EnName string `p:"enName" v:"required#英文学名不能为空" dc:"英文学名"` + LatinName string `p:"latinName" v:"required#拉丁学名不能为空" dc:"拉丁学名"` + LatinSynonym string `p:"latinSynonym" dc:"拉丁异名"` + Mu string `p:"mu" dc:"目"` + OrderTitle string `p:"orderTitle" dc:"Order"` + Ke string `p:"ke" dc:"科"` + Family string `p:"family" dc:"Family"` + Shu string `p:"shu" dc:"属"` + Genus string `p:"genus" dc:"Genus"` + Zhong string `p:"zhong" dc:"种"` + Species string `p:"species" dc:"Species"` + HostType string `p:"hostType" dc:"寄主类型"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/naturalEnemyInsect.go b/internal/app/businesses/model/naturalEnemyInsect.go new file mode 100644 index 0000000..64d5f51 --- /dev/null +++ b/internal/app/businesses/model/naturalEnemyInsect.go @@ -0,0 +1,197 @@ +// ========================================================================== +// GFast自动生成model操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/model/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// NaturalEnemyInsectInfoRes is the golang structure for table natural_enemy_insect. +type NaturalEnemyInsectInfoRes struct { + gmeta.Meta `orm:"table:natural_enemy_insect"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"物种编码(入侵种)"` // 物种编码(入侵种) + ZhName string `orm:"zh_name" json:"zhName" dc:"中文名称(天敌)"` // 中文名称(天敌) + LatinName string `orm:"latin_name" json:"latinName" dc:"拉丁学名(天敌)"` // 拉丁学名(天敌) + Mu string `orm:"mu" json:"mu" dc:"目"` // 目 + OrderTitle string `orm:"order_title" json:"orderTitle" dc:"Order"` // Order + Ke string `orm:"ke" json:"ke" dc:"科"` // 科 + Family string `orm:"family" json:"family" dc:"Family"` // Family + Shu string `orm:"shu" json:"shu" dc:"属"` // 属 + Genus string `orm:"genus" json:"genus" dc:"Genus"` // Genus + SourceArea string `orm:"source_area" json:"sourceArea" dc:"原产地"` // 原产地 + Source string `orm:"source" json:"source" dc:"来源地"` // 来源地 + StudyPlot string `orm:"study_plot" json:"studyPlot" dc:"释放地/实验地"` // 释放地/实验地 + ExperimentDate *gtime.Time `orm:"experiment_date" json:"experimentDate" dc:"引进时间/实验时间"` // 引进时间/实验时间 + Selectivity string `orm:"selectivity" json:"selectivity" dc:"专一性"` // 专一性 + FeedingHarm string `orm:"feeding_harm" json:"feedingHarm" dc:"取食/危害阶段"` // 取食/危害阶段 + FeedingPart string `orm:"feeding_part" json:"feedingPart" dc:"取食/危害部位"` // 取食/危害部位 + AnswerIndicator string `orm:"answer_indicator" json:"answerIndicator" dc:"响应指标"` // 响应指标 + ReleaseRecord string `orm:"release_record" json:"releaseRecord" dc:"释放记录"` // 释放记录 + IsCreateGroup int `orm:"is_create_group" json:"isCreateGroup" dc:"是否建群"` // 是否建群 + FeedingStage string `orm:"feeding_stage" json:"feedingStage" dc:"取食阶段"` // 取食阶段 + IsTarget int `orm:"is_target" json:"isTarget" dc:"有无非目标影响"` // 有无非目标影响 + FeedingDate *gtime.Time `orm:"feeding_date" json:"feedingDate" dc:"取食时间/活跃时间"` // 取食时间/活跃时间 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type NaturalEnemyInsectListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"物种编码(入侵种)"` + ZhName string `json:"zhName" dc:"中文名称(天敌)"` + LatinName string `json:"latinName" dc:"拉丁学名(天敌)"` + Mu string `json:"mu" dc:"目"` + OrderTitle string `json:"orderTitle" dc:"Order"` + Ke string `json:"ke" dc:"科"` + Family string `json:"family" dc:"Family"` + Shu string `json:"shu" dc:"属"` + Genus string `json:"genus" dc:"Genus"` + SourceArea string `json:"sourceArea" dc:"原产地"` + Source string `json:"source" dc:"来源地"` + StudyPlot string `json:"studyPlot" dc:"释放地/实验地"` + ExperimentDate *gtime.Time `json:"experimentDate" dc:"引进时间/实验时间"` + Selectivity string `json:"selectivity" dc:"专一性"` + FeedingHarm string `json:"feedingHarm" dc:"取食/危害阶段"` + FeedingPart string `json:"feedingPart" dc:"取食/危害部位"` + AnswerIndicator string `json:"answerIndicator" dc:"响应指标"` + ReleaseRecord string `json:"releaseRecord" dc:"释放记录"` + IsCreateGroup int `json:"isCreateGroup" dc:"是否建群"` + FeedingStage string `json:"feedingStage" dc:"取食阶段"` + IsTarget int `json:"isTarget" dc:"有无非目标影响"` + FeedingDate *gtime.Time `json:"feedingDate" dc:"取食时间/活跃时间"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// NaturalEnemyInsectSearchReq 分页请求参数 +type NaturalEnemyInsectSearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"物种编码(入侵种)"` //物种编码(入侵种) + ZhName string `p:"zhName" dc:"中文名称(天敌)"` //中文名称(天敌) + LatinName string `p:"latinName" dc:"拉丁学名(天敌)"` //拉丁学名(天敌) + Mu string `p:"mu" dc:"目"` //目 + OrderTitle string `p:"orderTitle" dc:"Order"` //Order + Ke string `p:"ke" dc:"科"` //科 + Family string `p:"family" dc:"Family"` //Family + Shu string `p:"shu" dc:"属"` //属 + Genus string `p:"genus" dc:"Genus"` //Genus + SourceArea string `p:"sourceArea" dc:"原产地"` //原产地 + Source string `p:"source" dc:"来源地"` //来源地 + StudyPlot string `p:"studyPlot" dc:"释放地/实验地"` //释放地/实验地 + Selectivity string `p:"selectivity" dc:"专一性"` //专一性 + FeedingHarm string `p:"feedingHarm" dc:"取食/危害阶段"` //取食/危害阶段 + FeedingPart string `p:"feedingPart" dc:"取食/危害部位"` //取食/危害部位 + AnswerIndicator string `p:"answerIndicator" dc:"响应指标"` //响应指标 + ReleaseRecord string `p:"releaseRecord" dc:"释放记录"` //释放记录 + FeedingStage string `p:"feedingStage" dc:"取食阶段"` //取食阶段 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" v:"createUser@integer#数据采集人需为整数" dc:"数据采集人"` //数据采集人 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 +} + +// NaturalEnemyInsectSearchRes 列表返回结果 +type NaturalEnemyInsectSearchRes struct { + comModel.ListRes + List []*NaturalEnemyInsectListRes `json:"list"` +} + +// NaturalEnemyInsectAddReq 添加操作请求参数 +type NaturalEnemyInsectAddReq struct { + Id int `p:"id" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码(入侵种)"` + ZhName string `p:"zhName" v:"required#中文名称(天敌)不能为空" dc:"中文名称(天敌)"` + LatinName string `p:"latinName" v:"required#拉丁学名(天敌)不能为空" dc:"拉丁学名(天敌)"` + Mu string `p:"mu" dc:"目"` + OrderTitle string `p:"orderTitle" dc:"Order"` + Ke string `p:"ke" dc:"科"` + Family string `p:"family" dc:"Family"` + Shu string `p:"shu" dc:"属"` + Genus string `p:"genus" dc:"Genus"` + SourceArea string `p:"sourceArea" dc:"原产地"` + Source string `p:"source" dc:"来源地"` + StudyPlot string `p:"studyPlot" dc:"释放地/实验地"` + ExperimentDate *gtime.Time `p:"experimentDate" dc:"引进时间/实验时间"` + Selectivity string `p:"selectivity" dc:"专一性"` + FeedingHarm string `p:"feedingHarm" dc:"取食/危害阶段"` + FeedingPart string `p:"feedingPart" dc:"取食/危害部位"` + AnswerIndicator string `p:"answerIndicator" dc:"响应指标"` + ReleaseRecord string `p:"releaseRecord" dc:"释放记录"` + IsCreateGroup int `p:"isCreateGroup" dc:"是否建群"` + FeedingStage string `p:"feedingStage" dc:"取食阶段"` + IsTarget int `p:"isTarget" dc:"有无非目标影响"` + FeedingDate *gtime.Time `p:"feedingDate" dc:"取食时间/活跃时间"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// NaturalEnemyInsectEditReq 修改操作请求参数 +type NaturalEnemyInsectEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码(入侵种)"` + ZhName string `p:"zhName" v:"required#中文名称(天敌)不能为空" dc:"中文名称(天敌)"` + LatinName string `p:"latinName" v:"required#拉丁学名(天敌)不能为空" dc:"拉丁学名(天敌)"` + Mu string `p:"mu" dc:"目"` + OrderTitle string `p:"orderTitle" dc:"Order"` + Ke string `p:"ke" dc:"科"` + Family string `p:"family" dc:"Family"` + Shu string `p:"shu" dc:"属"` + Genus string `p:"genus" dc:"Genus"` + SourceArea string `p:"sourceArea" dc:"原产地"` + Source string `p:"source" dc:"来源地"` + StudyPlot string `p:"studyPlot" dc:"释放地/实验地"` + ExperimentDate *gtime.Time `p:"experimentDate" dc:"引进时间/实验时间"` + Selectivity string `p:"selectivity" dc:"专一性"` + FeedingHarm string `p:"feedingHarm" dc:"取食/危害阶段"` + FeedingPart string `p:"feedingPart" dc:"取食/危害部位"` + AnswerIndicator string `p:"answerIndicator" dc:"响应指标"` + ReleaseRecord string `p:"releaseRecord" dc:"释放记录"` + IsCreateGroup int `p:"isCreateGroup" dc:"是否建群"` + FeedingStage string `p:"feedingStage" dc:"取食阶段"` + IsTarget int `p:"isTarget" dc:"有无非目标影响"` + FeedingDate *gtime.Time `p:"feedingDate" dc:"取食时间/活跃时间"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/prevention.go b/internal/app/businesses/model/prevention.go new file mode 100644 index 0000000..2215a33 --- /dev/null +++ b/internal/app/businesses/model/prevention.go @@ -0,0 +1,122 @@ +// ========================================================================== +// GFast自动生成model操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/model/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// PreventionInfoRes is the golang structure for table prevention. +type PreventionInfoRes struct { + gmeta.Meta `orm:"table:prevention"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"物种编码"` // 物种编码 + BotanyQuarantine string `orm:"botany_quarantine" json:"botanyQuarantine" dc:"植物检疫"` // 植物检疫 + Physics string `orm:"physics" json:"physics" dc:"物理防治"` // 物理防治 + Chemistry string `orm:"chemistry" json:"chemistry" dc:"化学防治"` // 化学防治 + Biology string `orm:"biology" json:"biology" dc:"生物防治"` // 生物防治 + Other string `orm:"other" json:"other" dc:"其他防控措施"` // 其他防控措施 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type PreventionListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"物种编码"` + BotanyQuarantine string `json:"botanyQuarantine" dc:"植物检疫"` + Physics string `json:"physics" dc:"物理防治"` + Chemistry string `json:"chemistry" dc:"化学防治"` + Biology string `json:"biology" dc:"生物防治"` + Other string `json:"other" dc:"其他防控措施"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// PreventionSearchReq 分页请求参数 +type PreventionSearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"物种编码"` //物种编码 + BotanyQuarantine string `p:"botanyQuarantine" dc:"植物检疫"` //植物检疫 + Physics string `p:"physics" dc:"物理防治"` //物理防治 + Chemistry string `p:"chemistry" dc:"化学防治"` //化学防治 + Biology string `p:"biology" dc:"生物防治"` //生物防治 + Other string `p:"other" dc:"其他防控措施"` //其他防控措施 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" v:"createUser@integer#数据采集人需为整数" dc:"数据采集人"` //数据采集人 + CreateDate []*gtime.Time `p:"createDate" dc:"数据采集日期"` //数据采集日期 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 +} + +// PreventionSearchRes 列表返回结果 +type PreventionSearchRes struct { + comModel.ListRes + List []*PreventionListRes `json:"list"` +} + +// PreventionAddReq 添加操作请求参数 +type PreventionAddReq struct { + Id int `p:"id" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + BotanyQuarantine string `p:"botanyQuarantine" dc:"植物检疫"` + Physics string `p:"physics" dc:"物理防治"` + Chemistry string `p:"chemistry" dc:"化学防治"` + Biology string `p:"biology" dc:"生物防治"` + Other string `p:"other" dc:"其他防控措施"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// PreventionEditReq 修改操作请求参数 +type PreventionEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + BotanyQuarantine string `p:"botanyQuarantine" dc:"植物检疫"` + Physics string `p:"physics" dc:"物理防治"` + Chemistry string `p:"chemistry" dc:"化学防治"` + Biology string `p:"biology" dc:"生物防治"` + Other string `p:"other" dc:"其他防控措施"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/speciesImgs.go b/internal/app/businesses/model/speciesImgs.go new file mode 100644 index 0000000..9172195 --- /dev/null +++ b/internal/app/businesses/model/speciesImgs.go @@ -0,0 +1,106 @@ +// ========================================================================== +// GFast自动生成model操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/model/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// SpeciesImgsInfoRes is the golang structure for table species_imgs. +type SpeciesImgsInfoRes struct { + gmeta.Meta `orm:"table:species_imgs"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"物种编码"` // 物种编码 + Imgs string `orm:"imgs" json:"imgs" dc:"图片"` // 图片 + ImgType string `orm:"img_type" json:"imgType" dc:"图片类型"` // 图片类型 + ImgSource string `orm:"img_source" json:"imgSource" dc:"图片来源"` // 图片来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"图片拍摄/提供人"` // 图片拍摄/提供人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"图片拍摄/提供日期"` // 图片拍摄/提供日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"图片核查人"` // 图片核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"图片核查日期"` // 图片核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:"核查"` // 核查 + AuditView string `orm:"audit_view" json:"auditView" dc:"核查意见"` // 核查意见 + Remark string `orm:"remark" json:"remark" dc:"备注"` // 备注 + Version int `orm:"version" json:"version" dc:"版本"` // 版本 + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // + +} + +type SpeciesImgsListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"物种编码"` + Imgs string `json:"imgs" dc:"图片"` + ImgType string `json:"imgType" dc:"图片类型"` + ImgSource string `json:"imgSource" dc:"图片来源"` + CreateUser int `json:"createUser" dc:"图片拍摄/提供人"` + CreateDate *gtime.Time `json:"createDate" dc:"图片拍摄/提供日期"` + AuditUser int `json:"auditUser" dc:"图片核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"图片核查日期"` + AuditStatus int `json:"auditStatus" dc:"核查"` + AuditView string `json:"auditView" dc:"核查意见"` + Remark string `json:"remark" dc:"备注"` + Version int `json:"version" dc:"版本"` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// SpeciesImgsSearchReq 分页请求参数 +type SpeciesImgsSearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"物种编码"` //物种编码 + ImgType string `p:"imgType" dc:"图片类型"` //图片类型 + ImgSource string `p:"imgSource" dc:"图片来源"` //图片来源 + CreateUser string `p:"createUser" dc:"图片拍摄/提供人"` //图片拍摄/提供人 + CreateDate []*gtime.Time `p:"createDate" dc:"图片拍摄/提供日期"` //图片拍摄/提供日期 + AuditStatus string `p:"auditStatus" v:"auditStatus@integer#核查需为整数" dc:"核查"` //核查 +} + +// SpeciesImgsSearchRes 列表返回结果 +type SpeciesImgsSearchRes struct { + comModel.ListRes + List []*SpeciesImgsListRes `json:"list"` +} + +// SpeciesImgsAddReq 添加操作请求参数 +type SpeciesImgsAddReq struct { + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + Imgs string `p:"imgs" dc:"图片"` + ImgType string `p:"imgType" dc:"图片类型"` + ImgSource string `p:"imgSource" dc:"图片来源"` + CreateUser int `p:"createUser" dc:"图片拍摄/提供人"` + CreateDate *gtime.Time `p:"createDate" dc:"图片拍摄/提供日期"` + //AuditUser int `p:"auditUser" dc:"图片核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"图片核查日期"` + AuditStatus int `p:"auditStatus" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + //Version int `p:"version" dc:"版本"` +} + +// SpeciesImgsEditReq 修改操作请求参数 +type SpeciesImgsEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"物种编码"` + Imgs string `p:"imgs" dc:"图片"` + ImgType string `p:"imgType" dc:"图片类型"` + ImgSource string `p:"imgSource" dc:"图片来源"` + CreateUser int `p:"createUser" dc:"图片拍摄/提供人"` + CreateDate *gtime.Time `p:"createDate" dc:"图片拍摄/提供日期"` + //AuditUser int `p:"auditUser" dc:"图片核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"图片核查日期"` + AuditStatus int `p:"auditStatus" v:"required#核查不能为空" dc:"核查"` + //AuditView string `p:"auditView" dc:"核查意见"` + Remark string `p:"remark" dc:"备注"` + Version int `p:"version" dc:"版本"` +} diff --git a/internal/app/businesses/model/speciesSurvey.go b/internal/app/businesses/model/speciesSurvey.go new file mode 100644 index 0000000..b47ed42 --- /dev/null +++ b/internal/app/businesses/model/speciesSurvey.go @@ -0,0 +1,193 @@ +package model + +import ( + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gmeta" + comModel "github.com/tiger1103/gfast/v3/internal/app/common/model" +) + +// SpeciesSurveyInfoRes is the golang structure for table species_survey. +type SpeciesSurveyInfoRes struct { + gmeta.Meta `orm:"table:species_survey"` + Id int `orm:"id,primary" json:"id" dc:""` // + SpeciesCode string `orm:"species_code" json:"speciesCode" dc:"调查记录编码"` // 调查记录编码 + Province string `orm:"province" json:"province" dc:"省(自治区、直辖市)"` // 省(自治区、直辖市) + City string `orm:"city" json:"city" dc:"市(地、州、盟)"` // 市(地、州、盟) + County string `orm:"county" json:"county" dc:"县(区、市、旗)"` // 县(区、市、旗) + Code string `orm:"code" json:"code" dc:"区划代码"` // 区划代码 + CourseName string `orm:"course_name" json:"courseName" dc:"踏查路线名称"` // 踏查路线名称 + MarkArea string `orm:"mark_area" json:"markArea" dc:"踏查总面积(平方千米)"` // 踏查总面积(平方千米) + MarkName string `orm:"mark_name" json:"markName" dc:"踏查点名称"` // 踏查点名称 + Longitude string `orm:"longitude" json:"longitude" dc:"经度"` // 经度 + Dimensionality string `orm:"dimensionality" json:"dimensionality" dc:"纬度"` // 纬度 + Elevation string `orm:"elevation" json:"elevation" dc:"海拔"` // 海拔 + Temperature string `orm:"temperature" json:"temperature" dc:"温度"` // 温度 + Precipitation string `orm:"precipitation" json:"precipitation" dc:"降水"` // 降水 + MarkAreaM string `orm:"mark_area_m" json:"markAreaM" dc:"踏查点面积(亩)"` // 踏查点面积(亩) + HabitatType string `orm:"habitat_type" json:"habitatType" dc:"生境类型"` // 生境类型 + SoilType string `orm:"soil_type" json:"soilType" dc:"土壤类型"` // 土壤类型 + SpeciesName string `orm:"species_name" json:"speciesName" dc:"物种名称"` // 物种名称 + HarmObject string `orm:"harm_object" json:"harmObject" dc:"危害对象"` // 危害对象 + HappenArea string `orm:"happen_area" json:"happenArea" dc:"发生面积(亩)"` // 发生面积(亩) + Treatment string `orm:"treatment" json:"treatment" dc:"治理措施(有 无)"` // 治理措施(有 无) + IsStandard int `orm:"is_standard" json:"isStandard" dc:"是否设置标准样地"` // 是否设置标准样地 + StandardCode string `orm:"standard_code" json:"standardCode" dc:"标准样地编号"` // 标准样地编号 + IsSpecimen int `orm:"is_specimen" json:"isSpecimen" dc:"是否采集标本"` // 是否采集标本 + SpecimenCode string `orm:"specimen_code" json:"specimenCode" dc:"标本编号"` // 标本编号 + Img string `orm:"img" json:"img" dc:"图片"` // 图片 + SourcesData string `orm:"sources_data" json:"sourcesData" dc:"数据来源"` // 数据来源 + CreateUser int `orm:"create_user" json:"createUser" dc:"数据采集人"` // 数据采集人 + CreateDate *gtime.Time `orm:"create_date" json:"createDate" dc:"数据采集日期"` // 数据采集日期 + AuditUser int `orm:"audit_user" json:"auditUser" dc:"数据核查人"` // 数据核查人 + AuditDate *gtime.Time `orm:"audit_date" json:"auditDate" dc:"数据核查日期"` // 数据核查日期 + AuditStatus int `orm:"audit_status" json:"auditStatus" dc:""` // + AuditView string `orm:"audit_view" json:"auditView" dc:""` // + Remark string `orm:"remark" json:"remark" dc:""` // + Version int `orm:"version" json:"version" dc:""` // + CreatedAt *gtime.Time `orm:"created_at" json:"createdAt" dc:""` // + UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt" dc:""` // + DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt" dc:""` // +} + +type SpeciesSurveyListRes struct { + Id int `json:"id" dc:""` + SpeciesCode string `json:"speciesCode" dc:"调查记录编码"` + Province string `json:"province" dc:"省(自治区、直辖市)"` + City string `json:"city" dc:"市(地、州、盟)"` + County string `json:"county" dc:"县(区、市、旗)"` + Code string `json:"code" dc:"区划代码"` + CourseName string `json:"courseName" dc:"踏查路线名称"` + MarkArea string `json:"markArea" dc:"踏查总面积(平方千米)"` + MarkName string `json:"markName" dc:"踏查点名称"` + Longitude string `json:"longitude" dc:"经度"` + Dimensionality string `json:"dimensionality" dc:"纬度"` + Elevation string `json:"elevation" dc:"海拔"` + Temperature string `json:"temperature" dc:"温度"` + Precipitation string `json:"precipitation" dc:"降水"` + MarkAreaM string `json:"markAreaM" dc:"踏查点面积(亩)"` + HabitatType string `json:"habitatType" dc:"生境类型"` + SoilType string `json:"soilType" dc:"土壤类型"` + SpeciesName string `json:"speciesName" dc:"物种名称"` + HarmObject string `json:"harmObject" dc:"危害对象"` + HappenArea string `json:"happenArea" dc:"发生面积(亩)"` + Treatment string `json:"treatment" dc:"治理措施(有 无)"` + IsStandard int `json:"isStandard" dc:"是否设置标准样地"` + StandardCode string `json:"standardCode" dc:"标准样地编号"` + IsSpecimen int `json:"isSpecimen" dc:"是否采集标本"` + SpecimenCode string `json:"specimenCode" dc:"标本编号"` + Img string `json:"img" dc:"图片"` + SourcesData string `json:"sourcesData" dc:"数据来源"` + CreateUser int `json:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `json:"createDate" dc:"数据采集日期"` + AuditUser int `json:"auditUser" dc:"数据核查人"` + AuditDate *gtime.Time `json:"auditDate" dc:"数据核查日期"` + AuditStatus int `json:"auditStatus" dc:""` + AuditView string `json:"auditView" dc:""` + Remark string `json:"remark" dc:""` + Version int `json:"version" dc:""` + CreatedAt *gtime.Time `json:"createdAt" dc:""` +} + +// SpeciesSurveySearchReq 分页请求参数 +type SpeciesSurveySearchReq struct { + comModel.PageReq + Id string `p:"id" dc:""` // + SpeciesCode string `p:"speciesCode" dc:"调查记录编码"` //调查记录编码 + Province string `p:"province" dc:"省(自治区、直辖市)"` //省(自治区、直辖市) + City string `p:"city" dc:"市(地、州、盟)"` //市(地、州、盟) + County string `p:"county" dc:"县(区、市、旗)"` //县(区、市、旗) + Code string `p:"code" dc:"区划代码"` //区划代码 + CourseName string `p:"courseName" dc:"踏查路线名称"` //踏查路线名称 + MarkName string `p:"markName" dc:"踏查点名称"` //踏查点名称 + HabitatType string `p:"habitatType" dc:"生境类型"` //生境类型 + SoilType string `p:"soilType" dc:"土壤类型"` //土壤类型 + SpeciesName string `p:"speciesName" dc:"物种名称"` //物种名称 + HarmObject string `p:"harmObject" dc:"危害对象"` //危害对象 + StandardCode string `p:"standardCode" dc:"标准样地编号"` //标准样地编号 + SpecimenCode string `p:"specimenCode" dc:"标本编号"` //标本编号 + SourcesData string `p:"sourcesData" dc:"数据来源"` //数据来源 + CreateUser string `p:"createUser" dc:"数据采集人"` //数据采集人 +} + +// SpeciesSurveySearchRes 列表返回结果 +type SpeciesSurveySearchRes struct { + comModel.ListRes + List []*SpeciesSurveyListRes `json:"list"` +} + +// SpeciesSurveyAddReq 添加操作请求参数 +type SpeciesSurveyAddReq struct { + SpeciesCode string `p:"speciesCode" dc:"调查记录编码"` + Province string `p:"province" dc:"省(自治区、直辖市)"` + City string `p:"city" dc:"市(地、州、盟)"` + County string `p:"county" dc:"县(区、市、旗)"` + Code string `p:"code" dc:"区划代码"` + CourseName string `p:"courseName" v:"required#踏查路线名称不能为空" dc:"踏查路线名称"` + MarkArea string `p:"markArea" dc:"踏查总面积(平方千米)"` + MarkName string `p:"markName" v:"required#踏查点名称不能为空" dc:"踏查点名称"` + Longitude string `p:"longitude" dc:"经度"` + Dimensionality string `p:"dimensionality" dc:"纬度"` + Elevation string `p:"elevation" dc:"海拔"` + Temperature string `p:"temperature" dc:"温度"` + Precipitation string `p:"precipitation" dc:"降水"` + MarkAreaM string `p:"markAreaM" dc:"踏查点面积(亩)"` + HabitatType string `p:"habitatType" dc:"生境类型"` + SoilType string `p:"soilType" dc:"土壤类型"` + SpeciesName string `p:"speciesName" v:"required#物种名称不能为空" dc:"物种名称"` + HarmObject string `p:"harmObject" dc:"危害对象"` + HappenArea string `p:"happenArea" dc:"发生面积(亩)"` + Treatment string `p:"treatment" dc:"治理措施(有 无)"` + IsStandard int `p:"isStandard" dc:"是否设置标准样地"` + StandardCode string `p:"standardCode" dc:"标准样地编号"` + IsSpecimen int `p:"isSpecimen" dc:"是否采集标本"` + SpecimenCode string `p:"specimenCode" dc:"标本编号"` + Img string `p:"img" dc:"图片"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" dc:""` + //AuditView string `p:"auditView" dc:""` + Remark string `p:"remark" dc:""` + //Version int `p:"version" dc:""` +} + +// SpeciesSurveyEditReq 修改操作请求参数 +type SpeciesSurveyEditReq struct { + Id int `p:"id" v:"required#主键ID不能为空" dc:""` + SpeciesCode string `p:"speciesCode" dc:"调查记录编码"` + Province string `p:"province" dc:"省(自治区、直辖市)"` + City string `p:"city" dc:"市(地、州、盟)"` + County string `p:"county" dc:"县(区、市、旗)"` + Code string `p:"code" dc:"区划代码"` + CourseName string `p:"courseName" v:"required#踏查路线名称不能为空" dc:"踏查路线名称"` + MarkArea string `p:"markArea" dc:"踏查总面积(平方千米)"` + MarkName string `p:"markName" v:"required#踏查点名称不能为空" dc:"踏查点名称"` + Longitude string `p:"longitude" dc:"经度"` + Dimensionality string `p:"dimensionality" dc:"纬度"` + Elevation string `p:"elevation" dc:"海拔"` + Temperature string `p:"temperature" dc:"温度"` + Precipitation string `p:"precipitation" dc:"降水"` + MarkAreaM string `p:"markAreaM" dc:"踏查点面积(亩)"` + HabitatType string `p:"habitatType" dc:"生境类型"` + SoilType string `p:"soilType" dc:"土壤类型"` + SpeciesName string `p:"speciesName" v:"required#物种名称不能为空" dc:"物种名称"` + HarmObject string `p:"harmObject" dc:"危害对象"` + HappenArea string `p:"happenArea" dc:"发生面积(亩)"` + Treatment string `p:"treatment" dc:"治理措施(有 无)"` + IsStandard int `p:"isStandard" dc:"是否设置标准样地"` + StandardCode string `p:"standardCode" dc:"标准样地编号"` + IsSpecimen int `p:"isSpecimen" dc:"是否采集标本"` + SpecimenCode string `p:"specimenCode" dc:"标本编号"` + Img string `p:"img" dc:"图片"` + SourcesData string `p:"sourcesData" dc:"数据来源"` + CreateUser int `p:"createUser" dc:"数据采集人"` + CreateDate *gtime.Time `p:"createDate" dc:"数据采集日期"` + //AuditUser int `p:"auditUser" dc:"数据核查人"` + //AuditDate *gtime.Time `p:"auditDate" dc:"数据核查日期"` + AuditStatus int `p:"auditStatus" v:"required#不能为空" dc:""` + //AuditView string `p:"auditView" dc:""` + Remark string `p:"remark" dc:""` + Version int `p:"version" dc:""` +} diff --git a/internal/app/businesses/router/biocontrolResource.go b/internal/app/businesses/router/biocontrolResource.go new file mode 100644 index 0000000..029eadc --- /dev/null +++ b/internal/app/businesses/router/biocontrolResource.go @@ -0,0 +1,25 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/router/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindBiocontrolResourceController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/biocontrolResource", func(group *ghttp.RouterGroup) { + group.Bind( + controller.BiocontrolResource, + ) + }) +} diff --git a/internal/app/businesses/router/biologyEcology.go b/internal/app/businesses/router/biologyEcology.go new file mode 100644 index 0000000..90013ce --- /dev/null +++ b/internal/app/businesses/router/biologyEcology.go @@ -0,0 +1,24 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/router/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindBiologyEcologyController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/biologyEcology", func(group *ghttp.RouterGroup) { + group.Bind( + controller.BiologyEcology, + ) + }) +} diff --git a/internal/app/businesses/router/definiteness.go b/internal/app/businesses/router/definiteness.go new file mode 100644 index 0000000..e1a5e93 --- /dev/null +++ b/internal/app/businesses/router/definiteness.go @@ -0,0 +1,25 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/router/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindDefinitenessController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/definiteness", func(group *ghttp.RouterGroup) { + group.Bind( + controller.Definiteness, + ) + }) +} diff --git a/internal/app/businesses/router/hostBotany.go b/internal/app/businesses/router/hostBotany.go new file mode 100644 index 0000000..aa8a0cf --- /dev/null +++ b/internal/app/businesses/router/hostBotany.go @@ -0,0 +1,25 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/router/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindHostBotanyController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/hostBotany", func(group *ghttp.RouterGroup) { + group.Bind( + controller.HostBotany, + ) + }) +} diff --git a/internal/app/businesses/router/naturalEnemyInsect.go b/internal/app/businesses/router/naturalEnemyInsect.go new file mode 100644 index 0000000..50e6265 --- /dev/null +++ b/internal/app/businesses/router/naturalEnemyInsect.go @@ -0,0 +1,25 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/router/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindNaturalEnemyInsectController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/naturalEnemyInsect", func(group *ghttp.RouterGroup) { + group.Bind( + controller.NaturalEnemyInsect, + ) + }) +} diff --git a/internal/app/businesses/router/prevention.go b/internal/app/businesses/router/prevention.go new file mode 100644 index 0000000..5ab8860 --- /dev/null +++ b/internal/app/businesses/router/prevention.go @@ -0,0 +1,25 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/router/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindPreventionController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/prevention", func(group *ghttp.RouterGroup) { + group.Bind( + controller.Prevention, + ) + }) +} diff --git a/internal/app/businesses/router/speciesImgs.go b/internal/app/businesses/router/speciesImgs.go new file mode 100644 index 0000000..35dc92b --- /dev/null +++ b/internal/app/businesses/router/speciesImgs.go @@ -0,0 +1,25 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/router/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindSpeciesImgsController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/speciesImgs", func(group *ghttp.RouterGroup) { + group.Bind( + controller.SpeciesImgs, + ) + }) +} diff --git a/internal/app/businesses/router/speciesSurvey.go b/internal/app/businesses/router/speciesSurvey.go new file mode 100644 index 0000000..066635a --- /dev/null +++ b/internal/app/businesses/router/speciesSurvey.go @@ -0,0 +1,24 @@ +// ========================================================================== +// GFast自动生成router操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/router/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package router + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/tiger1103/gfast/v3/internal/app/businesses/controller" +) + +func (router *Router) BindSpeciesSurveyController(ctx context.Context, group *ghttp.RouterGroup) { + group.Group("/speciesSurvey", func(group *ghttp.RouterGroup) { + group.Bind( + controller.SpeciesSurvey, + ) + }) +} diff --git a/internal/app/businesses/service/biocontrolResource.go b/internal/app/businesses/service/biocontrolResource.go new file mode 100644 index 0000000..0a9d10d --- /dev/null +++ b/internal/app/businesses/service/biocontrolResource.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 09:44:41 +// 生成路径: internal/app/businesses/service/biocontrol_resource.go +// 生成人:gfast +// desc:生防资源 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type IBiocontrolResource interface { + List(ctx context.Context, req *model.BiocontrolResourceSearchReq) (res *model.BiocontrolResourceSearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.BiocontrolResourceInfoRes, err error) + Add(ctx context.Context, req *model.BiocontrolResourceAddReq) (err error) + Edit(ctx context.Context, req *model.BiocontrolResourceEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localBiocontrolResource IBiocontrolResource + +func BiocontrolResource() IBiocontrolResource { + if localBiocontrolResource == nil { + panic("implement not found for interface IBiocontrolResource, forgot register?") + } + return localBiocontrolResource +} + +func RegisterBiocontrolResource(i IBiocontrolResource) { + localBiocontrolResource = i +} diff --git a/internal/app/businesses/service/biologyEcology.go b/internal/app/businesses/service/biologyEcology.go new file mode 100644 index 0000000..91ba7e4 --- /dev/null +++ b/internal/app/businesses/service/biologyEcology.go @@ -0,0 +1,36 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 16:38:01 +// 生成路径: internal/app/businesses/service/biology_ecology.go +// 生成人:gfast +// desc:基本生物学与生态学 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type IBiologyEcology interface { + List(ctx context.Context, req *model.BiologyEcologySearchReq) (res *model.BiologyEcologySearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.BiologyEcologyInfoRes, err error) + Add(ctx context.Context, req *model.BiologyEcologyAddReq) (err error) + Edit(ctx context.Context, req *model.BiologyEcologyEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localBiologyEcology IBiologyEcology + +func BiologyEcology() IBiologyEcology { + if localBiologyEcology == nil { + panic("implement not found for interface IBiologyEcology, forgot register?") + } + return localBiologyEcology +} + +func RegisterBiologyEcology(i IBiologyEcology) { + localBiologyEcology = i +} diff --git a/internal/app/businesses/service/definiteness.go b/internal/app/businesses/service/definiteness.go new file mode 100644 index 0000000..010657a --- /dev/null +++ b/internal/app/businesses/service/definiteness.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 09:52:43 +// 生成路径: internal/app/businesses/service/definiteness.go +// 生成人:gfast +// desc:限定性情况 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type IDefiniteness interface { + List(ctx context.Context, req *model.DefinitenessSearchReq) (res *model.DefinitenessSearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.DefinitenessInfoRes, err error) + Add(ctx context.Context, req *model.DefinitenessAddReq) (err error) + Edit(ctx context.Context, req *model.DefinitenessEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localDefiniteness IDefiniteness + +func Definiteness() IDefiniteness { + if localDefiniteness == nil { + panic("implement not found for interface IDefiniteness, forgot register?") + } + return localDefiniteness +} + +func RegisterDefiniteness(i IDefiniteness) { + localDefiniteness = i +} diff --git a/internal/app/businesses/service/hostBotany.go b/internal/app/businesses/service/hostBotany.go new file mode 100644 index 0000000..49ee428 --- /dev/null +++ b/internal/app/businesses/service/hostBotany.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 09:34:44 +// 生成路径: internal/app/businesses/service/host_botany.go +// 生成人:gfast +// desc:寄主生物 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type IHostBotany interface { + List(ctx context.Context, req *model.HostBotanySearchReq) (res *model.HostBotanySearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.HostBotanyInfoRes, err error) + Add(ctx context.Context, req *model.HostBotanyAddReq) (err error) + Edit(ctx context.Context, req *model.HostBotanyEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localHostBotany IHostBotany + +func HostBotany() IHostBotany { + if localHostBotany == nil { + panic("implement not found for interface IHostBotany, forgot register?") + } + return localHostBotany +} + +func RegisterHostBotany(i IHostBotany) { + localHostBotany = i +} diff --git a/internal/app/businesses/service/naturalEnemyInsect.go b/internal/app/businesses/service/naturalEnemyInsect.go new file mode 100644 index 0000000..c1e4b02 --- /dev/null +++ b/internal/app/businesses/service/naturalEnemyInsect.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 10:08:28 +// 生成路径: internal/app/businesses/service/natural_enemy_insect.go +// 生成人:gfast +// desc:天敌昆虫 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type INaturalEnemyInsect interface { + List(ctx context.Context, req *model.NaturalEnemyInsectSearchReq) (res *model.NaturalEnemyInsectSearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.NaturalEnemyInsectInfoRes, err error) + Add(ctx context.Context, req *model.NaturalEnemyInsectAddReq) (err error) + Edit(ctx context.Context, req *model.NaturalEnemyInsectEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localNaturalEnemyInsect INaturalEnemyInsect + +func NaturalEnemyInsect() INaturalEnemyInsect { + if localNaturalEnemyInsect == nil { + panic("implement not found for interface INaturalEnemyInsect, forgot register?") + } + return localNaturalEnemyInsect +} + +func RegisterNaturalEnemyInsect(i INaturalEnemyInsect) { + localNaturalEnemyInsect = i +} diff --git a/internal/app/businesses/service/prevention.go b/internal/app/businesses/service/prevention.go new file mode 100644 index 0000000..7af8308 --- /dev/null +++ b/internal/app/businesses/service/prevention.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 10:15:42 +// 生成路径: internal/app/businesses/service/prevention.go +// 生成人:gfast +// desc:防控措施 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type IPrevention interface { + List(ctx context.Context, req *model.PreventionSearchReq) (res *model.PreventionSearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.PreventionInfoRes, err error) + Add(ctx context.Context, req *model.PreventionAddReq) (err error) + Edit(ctx context.Context, req *model.PreventionEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localPrevention IPrevention + +func Prevention() IPrevention { + if localPrevention == nil { + panic("implement not found for interface IPrevention, forgot register?") + } + return localPrevention +} + +func RegisterPrevention(i IPrevention) { + localPrevention = i +} diff --git a/internal/app/businesses/service/speciesImgs.go b/internal/app/businesses/service/speciesImgs.go new file mode 100644 index 0000000..61ea03a --- /dev/null +++ b/internal/app/businesses/service/speciesImgs.go @@ -0,0 +1,37 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 16:49:09 +// 生成路径: internal/app/businesses/service/species_imgs.go +// 生成人:gfast +// desc: +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type ISpeciesImgs interface { + List(ctx context.Context, req *model.SpeciesImgsSearchReq) (res *model.SpeciesImgsSearchRes, err error) + GetByInt(ctx context.Context, Int int) (res *model.SpeciesImgsInfoRes, err error) + Add(ctx context.Context, req *model.SpeciesImgsAddReq) (err error) + Edit(ctx context.Context, req *model.SpeciesImgsEditReq) (err error) + Delete(ctx context.Context, Int []int) (err error) +} + +var localSpeciesImgs ISpeciesImgs + +func SpeciesImgs() ISpeciesImgs { + if localSpeciesImgs == nil { + panic("implement not found for interface ISpeciesImgs, forgot register?") + } + return localSpeciesImgs +} + +func RegisterSpeciesImgs(i ISpeciesImgs) { + localSpeciesImgs = i +} diff --git a/internal/app/businesses/service/speciesSurvey.go b/internal/app/businesses/service/speciesSurvey.go new file mode 100644 index 0000000..a2c097d --- /dev/null +++ b/internal/app/businesses/service/speciesSurvey.go @@ -0,0 +1,36 @@ +// ========================================================================== +// GFast自动生成service操作代码。 +// 生成日期:2025-08-11 17:00:45 +// 生成路径: internal/app/businesses/service/species_survey.go +// 生成人:gfast +// desc:物种调查 +// company:云南奇讯科技有限公司 +// ========================================================================== + +package service + +import ( + "context" + "github.com/tiger1103/gfast/v3/internal/app/businesses/model" +) + +type ISpeciesSurvey interface { + List(ctx context.Context, req *model.SpeciesSurveySearchReq) (res *model.SpeciesSurveySearchRes, err error) + GetById(ctx context.Context, Id int) (res *model.SpeciesSurveyInfoRes, err error) + Add(ctx context.Context, req *model.SpeciesSurveyAddReq) (err error) + Edit(ctx context.Context, req *model.SpeciesSurveyEditReq) (err error) + Delete(ctx context.Context, Id []int) (err error) +} + +var localSpeciesSurvey ISpeciesSurvey + +func SpeciesSurvey() ISpeciesSurvey { + if localSpeciesSurvey == nil { + panic("implement not found for interface ISpeciesSurvey, forgot register?") + } + return localSpeciesSurvey +} + +func RegisterSpeciesSurvey(i ISpeciesSurvey) { + localSpeciesSurvey = i +} diff --git a/main.go b/main.go index d15b9a4..1f578e5 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,7 @@ package main import ( - "fmt" _ "github.com/gogf/gf/contrib/drivers/pgsql/v2" - "github.com/gogf/gf/v2/frame/g" - //_ "github.com/gogf/gf/contrib/drivers/sqlite/v2" _ "github.com/gogf/gf/contrib/drivers/mysql/v2" _ "github.com/gogf/gf/contrib/nosql/redis/v2" @@ -18,7 +15,6 @@ import ( func main() { cmd.Main.Run(gctx.New()) - fmt.Println(g.Server().GetRoutes()) /*// 数据库文件路径 dbPath := "zky.db" // 打开数据库连接