Browse Source

2022/7/30 9:47

v1_dev_p
erdanergou 3 years ago
parent
commit
e6008eb037
  1. 71
      .history/api/version1/honoraryArchives/operate_photo_20220730075728.go
  2. 71
      .history/api/version1/honoraryArchives/operate_photo_20220730080540.go
  3. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730080546.go
  4. 71
      .history/api/version1/honoraryArchives/operate_photo_20220730080550.go
  5. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730081213.go
  6. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730081323.go
  7. 73
      .history/api/version1/honoraryArchives/operate_photo_20220730081335.go
  8. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730081338.go
  9. 71
      .history/api/version1/honoraryArchives/operate_photo_20220730081813.go
  10. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082047.go
  11. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082049.go
  12. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082051.go
  13. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082053.go
  14. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082054.go
  15. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082058.go
  16. 72
      .history/api/version1/honoraryArchives/operate_photo_20220730082100.go
  17. 73
      .history/api/version1/honoraryArchives/operate_photo_20220730082103.go
  18. 73
      .history/api/version1/honoraryArchives/operate_photo_20220730082230.go
  19. 73
      .history/api/version1/honoraryArchives/operate_photo_20220730082232.go
  20. 74
      .history/api/version1/honoraryArchives/operate_photo_20220730082237.go
  21. 74
      .history/api/version1/honoraryArchives/operate_photo_20220730082243.go
  22. 74
      .history/api/version1/honoraryArchives/operate_photo_20220730082245.go
  23. 74
      .history/api/version1/honoraryArchives/operate_photo_20220730082246.go
  24. 74
      .history/api/version1/honoraryArchives/operate_photo_20220730082248.go
  25. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082255.go
  26. 74
      .history/api/version1/honoraryArchives/operate_photo_20220730082256.go
  27. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082300.go
  28. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082305.go
  29. 76
      .history/api/version1/honoraryArchives/operate_photo_20220730082306.go
  30. 76
      .history/api/version1/honoraryArchives/operate_photo_20220730082313.go
  31. 76
      .history/api/version1/honoraryArchives/operate_photo_20220730082316.go
  32. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082326.go
  33. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082408.go
  34. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082415.go
  35. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082422.go
  36. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082423.go
  37. 75
      .history/api/version1/honoraryArchives/operate_photo_20220730082612.go
  38. 80
      .history/api/version1/honoraryArchives/operate_photo_20220730082623.go
  39. 81
      .history/api/version1/honoraryArchives/operate_photo_20220730082631.go
  40. 81
      .history/api/version1/honoraryArchives/operate_photo_20220730082636.go
  41. 81
      .history/api/version1/honoraryArchives/operate_photo_20220730082639.go
  42. 83
      .history/api/version1/honoraryArchives/operate_photo_20220730082656.go
  43. 84
      .history/api/version1/honoraryArchives/operate_photo_20220730082706.go
  44. 84
      .history/api/version1/honoraryArchives/operate_photo_20220730082715.go
  45. 84
      .history/api/version1/honoraryArchives/operate_photo_20220730082716.go
  46. 84
      .history/api/version1/honoraryArchives/operate_photo_20220730082719.go
  47. 84
      .history/api/version1/honoraryArchives/operate_photo_20220730082720.go
  48. 84
      .history/api/version1/honoraryArchives/operate_photo_20220730082723.go
  49. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082733.go
  50. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730082736.go
  51. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082741.go
  52. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082744.go
  53. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082751.go
  54. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082753.go
  55. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082811.go
  56. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730082817.go
  57. 93
      .history/api/version1/honoraryArchives/operate_photo_20220730082821.go
  58. 86
      .history/api/version1/honoraryArchives/operate_photo_20220730083119.go
  59. 86
      .history/api/version1/honoraryArchives/operate_photo_20220730083120.go
  60. 93
      .history/api/version1/honoraryArchives/operate_photo_20220730083124.go
  61. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730083128.go
  62. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730083131.go
  63. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730083144.go
  64. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730083152.go
  65. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730083155.go
  66. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730083204.go
  67. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730083209.go
  68. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730083210.go
  69. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730083315.go
  70. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730083318.go
  71. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730083347.go
  72. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084015.go
  73. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084018.go
  74. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084028.go
  75. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084040.go
  76. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084042.go
  77. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084046.go
  78. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084048.go
  79. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084049.go
  80. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084051.go
  81. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084103.go
  82. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084124.go
  83. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084153.go
  84. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084308.go
  85. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084310.go
  86. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084349.go
  87. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084357.go
  88. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084359.go
  89. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084407.go
  90. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084413.go
  91. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084423.go
  92. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084431.go
  93. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084447.go
  94. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084451.go
  95. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084457.go
  96. 88
      .history/api/version1/honoraryArchives/operate_photo_20220730084632.go
  97. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730084636.go
  98. 89
      .history/api/version1/honoraryArchives/operate_photo_20220730084640.go
  99. 90
      .history/api/version1/honoraryArchives/operate_photo_20220730084647.go
  100. 90
      .history/api/version1/honoraryArchives/operate_photo_20220730084653.go

71
.history/api/version1/honoraryArchives/operate_photo_20220730075728.go

@ -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) {
}

71
.history/api/version1/honoraryArchives/operate_photo_20220730080540.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730080546.go

@ -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) {
}

71
.history/api/version1/honoraryArchives/operate_photo_20220730080550.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730081213.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730081323.go

@ -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) {
}

73
.history/api/version1/honoraryArchives/operate_photo_20220730081335.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730081338.go

@ -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) {
}

71
.history/api/version1/honoraryArchives/operate_photo_20220730081813.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082047.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082049.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082051.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082053.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082054.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082058.go

@ -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) {
}

72
.history/api/version1/honoraryArchives/operate_photo_20220730082100.go

@ -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) {
}

73
.history/api/version1/honoraryArchives/operate_photo_20220730082103.go

@ -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) {
}

73
.history/api/version1/honoraryArchives/operate_photo_20220730082230.go

@ -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) {
}

73
.history/api/version1/honoraryArchives/operate_photo_20220730082232.go

@ -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) {
}

74
.history/api/version1/honoraryArchives/operate_photo_20220730082237.go

@ -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) {
}

74
.history/api/version1/honoraryArchives/operate_photo_20220730082243.go

@ -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) {
}

74
.history/api/version1/honoraryArchives/operate_photo_20220730082245.go

@ -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) {
}

74
.history/api/version1/honoraryArchives/operate_photo_20220730082246.go

@ -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) {
}

74
.history/api/version1/honoraryArchives/operate_photo_20220730082248.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082255.go

@ -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) {
}

74
.history/api/version1/honoraryArchives/operate_photo_20220730082256.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082300.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082305.go

@ -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) {
}

76
.history/api/version1/honoraryArchives/operate_photo_20220730082306.go

@ -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) {
}

76
.history/api/version1/honoraryArchives/operate_photo_20220730082313.go

@ -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) {
}

76
.history/api/version1/honoraryArchives/operate_photo_20220730082316.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082326.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082408.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082415.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082422.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082423.go

@ -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) {
}

75
.history/api/version1/honoraryArchives/operate_photo_20220730082612.go

@ -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) {
}

80
.history/api/version1/honoraryArchives/operate_photo_20220730082623.go

@ -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
}
}

81
.history/api/version1/honoraryArchives/operate_photo_20220730082631.go

@ -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
}
}

81
.history/api/version1/honoraryArchives/operate_photo_20220730082636.go

@ -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
}

81
.history/api/version1/honoraryArchives/operate_photo_20220730082639.go

@ -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
}
}

83
.history/api/version1/honoraryArchives/operate_photo_20220730082656.go

@ -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
}

84
.history/api/version1/honoraryArchives/operate_photo_20220730082706.go

@ -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
}

84
.history/api/version1/honoraryArchives/operate_photo_20220730082715.go

@ -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.
}

84
.history/api/version1/honoraryArchives/operate_photo_20220730082716.go

@ -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
}

84
.history/api/version1/honoraryArchives/operate_photo_20220730082719.go

@ -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)
}

84
.history/api/version1/honoraryArchives/operate_photo_20220730082720.go

@ -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)
}

84
.history/api/version1/honoraryArchives/operate_photo_20220730082723.go

@ -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)
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082733.go

@ -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
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730082736.go

@ -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
}
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082741.go

@ -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
}
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082744.go

@ -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
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082751.go

@ -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
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082753.go

@ -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)
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082811.go

@ -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)
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730082817.go

@ -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)
}

93
.history/api/version1/honoraryArchives/operate_photo_20220730082821.go

@ -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
}
}

86
.history/api/version1/honoraryArchives/operate_photo_20220730083119.go

@ -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
}
}

86
.history/api/version1/honoraryArchives/operate_photo_20220730083120.go

@ -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
}
}

93
.history/api/version1/honoraryArchives/operate_photo_20220730083124.go

@ -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
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730083128.go

@ -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
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730083131.go

@ -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
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730083144.go

@ -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
}
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730083152.go

@ -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
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730083155.go

@ -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()
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730083204.go

@ -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,)
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730083209.go

@ -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,)
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730083210.go

@ -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)
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730083315.go

@ -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)
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730083318.go

@ -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)
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730083347.go

@ -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)
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084015.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084018.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084028.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084040.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084042.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084046.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084048.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084049.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084051.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084103.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084124.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084153.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084308.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084310.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084349.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084357.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084359.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084407.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084413.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084423.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084431.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084447.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084451.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084457.go

@ -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)
}
}

88
.history/api/version1/honoraryArchives/operate_photo_20220730084632.go

@ -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)
// }
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730084636.go

@ -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)
// }
}

89
.history/api/version1/honoraryArchives/operate_photo_20220730084640.go

@ -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)
// }
}

90
.history/api/version1/honoraryArchives/operate_photo_20220730084647.go

@ -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)
// }
}

90
.history/api/version1/honoraryArchives/operate_photo_20220730084653.go

@ -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…
Cancel
Save