diff --git a/api/version1/honoraryArchives/operate_photo.go b/api/version1/honoraryArchives/operate_photo.go new file mode 100644 index 0000000..37b8741 --- /dev/null +++ b/api/version1/honoraryArchives/operate_photo.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models/modelshonory" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []modelshonory.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&modelshonory.PhotosGallery{}).Where("state = ?", 1) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} diff --git a/api/version1/honoraryArchives/type.go b/api/version1/honoraryArchives/type.go index e91463c..fac940f 100644 --- a/api/version1/honoraryArchives/type.go +++ b/api/version1/honoraryArchives/type.go @@ -8,14 +8,14 @@ import ( type ApiMethod struct{} -//荣誉档案入口 +// 荣誉档案入口 func (a *ApiMethod) Index(c *gin.Context) { outputCont := publicmethod.MapOut[string]() outputCont["index"] = "荣誉档案入口" publicmethod.Result(0, outputCont, c) } -//荣誉列表查询字段 +// 荣誉列表查询字段 type honorListKey struct { publicmethod.PagesTurn Name string `json:"name"` //名称 @@ -27,7 +27,7 @@ type honorListKey struct { UserKey string `json:"userkey"` //人员Key } -//添加荣誉 +// 添加荣誉 type addHonorCont struct { addCarrierCont IssuingAgency string `json:"issuingagency"` //发放单位 @@ -40,25 +40,32 @@ type addHonorCont struct { ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 } -//编辑荣誉 +// 编辑荣誉 type eidtHonorCont struct { publicmethod.PublicId addHonorCont } -//载体类型查询字段 +// 载体类型查询字段 type carrierListKey struct { publicmethod.PagesTurn addCarrierCont } -//添加载体类型 +// 添加载体类型 type addCarrierCont struct { Name string `json:"name"` //名称 } -//编辑载体类型 +// 编辑载体类型 type eidyCarrierCont struct { publicmethod.PublicId addCarrierCont } + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publicmethod.PagesTurn +}