338 changed files with 29067 additions and 47 deletions
@ -0,0 +1,71 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
|
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(eq) |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(reque) |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(requestData) |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(requestData,) |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(requestData.im) |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0{} |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0{ |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImage models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
|
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage model |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage models. |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 |
|||
//状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
var newImage models.PhotosGallery |
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
|
|||
for _, value := range requestData.ImgUrl { |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
|
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
|
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
|
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, ) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
|
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImage...) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList...) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var |
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
|
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId. |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId.g |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId.GetCont(where) |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId.GetCont(where) |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
pho |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
photoGalleryByAscriptionId.del |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
photoGalleryByAscriptionId.DelCont(where) |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
err = photoGalleryByAscriptionId.DelCont(where) |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
err = photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
err = photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
err = photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
err = photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err = photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.re |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result() |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0,) |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0,requestData,) |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
|
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, requestData, c) |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, requestData, c) |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, requestData, c) |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(108, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, requestData, c) |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if delErr == nil { |
|||
overallhandle.Result(0, saveData, c) |
|||
} else { |
|||
overallhandle.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
overallhandle.Result(0, saveData, c) |
|||
} else { |
|||
overallhandle.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, saveData, c) |
|||
} else { |
|||
overallhandle.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, req, c) |
|||
} else { |
|||
overallhandle.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, requestData, c) |
|||
} else { |
|||
overallhandle.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, requestData, c) |
|||
} else { |
|||
publi.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, requestData, c) |
|||
} else { |
|||
publicmethod.Result(108, delErr, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, requestData, c) |
|||
} else { |
|||
publicmethod.Result(108, re, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, requestData, c) |
|||
} else { |
|||
publicmethod.Result(108, requestData, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, requestData, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
photoUrl := photoGalleryByAscriptionId.Url |
|||
// publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, err, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, error.Error(), c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, error.Error(""), c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, error.Error(""), c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, error.Error("图片不能为空"), c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, error.Error(), c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.DelCont(where) |
|||
if err == nil { |
|||
publicmethod.Result(0, err, c) |
|||
} else { |
|||
publicmethod.Result(108, err, c) |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
// err := photoGalleryByAscriptionId.DelCont(where)
|
|||
// if err == nil {
|
|||
// publicmethod.Result(0, err, c)
|
|||
// } else {
|
|||
// publicmethod.Result(108, err, c)
|
|||
// }
|
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
|
|||
// err := photoGalleryByAscriptionId.DelCont(where)
|
|||
// if err == nil {
|
|||
// publicmethod.Result(0, err, c)
|
|||
// } else {
|
|||
// publicmethod.Result(108, err, c)
|
|||
// }
|
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId.GetCont() |
|||
// err := photoGalleryByAscriptionId.DelCont(where)
|
|||
// if err == nil {
|
|||
// publicmethod.Result(0, err, c)
|
|||
// } else {
|
|||
// publicmethod.Result(108, err, c)
|
|||
// }
|
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId.GetCont(where) |
|||
|
|||
// err := photoGalleryByAscriptionId.DelCont(where)
|
|||
// if err == nil {
|
|||
// publicmethod.Result(0, err, c)
|
|||
// } else {
|
|||
// publicmethod.Result(108, err, c)
|
|||
// }
|
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
package honoraryArchives |
|||
|
|||
import ( |
|||
"key_performance_indicators/models" |
|||
"key_performance_indicators/overall/publicmethod" |
|||
"strconv" |
|||
"time" |
|||
|
|||
"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 models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
err := photoGalleryByAscriptionId.GetCont(where) // 根据归属id获取图片
|
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
|
|||
publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回
|
|||
// photoUrl := photoGalleryByAscriptionId.Url
|
|||
// publicmethod.Result(0, photoUrl, c) // 将查询结果返回
|
|||
} |
|||
|
|||
// 编辑图片
|
|||
func (a *ApiMethod) EditImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
where := publicmethod.MapOut[string]() |
|||
where["id"] = requestData.Id |
|||
// 原始图片信息
|
|||
var oldImage models.PhotosGallery |
|||
err := oldImage.GetCont(where) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
ascriptionId, _ := strconv.ParseInt(requestData.Id, 10, 64) // 将id转为int64类型
|
|||
var newImageList []models.PhotosGallery |
|||
if len(requestData.ImgUrl) > 0 { |
|||
for _, value := range requestData.ImgUrl { |
|||
var newImage models.PhotosGallery |
|||
newImage.Url = value.Url //图片地址"`
|
|||
newImage.ImgPath = value.Imgpath //物理地址"`
|
|||
newImage.Name = value.Name //文档名称"`
|
|||
newImage.FileSize = value.FileSize //文档大小"`
|
|||
newImage.Time = time.Now().Unix() //创建时间"`
|
|||
newImage.AscriptionId = ascriptionId //归属"`
|
|||
newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"`
|
|||
newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"`
|
|||
newImageList = append(newImageList, newImage) |
|||
} |
|||
} |
|||
oldImage.EiteCont(where, newImageList) |
|||
|
|||
} |
|||
|
|||
// 删除图片
|
|||
func (a *ApiMethod) DelImage(c *gin.Context) { |
|||
var requestData photoKey //声明荣誉图片字段
|
|||
c.ShouldBindJSON(&requestData) //进行Json绑定
|
|||
if requestData.Id == "" || len(requestData.ImgUrl) == 0 { |
|||
publicmethod.Result(101, requestData, c) |
|||
return |
|||
} |
|||
var photoGalleryByAscriptionId models.PhotosGallery |
|||
where := publicmethod.MapOut[string]() |
|||
where["ascriptionid"] = requestData.Id |
|||
photoGalleryByAscriptionId.GetCont(where) |
|||
|
|||
// err := photoGalleryByAscriptionId.DelCont(where)
|
|||
// if err == nil {
|
|||
// publicmethod.Result(0, err, c)
|
|||
// } else {
|
|||
// publicmethod.Result(108, err, c)
|
|||
// }
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue