diff --git a/.history/README_20220727153717.md b/.history/README_20220727153717.md new file mode 100644 index 0000000..17e180e --- /dev/null +++ b/.history/README_20220727153717.md @@ -0,0 +1,56 @@ +# KPI综合管理系统 + + +```Project +|—— api + └── version1 + └── empower +|—— apirouter +|—— initialization + └── database + └── nosql + └── app + └── route +|identification +|—— config + └── configDatabase + └── configNosql + └── configAapp + └── configJson +|—— models +|—— overall +|—— middleware +``` +## Hr 文件结构说明 + +| 文件夹 | 说明 | 描述| +|--------- |------ |-----| +| `api` | api相关业务 | api业务实现 | +| `--version1` | 业务版本文件夹 | 版本界定 | +| `--empower` |OAuth 2.0 授权 |授权Token| +| `apirouter` | 路由器 | 业务路由设定 | +| `initialization` | 初始化相关业务 | 系统初始化方面的实现 | +| `--database` | 数据库业务 | 数据库业务初始化实现 | +| `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) | +| `--app` | app数据库业务 | app业务初始化实现 | +| `--route` | 路由初始化 | 路由初始化 | +| `identification` | 授权验证器 | 授权验证器 | +| `config` | 系统配置相关业务 | 系统系统配置方面的实现 | +| `--configDatabase` | 数据库业务 | 数据库业务系统配置实现 | +| `--configNosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) | +| `--configAapp` | app系统业务 | app业务系统配置实现 | +| `--configJson` | app JSON业务 | app业务系统配置实现 | +| `models` | 数据模型 | 数据库方面的配置 | +| `overall` | 全局对象 | 全局对象| +| `middleware` | 中间件 | 中间件 | + + +## 加密规则 +``` + 1、分解步骤 + one = md5(CodeString)+md5(AppKey) + two = md5(one)+AppKey + therr = md5(two) + 2、合并 + md5(md5(md5(CodeString)+md5(AppKey))+AppKey) +``` \ No newline at end of file diff --git a/.history/README_20220727153956.md b/.history/README_20220727153956.md new file mode 100644 index 0000000..0891571 --- /dev/null +++ b/.history/README_20220727153956.md @@ -0,0 +1,59 @@ +# KPI综合管理系统 + + +```Project +|—— api + └── version1 + └── empower +|—— apirouter +|—— initialization + └── database + └── nosql + └── app + └── route +|identification +|—— config + └── configDatabase + └── configNosql + └── configAapp + └── configJson +|—— models +|—— overall +|—— middleware +``` +## Hr 文件结构说明 + +| 文件夹 | 说明 | 描述| +|--------- |------ |-----| +| `api` | api相关业务 | api业务实现 | +| `--version1` | 业务版本文件夹 | 版本界定 | +| `--empower` |OAuth 2.0 授权 |授权Token| +| `apirouter` | 路由器 | 业务路由设定 | +| `initialization` | 初始化相关业务 | 系统初始化方面的实现 | +| `--database` | 数据库业务 | 数据库业务初始化实现 | +| `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) | +| `--app` | app数据库业务 | app业务初始化实现 | +| `--route` | 路由初始化 | 路由初始化 | +| `identification` | 授权验证器 | 授权验证器 | +| `config` | 系统配置相关业务 | 系统系统配置方面的实现 | +| `--configDatabase` | 数据库业务 | 数据库业务系统配置实现 | +| `--configNosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) | +| `--configAapp` | app系统业务 | app业务系统配置实现 | +| `--configJson` | app JSON业务 | app业务系统配置实现 | +| `models` | 数据模型 | 数据库方面的配置 | +| `overall` | 全局对象 | 全局对象| +| `middleware` | 中间件 | 中间件 | + + +## 加密规则 +``` + 1、分解步骤 + one = md5(CodeString)+md5(AppKey) + two = md5(one)+AppKey + therr = md5(two) + 2、合并 + md5(md5(md5(CodeString)+md5(AppKey))+AppKey) +``` + + +123 \ No newline at end of file diff --git a/.history/README_20220728075530.md b/.history/README_20220728075530.md new file mode 100644 index 0000000..df391cf --- /dev/null +++ b/.history/README_20220728075530.md @@ -0,0 +1,57 @@ +# KPI综合管理系统 + + +```Project +|—— api + └── version1 + └── empower +|—— apirouter +|—— initialization + └── database + └── nosql + └── app + └── route +|identification +|—— config + └── configDatabase + └── configNosql + └── configAapp + └── configJson +|—— models +|—— overall +|—— middleware +``` +## Hr 文件结构说明 + +| 文件夹 | 说明 | 描述| +|--------- |------ |-----| +| `api` | api相关业务 | api业务实现 | +| `--version1` | 业务版本文件夹 | 版本界定 | +| `--empower` |OAuth 2.0 授权 |授权Token| +| `apirouter` | 路由器 | 业务路由设定 | +| `initialization` | 初始化相关业务 | 系统初始化方面的实现 | +| `--database` | 数据库业务 | 数据库业务初始化实现 | +| `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) | +| `--app` | app数据库业务 | app业务初始化实现 | +| `--route` | 路由初始化 | 路由初始化 | +| `identification` | 授权验证器 | 授权验证器 | +| `config` | 系统配置相关业务 | 系统系统配置方面的实现 | +| `--configDatabase` | 数据库业务 | 数据库业务系统配置实现 | +| `--configNosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) | +| `--configAapp` | app系统业务 | app业务系统配置实现 | +| `--configJson` | app JSON业务 | app业务系统配置实现 | +| `models` | 数据模型 | 数据库方面的配置 | +| `overall` | 全局对象 | 全局对象| +| `middleware` | 中间件 | 中间件 | + + +## 加密规则 +``` + 1、分解步骤 + one = md5(CodeString)+md5(AppKey) + two = md5(one)+AppKey + therr = md5(two) + 2、合并 + md5(md5(md5(CodeString)+md5(AppKey))+AppKey) +``` + diff --git a/.history/api/base/loginVerify/login_20220727153717.go b/.history/api/base/loginVerify/login_20220727153717.go new file mode 100644 index 0000000..beb16d3 --- /dev/null +++ b/.history/api/base/loginVerify/login_20220727153717.go @@ -0,0 +1,187 @@ +package loginVerify + +import ( + "fmt" + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) ScanCodeLogin(c *gin.Context) { + var requestData Login + c.ShouldBindJSON(&requestData) + + if requestData.Username == "" { + publicmethod.Result(1, requestData, c, "请输入用户名!") + return + } + if requestData.Password == "" { + publicmethod.Result(1, requestData, c, "请输入密码!") + return + } + if requestData.Captcha == "" { + publicmethod.Result(1, requestData, c, "请输入验证码!") + return + } + + // if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true { + // publicmethod.Result(1, requestData, c, "验证码不正确!") + // return + // } + + userAgent := c.Request.Header.Get("User-Agent") + // userAgent = "250" + + var md5JiaMiPwd publicmethod.Md5Encryption + md5JiaMiPwd.Md5EncryptionInit(requestData.Password) + md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm() + // var oldAdmin OldSchollAdmin + // oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error + // if oldErr == nil { + // //原知行学院管理员账号登录 + // } + //新的登录认证方式 + var userCont models.ManCont + userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd}) + if userErr != nil { + publicmethod.Result(2000, userErr, c) + return + } + if requestData.OpenId != "" { + var userInfo models.PersonArchives + userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId}) + } + if userCont.State == 2 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!") + return + } + if userCont.State == 3 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!") + return + } + + var md5JiaMi publicmethod.Md5Encryption + md5JiaMi.Md5EncryptionInit(userAgent) + md5Token := md5JiaMi.Md5EncryptionAlgorithm() + + var md5JiaMiNumber publicmethod.Md5Encryption + md5JiaMiNumber.Md5EncryptionInit(userCont.Number) + userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm() + + sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token + sha1Token := publicmethod.Sha1Encryption(sha1Str) + + //返回值 + saveData := publicmethod.MapOut[string]() + saveData["key"] = userKeyCode + saveData["token"] = sha1Token + saveData["userinfo"] = userCont + menuoper, jurisdiction := getRoleSeat(userCont.Role) + writeRedisData := map[string]interface{}{ + "userkey": userKeyCode, + "key": userCont.Key, + "usernumber": userCont.Number, + "userpwd": userCont.Password, + "usertoken": sha1Token, + "jurisdiction": jurisdiction, + "menuOper": menuoper, + "wand": 118, + } + //API Token数据 + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + //缓存写入个人信息 + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number) + myCont := publicmethod.MapOut[string]() + myCont["id"] = userCont.Id + myCont["number"] = userCont.Number //员工工号 + myCont["name"] = userCont.Name //姓名 + myCont["icon"] = userCont.Icon //头像 + myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) + myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + myCont["company"] = userCont.Company //入职公司 + myCont["maindeparment"] = userCont.MainDeparment //主部门 + myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门 + myCont["deparment"] = userCont.Deparment //部门 + myCont["admin_org"] = userCont.AdminOrg //所属行政组织 + myCont["teamid"] = userCont.TeamId //班组 + myCont["position"] = userCont.Position //职位 + myCont["job_class"] = userCont.JobClass //职务分类 + myCont["job_id"] = userCont.JobId //职务 + myCont["job_leve"] = userCont.JobLeve //职务等级 + myCont["wechat"] = userCont.Wechat //微信UserId + myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId + myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除) + myCont["key"] = userCont.Key //key + myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管 + myCont["password"] = userCont.Password //密码 + myCont["role"] = userCont.Role //角色 + myCont["idcardno"] = userCont.Idcardno //身份证号 + myCont["passportno"] = userCont.Passportno //护照号码 + myCont["globalroaming"] = userCont.Globalroaming //国际区号 + myCont["mobilephone"] = userCont.Mobilephone //手机号码 + myCont["email"] = userCont.Email //电子邮件 + myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性) + myCont["birthday"] = userCont.Birthday //birthday + myCont["myfolk"] = userCont.Myfolk //民族 + myCont["nativeplace"] = userCont.Nativeplace //籍贯 + myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始 + myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束 + myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址 + myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关 + myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废) + myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异) + myCont["internaltelephone"] = userCont.Internaltelephone //内线电话 + myCont["currentresidence"] = userCont.Currentresidence //现居住地址 + myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座) + myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否) + myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否) + myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号 + myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期 + myCont["entrydate"] = userCont.Entrydate //入职日期 + myCont["probationperiod"] = userCont.Probationperiod //试用期 + myCont["planformaldate"] = userCont.Planformaldate //预计转正日期 + myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员) + redisClient.HashMsetAdd(redisMyContKey, myCont) + publicmethod.Result(0, saveData, c) +} + +//获取权限点位 +func getRoleSeat(roleId string) (menuStr, buttonStr string) { + var roleInfo models.SystemRole + err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction") + if err != nil { + return + } + menuStr = roleInfo.MenuOper + buttonStr = roleInfo.Jurisdiction + return +} + +//退出登录 +func (a *ApiMethod) SignOut(c *gin.Context) { + userKey := c.Request.Header.Get("user-key") + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + userToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + // fmt.Printf("userToken----->%v\n", userToken) + _, err := publicmethod.GetUserRedisCont(userToken["usernumber"]) + if err != nil { + redisClient.DelKey(redisFileKey) + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + redisClient.DelKey(redisFileKey) + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"]) + redisClient.DelKey(redisMyContKey) + publicmethod.Result(0, isTrue, c, "退出成功!") +} diff --git a/.history/api/base/loginVerify/login_20220729082636.go b/.history/api/base/loginVerify/login_20220729082636.go new file mode 100644 index 0000000..077a1d0 --- /dev/null +++ b/.history/api/base/loginVerify/login_20220729082636.go @@ -0,0 +1,187 @@ +package loginVerify + +import ( + "fmt" + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) ScanCodeLogin(c *gin.Context) { + var requestData Login + c.ShouldBindJSON(&requestData) + + if requestData.Username == "" { + publicmethod.Result(1, requestData, c, "请输入用户名!") + return + } + if requestData.Password == "" { + publicmethod.Result(1, requestData, c, "请输入密码!") + return + } + if requestData.Captcha == "" { + publicmethod.Result(1, requestData, c, "请输入验证码!") + return + } + + // if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true { + // publicmethod.Result(1, requestData, c, "验证码不正确!") + // return + // } + + userAgent := c.Request.Header.Get("User-Agent") // + // userAgent = "250" + + var md5JiaMiPwd publicmethod.Md5Encryption + md5JiaMiPwd.Md5EncryptionInit(requestData.Password) + md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm() + // var oldAdmin OldSchollAdmin + // oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error + // if oldErr == nil { + // //原知行学院管理员账号登录 + // } + //新的登录认证方式 + var userCont models.ManCont + userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd}) + if userErr != nil { + publicmethod.Result(2000, userErr, c) + return + } + if requestData.OpenId != "" { + var userInfo models.PersonArchives + userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId}) + } + if userCont.State == 2 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!") + return + } + if userCont.State == 3 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!") + return + } + + var md5JiaMi publicmethod.Md5Encryption + md5JiaMi.Md5EncryptionInit(userAgent) + md5Token := md5JiaMi.Md5EncryptionAlgorithm() + + var md5JiaMiNumber publicmethod.Md5Encryption + md5JiaMiNumber.Md5EncryptionInit(userCont.Number) + userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm() + + sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token + sha1Token := publicmethod.Sha1Encryption(sha1Str) + + //返回值 + saveData := publicmethod.MapOut[string]() + saveData["key"] = userKeyCode + saveData["token"] = sha1Token + saveData["userinfo"] = userCont + menuoper, jurisdiction := getRoleSeat(userCont.Role) + writeRedisData := map[string]interface{}{ + "userkey": userKeyCode, + "key": userCont.Key, + "usernumber": userCont.Number, + "userpwd": userCont.Password, + "usertoken": sha1Token, + "jurisdiction": jurisdiction, + "menuOper": menuoper, + "wand": 118, + } + //API Token数据 + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + //缓存写入个人信息 + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number) + myCont := publicmethod.MapOut[string]() + myCont["id"] = userCont.Id + myCont["number"] = userCont.Number //员工工号 + myCont["name"] = userCont.Name //姓名 + myCont["icon"] = userCont.Icon //头像 + myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) + myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + myCont["company"] = userCont.Company //入职公司 + myCont["maindeparment"] = userCont.MainDeparment //主部门 + myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门 + myCont["deparment"] = userCont.Deparment //部门 + myCont["admin_org"] = userCont.AdminOrg //所属行政组织 + myCont["teamid"] = userCont.TeamId //班组 + myCont["position"] = userCont.Position //职位 + myCont["job_class"] = userCont.JobClass //职务分类 + myCont["job_id"] = userCont.JobId //职务 + myCont["job_leve"] = userCont.JobLeve //职务等级 + myCont["wechat"] = userCont.Wechat //微信UserId + myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId + myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除) + myCont["key"] = userCont.Key //key + myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管 + myCont["password"] = userCont.Password //密码 + myCont["role"] = userCont.Role //角色 + myCont["idcardno"] = userCont.Idcardno //身份证号 + myCont["passportno"] = userCont.Passportno //护照号码 + myCont["globalroaming"] = userCont.Globalroaming //国际区号 + myCont["mobilephone"] = userCont.Mobilephone //手机号码 + myCont["email"] = userCont.Email //电子邮件 + myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性) + myCont["birthday"] = userCont.Birthday //birthday + myCont["myfolk"] = userCont.Myfolk //民族 + myCont["nativeplace"] = userCont.Nativeplace //籍贯 + myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始 + myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束 + myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址 + myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关 + myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废) + myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异) + myCont["internaltelephone"] = userCont.Internaltelephone //内线电话 + myCont["currentresidence"] = userCont.Currentresidence //现居住地址 + myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座) + myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否) + myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否) + myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号 + myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期 + myCont["entrydate"] = userCont.Entrydate //入职日期 + myCont["probationperiod"] = userCont.Probationperiod //试用期 + myCont["planformaldate"] = userCont.Planformaldate //预计转正日期 + myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员) + redisClient.HashMsetAdd(redisMyContKey, myCont) + publicmethod.Result(0, saveData, c) +} + +//获取权限点位 +func getRoleSeat(roleId string) (menuStr, buttonStr string) { + var roleInfo models.SystemRole + err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction") + if err != nil { + return + } + menuStr = roleInfo.MenuOper + buttonStr = roleInfo.Jurisdiction + return +} + +//退出登录 +func (a *ApiMethod) SignOut(c *gin.Context) { + userKey := c.Request.Header.Get("user-key") + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + userToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + // fmt.Printf("userToken----->%v\n", userToken) + _, err := publicmethod.GetUserRedisCont(userToken["usernumber"]) + if err != nil { + redisClient.DelKey(redisFileKey) + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + redisClient.DelKey(redisFileKey) + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"]) + redisClient.DelKey(redisMyContKey) + publicmethod.Result(0, isTrue, c, "退出成功!") +} diff --git a/.history/api/base/loginVerify/login_20220729082639.go b/.history/api/base/loginVerify/login_20220729082639.go new file mode 100644 index 0000000..17f8e07 --- /dev/null +++ b/.history/api/base/loginVerify/login_20220729082639.go @@ -0,0 +1,187 @@ +package loginVerify + +import ( + "fmt" + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) ScanCodeLogin(c *gin.Context) { + var requestData Login + c.ShouldBindJSON(&requestData) + + if requestData.Username == "" { + publicmethod.Result(1, requestData, c, "请输入用户名!") + return + } + if requestData.Password == "" { + publicmethod.Result(1, requestData, c, "请输入密码!") + return + } + if requestData.Captcha == "" { + publicmethod.Result(1, requestData, c, "请输入验证码!") + return + } + + // if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true { + // publicmethod.Result(1, requestData, c, "验证码不正确!") + // return + // } + + userAgent := c.Request.Header.Get("User-Agent") // 获取用户代理 + // userAgent = "250" + + var md5JiaMiPwd publicmethod.Md5Encryption + md5JiaMiPwd.Md5EncryptionInit(requestData.Password) + md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm() + // var oldAdmin OldSchollAdmin + // oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error + // if oldErr == nil { + // //原知行学院管理员账号登录 + // } + //新的登录认证方式 + var userCont models.ManCont + userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd}) + if userErr != nil { + publicmethod.Result(2000, userErr, c) + return + } + if requestData.OpenId != "" { + var userInfo models.PersonArchives + userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId}) + } + if userCont.State == 2 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!") + return + } + if userCont.State == 3 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!") + return + } + + var md5JiaMi publicmethod.Md5Encryption + md5JiaMi.Md5EncryptionInit(userAgent) + md5Token := md5JiaMi.Md5EncryptionAlgorithm() + + var md5JiaMiNumber publicmethod.Md5Encryption + md5JiaMiNumber.Md5EncryptionInit(userCont.Number) + userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm() + + sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token + sha1Token := publicmethod.Sha1Encryption(sha1Str) + + //返回值 + saveData := publicmethod.MapOut[string]() + saveData["key"] = userKeyCode + saveData["token"] = sha1Token + saveData["userinfo"] = userCont + menuoper, jurisdiction := getRoleSeat(userCont.Role) + writeRedisData := map[string]interface{}{ + "userkey": userKeyCode, + "key": userCont.Key, + "usernumber": userCont.Number, + "userpwd": userCont.Password, + "usertoken": sha1Token, + "jurisdiction": jurisdiction, + "menuOper": menuoper, + "wand": 118, + } + //API Token数据 + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + //缓存写入个人信息 + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number) + myCont := publicmethod.MapOut[string]() + myCont["id"] = userCont.Id + myCont["number"] = userCont.Number //员工工号 + myCont["name"] = userCont.Name //姓名 + myCont["icon"] = userCont.Icon //头像 + myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) + myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + myCont["company"] = userCont.Company //入职公司 + myCont["maindeparment"] = userCont.MainDeparment //主部门 + myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门 + myCont["deparment"] = userCont.Deparment //部门 + myCont["admin_org"] = userCont.AdminOrg //所属行政组织 + myCont["teamid"] = userCont.TeamId //班组 + myCont["position"] = userCont.Position //职位 + myCont["job_class"] = userCont.JobClass //职务分类 + myCont["job_id"] = userCont.JobId //职务 + myCont["job_leve"] = userCont.JobLeve //职务等级 + myCont["wechat"] = userCont.Wechat //微信UserId + myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId + myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除) + myCont["key"] = userCont.Key //key + myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管 + myCont["password"] = userCont.Password //密码 + myCont["role"] = userCont.Role //角色 + myCont["idcardno"] = userCont.Idcardno //身份证号 + myCont["passportno"] = userCont.Passportno //护照号码 + myCont["globalroaming"] = userCont.Globalroaming //国际区号 + myCont["mobilephone"] = userCont.Mobilephone //手机号码 + myCont["email"] = userCont.Email //电子邮件 + myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性) + myCont["birthday"] = userCont.Birthday //birthday + myCont["myfolk"] = userCont.Myfolk //民族 + myCont["nativeplace"] = userCont.Nativeplace //籍贯 + myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始 + myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束 + myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址 + myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关 + myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废) + myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异) + myCont["internaltelephone"] = userCont.Internaltelephone //内线电话 + myCont["currentresidence"] = userCont.Currentresidence //现居住地址 + myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座) + myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否) + myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否) + myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号 + myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期 + myCont["entrydate"] = userCont.Entrydate //入职日期 + myCont["probationperiod"] = userCont.Probationperiod //试用期 + myCont["planformaldate"] = userCont.Planformaldate //预计转正日期 + myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员) + redisClient.HashMsetAdd(redisMyContKey, myCont) + publicmethod.Result(0, saveData, c) +} + +//获取权限点位 +func getRoleSeat(roleId string) (menuStr, buttonStr string) { + var roleInfo models.SystemRole + err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction") + if err != nil { + return + } + menuStr = roleInfo.MenuOper + buttonStr = roleInfo.Jurisdiction + return +} + +//退出登录 +func (a *ApiMethod) SignOut(c *gin.Context) { + userKey := c.Request.Header.Get("user-key") + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + userToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + // fmt.Printf("userToken----->%v\n", userToken) + _, err := publicmethod.GetUserRedisCont(userToken["usernumber"]) + if err != nil { + redisClient.DelKey(redisFileKey) + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + redisClient.DelKey(redisFileKey) + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"]) + redisClient.DelKey(redisMyContKey) + publicmethod.Result(0, isTrue, c, "退出成功!") +} diff --git a/.history/api/base/loginVerify/login_20220729082930.go b/.history/api/base/loginVerify/login_20220729082930.go new file mode 100644 index 0000000..7a72e9d --- /dev/null +++ b/.history/api/base/loginVerify/login_20220729082930.go @@ -0,0 +1,188 @@ +package loginVerify + +import ( + "fmt" + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) ScanCodeLogin(c *gin.Context) { + var requestData Login + c.ShouldBindJSON(&requestData) + + if requestData.Username == "" { + publicmethod.Result(1, requestData, c, "请输入用户名!") + return + } + if requestData.Password == "" { + publicmethod.Result(1, requestData, c, "请输入密码!") + return + } + if requestData.Captcha == "" { + publicmethod.Result(1, requestData, c, "请输入验证码!") + return + } + + // if store.Verify(requestData.CaptchaId, requestData.Captcha, true) != true { + // publicmethod.Result(1, requestData, c, "验证码不正确!") + // return + // } + + userAgent := c.Request.Header.Get("User-Agent") // 获取用户代理 + // userAgent = "250" + + var md5JiaMiPwd publicmethod.Md5Encryption + md5JiaMiPwd.Md5EncryptionInit(requestData.Password) + md5TokenPwd := md5JiaMiPwd.Md5EncryptionAlgorithm() + // var oldAdmin OldSchollAdmin + // oldErr := overall.CONSTANT_DB_Master.Model(&models.SystemUser{}).Select("system_user.*,system_user_attribute.*").Joins("left join system_user_attribute on system_user.u_key = system_user_attribute.ua_id").Where("`u_name` = ? AND `u_password` = ?", requestData.Username, md5TokenPwd).First(&oldAdmin).Error + // if oldErr == nil { + // //原知行学院管理员账号登录 + // } + + //新的登录认证方式 + var userCont models.ManCont + userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd}) + if userErr != nil { + publicmethod.Result(2000, userErr, c) + return + } + if requestData.OpenId != "" { + var userInfo models.PersonArchives + userInfo.EiteCont(map[string]interface{}{"id": userCont.Id}, map[string]interface{}{"work_wechat": requestData.OpenId}) + } + if userCont.State == 2 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号已经被禁用!") + return + } + if userCont.State == 3 { + publicmethod.Result(1, userErr, c, "登陆失败! 该账号不存在!") + return + } + + var md5JiaMi publicmethod.Md5Encryption + md5JiaMi.Md5EncryptionInit(userAgent) + md5Token := md5JiaMi.Md5EncryptionAlgorithm() + + var md5JiaMiNumber publicmethod.Md5Encryption + md5JiaMiNumber.Md5EncryptionInit(userCont.Number) + userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm() + + sha1Str := userKeyCode + userCont.Number + userCont.Password + md5Token + sha1Token := publicmethod.Sha1Encryption(sha1Str) + + //返回值 + saveData := publicmethod.MapOut[string]() + saveData["key"] = userKeyCode + saveData["token"] = sha1Token + saveData["userinfo"] = userCont + menuoper, jurisdiction := getRoleSeat(userCont.Role) + writeRedisData := map[string]interface{}{ + "userkey": userKeyCode, + "key": userCont.Key, + "usernumber": userCont.Number, + "userpwd": userCont.Password, + "usertoken": sha1Token, + "jurisdiction": jurisdiction, + "menuOper": menuoper, + "wand": 118, + } + //API Token数据 + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKeyCode) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + //缓存写入个人信息 + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number) + myCont := publicmethod.MapOut[string]() + myCont["id"] = userCont.Id + myCont["number"] = userCont.Number //员工工号 + myCont["name"] = userCont.Name //姓名 + myCont["icon"] = userCont.Icon //头像 + myCont["hire_class"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) + myCont["emp_type"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + myCont["company"] = userCont.Company //入职公司 + myCont["maindeparment"] = userCont.MainDeparment //主部门 + myCont["sun_main_department"] = userCont.SunMainDeparment //二级主部门 + myCont["deparment"] = userCont.Deparment //部门 + myCont["admin_org"] = userCont.AdminOrg //所属行政组织 + myCont["teamid"] = userCont.TeamId //班组 + myCont["position"] = userCont.Position //职位 + myCont["job_class"] = userCont.JobClass //职务分类 + myCont["job_id"] = userCont.JobId //职务 + myCont["job_leve"] = userCont.JobLeve //职务等级 + myCont["wechat"] = userCont.Wechat //微信UserId + myCont["work_wechat"] = userCont.WorkWechat //企业微信UserId + myCont["state"] = userCont.State //状态(1:启用;2:禁用;3:删除) + myCont["key"] = userCont.Key //key + myCont["is_admin"] = userCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管 + myCont["password"] = userCont.Password //密码 + myCont["role"] = userCont.Role //角色 + myCont["idcardno"] = userCont.Idcardno //身份证号 + myCont["passportno"] = userCont.Passportno //护照号码 + myCont["globalroaming"] = userCont.Globalroaming //国际区号 + myCont["mobilephone"] = userCont.Mobilephone //手机号码 + myCont["email"] = userCont.Email //电子邮件 + myCont["gender"] = userCont.Gender //性别(1:男性;2:女性;3:中性) + myCont["birthday"] = userCont.Birthday //birthday + myCont["myfolk"] = userCont.Myfolk //民族 + myCont["nativeplace"] = userCont.Nativeplace //籍贯 + myCont["idcardstartdate"] = userCont.Idcardstartdate //身份证有效期开始 + myCont["idcardenddate"] = userCont.Idcardenddate //身份证有效期结束 + myCont["idcardaddress"] = userCont.Idcardaddress //身份证地址 + myCont["idcardIssued"] = userCont.IdcardIssued //身份证签发机关 + myCont["health"] = userCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废) + myCont["maritalstatus"] = userCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异) + myCont["internaltelephone"] = userCont.Internaltelephone //内线电话 + myCont["currentresidence"] = userCont.Currentresidence //现居住地址 + myCont["constellationing"] = userCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座) + myCont["isdoubleworker"] = userCont.Isdoubleworker //是否双职工(1:是;2:否) + myCont["isveterans"] = userCont.Isveterans //是否为退役军人(1:是;2:否) + myCont["veteransnumber"] = userCont.Veteransnumber //退役证编号 + myCont["jobstartdate"] = userCont.Jobstartdate //参加工作日期 + myCont["entrydate"] = userCont.Entrydate //入职日期 + myCont["probationperiod"] = userCont.Probationperiod //试用期 + myCont["planformaldate"] = userCont.Planformaldate //预计转正日期 + myCont["political_outlook"] = userCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员) + redisClient.HashMsetAdd(redisMyContKey, myCont) + publicmethod.Result(0, saveData, c) +} + +//获取权限点位 +func getRoleSeat(roleId string) (menuStr, buttonStr string) { + var roleInfo models.SystemRole + err := roleInfo.GetCont(map[string]interface{}{"r_id": roleId}, "r_menu_oper", "r_jurisdiction") + if err != nil { + return + } + menuStr = roleInfo.MenuOper + buttonStr = roleInfo.Jurisdiction + return +} + +//退出登录 +func (a *ApiMethod) SignOut(c *gin.Context) { + userKey := c.Request.Header.Get("user-key") + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + userToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + // fmt.Printf("userToken----->%v\n", userToken) + _, err := publicmethod.GetUserRedisCont(userToken["usernumber"]) + if err != nil { + redisClient.DelKey(redisFileKey) + publicmethod.Result(0, isTrue, c, "退出成功!") + return + } + redisClient.DelKey(redisFileKey) + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userToken["usernumber"]) + redisClient.DelKey(redisMyContKey) + publicmethod.Result(0, isTrue, c, "退出成功!") +} diff --git a/.history/api/myTest/entry_20220728105227.go b/.history/api/myTest/entry_20220728105227.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/api/myTest/entry_20220728105240.go b/.history/api/myTest/entry_20220728105240.go new file mode 100644 index 0000000..9067dd1 --- /dev/null +++ b/.history/api/myTest/entry_20220728105240.go @@ -0,0 +1,2 @@ +package mytest + diff --git a/.history/api/myTest/entry_20220728131248.go b/.history/api/myTest/entry_20220728131248.go new file mode 100644 index 0000000..3af4b0e --- /dev/null +++ b/.history/api/myTest/entry_20220728131248.go @@ -0,0 +1,5 @@ +package mytest + +type ApiEntry struct{ + +} \ No newline at end of file diff --git a/.history/api/myTest/entry_20220728131253.go b/.history/api/myTest/entry_20220728131253.go new file mode 100644 index 0000000..919dd6f --- /dev/null +++ b/.history/api/myTest/entry_20220728131253.go @@ -0,0 +1,5 @@ +package mytest + +type ApiEntry struct{ + Test +} \ No newline at end of file diff --git a/.history/api/myTest/entry_20220728131257.go b/.history/api/myTest/entry_20220728131257.go new file mode 100644 index 0000000..6a1fc78 --- /dev/null +++ b/.history/api/myTest/entry_20220728131257.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytest. +} \ No newline at end of file diff --git a/.history/api/myTest/entry_20220728131258.go b/.history/api/myTest/entry_20220728131258.go new file mode 100644 index 0000000..074632f --- /dev/null +++ b/.history/api/myTest/entry_20220728131258.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytest.TestApi +} diff --git a/.history/api/myTest/entry_20220728131321.go b/.history/api/myTest/entry_20220728131321.go new file mode 100644 index 0000000..7721e6c --- /dev/null +++ b/.history/api/myTest/entry_20220728131321.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test my +} diff --git a/.history/api/myTest/entry_20220728131324.go b/.history/api/myTest/entry_20220728131324.go new file mode 100644 index 0000000..074632f --- /dev/null +++ b/.history/api/myTest/entry_20220728131324.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytest.TestApi +} diff --git a/.history/api/myTest/entry_20220728131403.go b/.history/api/myTest/entry_20220728131403.go new file mode 100644 index 0000000..7721e6c --- /dev/null +++ b/.history/api/myTest/entry_20220728131403.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test my +} diff --git a/.history/api/myTest/entry_20220728131405.go b/.history/api/myTest/entry_20220728131405.go new file mode 100644 index 0000000..0168612 --- /dev/null +++ b/.history/api/myTest/entry_20220728131405.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test +} diff --git a/.history/api/myTest/entry_20220728131417.go b/.history/api/myTest/entry_20220728131417.go new file mode 100644 index 0000000..0168612 --- /dev/null +++ b/.history/api/myTest/entry_20220728131417.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test +} diff --git a/.history/api/myTest/entry_20220728131419.go b/.history/api/myTest/entry_20220728131419.go new file mode 100644 index 0000000..cc0ec57 --- /dev/null +++ b/.history/api/myTest/entry_20220728131419.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test tes +} diff --git a/.history/api/myTest/entry_20220728131425.go b/.history/api/myTest/entry_20220728131425.go new file mode 100644 index 0000000..115477e --- /dev/null +++ b/.history/api/myTest/entry_20220728131425.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytestroute +} diff --git a/.history/api/myTest/entry_20220728131426.go b/.history/api/myTest/entry_20220728131426.go new file mode 100644 index 0000000..fa738cc --- /dev/null +++ b/.history/api/myTest/entry_20220728131426.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytestroute. +} diff --git a/.history/api/myTest/entry_20220728131430.go b/.history/api/myTest/entry_20220728131430.go new file mode 100644 index 0000000..7ca1d65 --- /dev/null +++ b/.history/api/myTest/entry_20220728131430.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytestroute.mytestroute +} diff --git a/.history/api/myTest/entry_20220728131433.go b/.history/api/myTest/entry_20220728131433.go new file mode 100644 index 0000000..fa738cc --- /dev/null +++ b/.history/api/myTest/entry_20220728131433.go @@ -0,0 +1,7 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +type ApiEntry struct { + Test mytestroute. +} diff --git a/.history/api/myTest/entry_20220728131437.go b/.history/api/myTest/entry_20220728131437.go new file mode 100644 index 0000000..fd5133a --- /dev/null +++ b/.history/api/myTest/entry_20220728131437.go @@ -0,0 +1,5 @@ +package mytest + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131449.go b/.history/api/myTest/entry_20220728131449.go new file mode 100644 index 0000000..23934b1 --- /dev/null +++ b/.history/api/myTest/entry_20220728131449.go @@ -0,0 +1,6 @@ +package mytest + + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131502.go b/.history/api/myTest/entry_20220728131502.go new file mode 100644 index 0000000..49ccba2 --- /dev/null +++ b/.history/api/myTest/entry_20220728131502.go @@ -0,0 +1,7 @@ +package mytest + +import + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131506.go b/.history/api/myTest/entry_20220728131506.go new file mode 100644 index 0000000..49ccba2 --- /dev/null +++ b/.history/api/myTest/entry_20220728131506.go @@ -0,0 +1,7 @@ +package mytest + +import + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131512.go b/.history/api/myTest/entry_20220728131512.go new file mode 100644 index 0000000..0d6d434 --- /dev/null +++ b/.history/api/myTest/entry_20220728131512.go @@ -0,0 +1,7 @@ +package mytest + +import "api." + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131518.go b/.history/api/myTest/entry_20220728131518.go new file mode 100644 index 0000000..8a97070 --- /dev/null +++ b/.history/api/myTest/entry_20220728131518.go @@ -0,0 +1,7 @@ +package mytest + +import "" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131526.go b/.history/api/myTest/entry_20220728131526.go new file mode 100644 index 0000000..189f2f7 --- /dev/null +++ b/.history/api/myTest/entry_20220728131526.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131528.go b/.history/api/myTest/entry_20220728131528.go new file mode 100644 index 0000000..e5d9d36 --- /dev/null +++ b/.history/api/myTest/entry_20220728131528.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/My" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131533.go b/.history/api/myTest/entry_20220728131533.go new file mode 100644 index 0000000..3c5058f --- /dev/null +++ b/.history/api/myTest/entry_20220728131533.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/myt" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131536.go b/.history/api/myTest/entry_20220728131536.go new file mode 100644 index 0000000..0e166e0 --- /dev/null +++ b/.history/api/myTest/entry_20220728131536.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/myTest/" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131545.go b/.history/api/myTest/entry_20220728131545.go new file mode 100644 index 0000000..32a7463 --- /dev/null +++ b/.history/api/myTest/entry_20220728131545.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131546.go b/.history/api/myTest/entry_20220728131546.go new file mode 100644 index 0000000..32a7463 --- /dev/null +++ b/.history/api/myTest/entry_20220728131546.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131554.go b/.history/api/myTest/entry_20220728131554.go new file mode 100644 index 0000000..32a7463 --- /dev/null +++ b/.history/api/myTest/entry_20220728131554.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131601.go b/.history/api/myTest/entry_20220728131601.go new file mode 100644 index 0000000..32a7463 --- /dev/null +++ b/.history/api/myTest/entry_20220728131601.go @@ -0,0 +1,7 @@ +package mytest + +import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131744.go b/.history/api/myTest/entry_20220728131744.go new file mode 100644 index 0000000..695542a --- /dev/null +++ b/.history/api/myTest/entry_20220728131744.go @@ -0,0 +1,7 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + Test mytestroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131746.go b/.history/api/myTest/entry_20220728131746.go new file mode 100644 index 0000000..a5f4a6e --- /dev/null +++ b/.history/api/myTest/entry_20220728131746.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + +} diff --git a/.history/api/myTest/entry_20220728131748.go b/.history/api/myTest/entry_20220728131748.go new file mode 100644 index 0000000..a5f4a6e --- /dev/null +++ b/.history/api/myTest/entry_20220728131748.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + +} diff --git a/.history/api/myTest/entry_20220728131753.go b/.history/api/myTest/entry_20220728131753.go new file mode 100644 index 0000000..d95f5d6 --- /dev/null +++ b/.history/api/myTest/entry_20220728131753.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + MapToStructApi maptostruct.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728131801.go b/.history/api/myTest/entry_20220728131801.go new file mode 100644 index 0000000..a5f4a6e --- /dev/null +++ b/.history/api/myTest/entry_20220728131801.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + +} diff --git a/.history/api/myTest/entry_20220728131804.go b/.history/api/myTest/entry_20220728131804.go new file mode 100644 index 0000000..a5f4a6e --- /dev/null +++ b/.history/api/myTest/entry_20220728131804.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + +} diff --git a/.history/api/myTest/entry_20220728131807.go b/.history/api/myTest/entry_20220728131807.go new file mode 100644 index 0000000..25802ca --- /dev/null +++ b/.history/api/myTest/entry_20220728131807.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + my +} diff --git a/.history/api/myTest/entry_20220728131808.go b/.history/api/myTest/entry_20220728131808.go new file mode 100644 index 0000000..0a7ffe9 --- /dev/null +++ b/.history/api/myTest/entry_20220728131808.go @@ -0,0 +1,10 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + mytest +} diff --git a/.history/api/myTest/entry_20220728131815.go b/.history/api/myTest/entry_20220728131815.go new file mode 100644 index 0000000..300a7e5 --- /dev/null +++ b/.history/api/myTest/entry_20220728131815.go @@ -0,0 +1,10 @@ +package mytest + +import mytest "key_performance_indicators/apirouter/myTest" + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + mytest. +} diff --git a/.history/api/myTest/entry_20220728131817.go b/.history/api/myTest/entry_20220728131817.go new file mode 100644 index 0000000..7425ffe --- /dev/null +++ b/.history/api/myTest/entry_20220728131817.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + +} diff --git a/.history/api/myTest/entry_20220728131824.go b/.history/api/myTest/entry_20220728131824.go new file mode 100644 index 0000000..25802ca --- /dev/null +++ b/.history/api/myTest/entry_20220728131824.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + my +} diff --git a/.history/api/myTest/entry_20220728131827.go b/.history/api/myTest/entry_20220728131827.go new file mode 100644 index 0000000..7425ffe --- /dev/null +++ b/.history/api/myTest/entry_20220728131827.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + +} diff --git a/.history/api/myTest/entry_20220728132012.go b/.history/api/myTest/entry_20220728132012.go new file mode 100644 index 0000000..8fb6b02 --- /dev/null +++ b/.history/api/myTest/entry_20220728132012.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + t +} diff --git a/.history/api/myTest/entry_20220728132014.go b/.history/api/myTest/entry_20220728132014.go new file mode 100644 index 0000000..c1adcf3 --- /dev/null +++ b/.history/api/myTest/entry_20220728132014.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + test +} diff --git a/.history/api/myTest/entry_20220728132015.go b/.history/api/myTest/entry_20220728132015.go new file mode 100644 index 0000000..9f0f4b5 --- /dev/null +++ b/.history/api/myTest/entry_20220728132015.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + testr +} diff --git a/.history/api/myTest/entry_20220728132025.go b/.history/api/myTest/entry_20220728132025.go new file mode 100644 index 0000000..c18aa72 --- /dev/null +++ b/.history/api/myTest/entry_20220728132025.go @@ -0,0 +1,8 @@ +package mytest + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + testroute. +} diff --git a/.history/api/myTest/entry_20220728132027.go b/.history/api/myTest/entry_20220728132027.go new file mode 100644 index 0000000..41c563f --- /dev/null +++ b/.history/api/myTest/entry_20220728132027.go @@ -0,0 +1,10 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + testroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728132028.go b/.history/api/myTest/entry_20220728132028.go new file mode 100644 index 0000000..41c563f --- /dev/null +++ b/.history/api/myTest/entry_20220728132028.go @@ -0,0 +1,10 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +// import "key_performance_indicators/api/myTest/mytestroute" + +type ApiEntry struct { + // Test mytestroute.ApiMethod + testroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728132032.go b/.history/api/myTest/entry_20220728132032.go new file mode 100644 index 0000000..2e8ff91 --- /dev/null +++ b/.history/api/myTest/entry_20220728132032.go @@ -0,0 +1,9 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + + +type ApiEntry struct { + // Test mytestroute.ApiMethod + testroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728132035.go b/.history/api/myTest/entry_20220728132035.go new file mode 100644 index 0000000..e39fef9 --- /dev/null +++ b/.history/api/myTest/entry_20220728132035.go @@ -0,0 +1,9 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + + +type ApiEntry struct { + // Test mytestroute.ApiMethod + Test testroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728132036.go b/.history/api/myTest/entry_20220728132036.go new file mode 100644 index 0000000..92e7be3 --- /dev/null +++ b/.history/api/myTest/entry_20220728132036.go @@ -0,0 +1,7 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728132039.go b/.history/api/myTest/entry_20220728132039.go new file mode 100644 index 0000000..92e7be3 --- /dev/null +++ b/.history/api/myTest/entry_20220728132039.go @@ -0,0 +1,7 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} diff --git a/.history/api/myTest/entry_20220728132049.go b/.history/api/myTest/entry_20220728132049.go new file mode 100644 index 0000000..6453c3c --- /dev/null +++ b/.history/api/myTest/entry_20220728132049.go @@ -0,0 +1,10 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} + + +var diff --git a/.history/api/myTest/entry_20220728132052.go b/.history/api/myTest/entry_20220728132052.go new file mode 100644 index 0000000..3724599 --- /dev/null +++ b/.history/api/myTest/entry_20220728132052.go @@ -0,0 +1,10 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} + + +var app diff --git a/.history/api/myTest/entry_20220728132055.go b/.history/api/myTest/entry_20220728132055.go new file mode 100644 index 0000000..6fe25d7 --- /dev/null +++ b/.history/api/myTest/entry_20220728132055.go @@ -0,0 +1,10 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} + + +var AppApiEntry = new() diff --git a/.history/api/myTest/entry_20220728132057.go b/.history/api/myTest/entry_20220728132057.go new file mode 100644 index 0000000..71e4fb8 --- /dev/null +++ b/.history/api/myTest/entry_20220728132057.go @@ -0,0 +1,9 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} + +var AppApiEntry = new(ApiEntry) diff --git a/.history/api/myTest/testRoute/testroute_20220728105311.go b/.history/api/myTest/testRoute/testroute_20220728105311.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/api/myTest/testRoute/testroute_20220728105316.go b/.history/api/myTest/testRoute/testroute_20220728105316.go new file mode 100644 index 0000000..05a880b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728105316.go @@ -0,0 +1 @@ +pa \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728105323.go b/.history/api/myTest/testRoute/testroute_20220728105323.go new file mode 100644 index 0000000..b6e7d69 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728105323.go @@ -0,0 +1 @@ +package mytset \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728105330.go b/.history/api/myTest/testRoute/testroute_20220728105330.go new file mode 100644 index 0000000..2d1f664 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728105330.go @@ -0,0 +1 @@ +package mytest diff --git a/.history/api/myTest/testRoute/testroute_20220728105333.go b/.history/api/myTest/testRoute/testroute_20220728105333.go new file mode 100644 index 0000000..9067dd1 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728105333.go @@ -0,0 +1,2 @@ +package mytest + diff --git a/.history/api/myTest/testRoute/testroute_20220728105444.go b/.history/api/myTest/testRoute/testroute_20220728105444.go new file mode 100644 index 0000000..a9ad729 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728105444.go @@ -0,0 +1,2 @@ +package mytestr + diff --git a/.history/api/myTest/testRoute/testroute_20220728105447.go b/.history/api/myTest/testRoute/testroute_20220728105447.go new file mode 100644 index 0000000..39e1d3f --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728105447.go @@ -0,0 +1,2 @@ +package mytestroute + diff --git a/.history/api/myTest/testRoute/testroute_20220728131912.go b/.history/api/myTest/testRoute/testroute_20220728131912.go new file mode 100644 index 0000000..597acc7 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728131912.go @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728131914.go b/.history/api/myTest/testRoute/testroute_20220728131914.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/api/myTest/testRoute/testroute_20220728131924.go b/.history/api/myTest/testRoute/testroute_20220728131924.go new file mode 100644 index 0000000..05a880b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728131924.go @@ -0,0 +1 @@ +pa \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728131927.go b/.history/api/myTest/testRoute/testroute_20220728131927.go new file mode 100644 index 0000000..597acc7 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728131927.go @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728131929.go b/.history/api/myTest/testRoute/testroute_20220728131929.go new file mode 100644 index 0000000..597acc7 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728131929.go @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728131953.go b/.history/api/myTest/testRoute/testroute_20220728131953.go new file mode 100644 index 0000000..4f6c4ee --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728131953.go @@ -0,0 +1 @@ +p \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728131959.go b/.history/api/myTest/testRoute/testroute_20220728131959.go new file mode 100644 index 0000000..94329a3 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728131959.go @@ -0,0 +1,2 @@ +package testroute + diff --git a/.history/api/myTest/testRoute/testroute_20220728132003.go b/.history/api/myTest/testRoute/testroute_20220728132003.go new file mode 100644 index 0000000..fc841a8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132003.go @@ -0,0 +1 @@ +package testroute diff --git a/.history/api/myTest/testRoute/testroute_20220728132005.go b/.history/api/myTest/testRoute/testroute_20220728132005.go new file mode 100644 index 0000000..fc841a8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132005.go @@ -0,0 +1 @@ +package testroute diff --git a/.history/api/myTest/testRoute/testroute_20220728132229.go b/.history/api/myTest/testRoute/testroute_20220728132229.go new file mode 100644 index 0000000..11ea004 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132229.go @@ -0,0 +1,3 @@ +package testroute + +func \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132232.go b/.history/api/myTest/testRoute/testroute_20220728132232.go new file mode 100644 index 0000000..ab32e46 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132232.go @@ -0,0 +1,3 @@ +package testroute + +func () \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132241.go b/.history/api/myTest/testRoute/testroute_20220728132241.go new file mode 100644 index 0000000..027080f --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132241.go @@ -0,0 +1,3 @@ +package testroute + +func (ApiMethod) \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132242.go b/.history/api/myTest/testRoute/testroute_20220728132242.go new file mode 100644 index 0000000..027080f --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132242.go @@ -0,0 +1,3 @@ +package testroute + +func (ApiMethod) \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132245.go b/.history/api/myTest/testRoute/testroute_20220728132245.go new file mode 100644 index 0000000..0b129ed --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132245.go @@ -0,0 +1,3 @@ +package testroute + +func (a*ApiMethod) \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132247.go b/.history/api/myTest/testRoute/testroute_20220728132247.go new file mode 100644 index 0000000..ac964f7 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132247.go @@ -0,0 +1,3 @@ +package testroute + +func (a *ApiMethod) \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132255.go b/.history/api/myTest/testRoute/testroute_20220728132255.go new file mode 100644 index 0000000..40c93e8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132255.go @@ -0,0 +1,3 @@ +package testroute + +func (a *ApiMethod)MyTest() \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132257.go b/.history/api/myTest/testRoute/testroute_20220728132257.go new file mode 100644 index 0000000..99a3635 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132257.go @@ -0,0 +1,3 @@ +package testroute + +func (a *ApiMethod)MyTest(c) \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132259.go b/.history/api/myTest/testRoute/testroute_20220728132259.go new file mode 100644 index 0000000..f3c0131 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132259.go @@ -0,0 +1,3 @@ +package testroute + +func (a *ApiMethod)MyTest(ctx ) \ No newline at end of file diff --git a/.history/api/myTest/testRoute/testroute_20220728132302.go b/.history/api/myTest/testRoute/testroute_20220728132302.go new file mode 100644 index 0000000..d733dbf --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132302.go @@ -0,0 +1,5 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) diff --git a/.history/api/myTest/testRoute/testroute_20220728132308.go b/.history/api/myTest/testRoute/testroute_20220728132308.go new file mode 100644 index 0000000..233568b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132308.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132309.go b/.history/api/myTest/testRoute/testroute_20220728132309.go new file mode 100644 index 0000000..e369108 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132309.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132322.go b/.history/api/myTest/testRoute/testroute_20220728132322.go new file mode 100644 index 0000000..1e918ed --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132322.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + ctx.get +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132324.go b/.history/api/myTest/testRoute/testroute_20220728132324.go new file mode 100644 index 0000000..7b1db75 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132324.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + ctx.Qu +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132325.go b/.history/api/myTest/testRoute/testroute_20220728132325.go new file mode 100644 index 0000000..d355098 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132325.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + ctx.Query() +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132327.go b/.history/api/myTest/testRoute/testroute_20220728132327.go new file mode 100644 index 0000000..f13e42c --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132327.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + ctx.Query("name") +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132332.go b/.history/api/myTest/testRoute/testroute_20220728132332.go new file mode 100644 index 0000000..f4b4307 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132332.go @@ -0,0 +1,7 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132343.go b/.history/api/myTest/testRoute/testroute_20220728132343.go new file mode 100644 index 0000000..03ec0da --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132343.go @@ -0,0 +1,8 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132344.go b/.history/api/myTest/testRoute/testroute_20220728132344.go new file mode 100644 index 0000000..03ec0da --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132344.go @@ -0,0 +1,8 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132348.go b/.history/api/myTest/testRoute/testroute_20220728132348.go new file mode 100644 index 0000000..1761fc1 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132348.go @@ -0,0 +1,10 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132353.go b/.history/api/myTest/testRoute/testroute_20220728132353.go new file mode 100644 index 0000000..0472b2e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132353.go @@ -0,0 +1,10 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132403.go b/.history/api/myTest/testRoute/testroute_20220728132403.go new file mode 100644 index 0000000..43ebf39 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132403.go @@ -0,0 +1,10 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var p1 = Person +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132406.go b/.history/api/myTest/testRoute/testroute_20220728132406.go new file mode 100644 index 0000000..9bc168b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132406.go @@ -0,0 +1,10 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var p1 = Person{} +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132412.go b/.history/api/myTest/testRoute/testroute_20220728132412.go new file mode 100644 index 0000000..266db53 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132412.go @@ -0,0 +1,12 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var p1 = Person{ + Name: name, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132415.go b/.history/api/myTest/testRoute/testroute_20220728132415.go new file mode 100644 index 0000000..fc8d8f8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132415.go @@ -0,0 +1,13 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var p1 = Person{ + Name: name, + Age + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132419.go b/.history/api/myTest/testRoute/testroute_20220728132419.go new file mode 100644 index 0000000..1a189e0 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132419.go @@ -0,0 +1,13 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132420.go b/.history/api/myTest/testRoute/testroute_20220728132420.go new file mode 100644 index 0000000..f26ed7a --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132420.go @@ -0,0 +1,13 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132428.go b/.history/api/myTest/testRoute/testroute_20220728132428.go new file mode 100644 index 0000000..2388686 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132428.go @@ -0,0 +1,14 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132432.go b/.history/api/myTest/testRoute/testroute_20220728132432.go new file mode 100644 index 0000000..32a27fa --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132432.go @@ -0,0 +1,15 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + strings. + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132440.go b/.history/api/myTest/testRoute/testroute_20220728132440.go new file mode 100644 index 0000000..2bcbafa --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132440.go @@ -0,0 +1,15 @@ +package testroute + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + stri + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132445.go b/.history/api/myTest/testRoute/testroute_20220728132445.go new file mode 100644 index 0000000..38689e0 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132445.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + strconv.Atoi() + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132448.go b/.history/api/myTest/testRoute/testroute_20220728132448.go new file mode 100644 index 0000000..673fc11 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132448.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132451.go b/.history/api/myTest/testRoute/testroute_20220728132451.go new file mode 100644 index 0000000..7a06477 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132451.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + age strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132459.go b/.history/api/myTest/testRoute/testroute_20220728132459.go new file mode 100644 index 0000000..ff8782d --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132459.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + age, _ = strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132503.go b/.history/api/myTest/testRoute/testroute_20220728132503.go new file mode 100644 index 0000000..21b1c92 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132503.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + age, _ := strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132505.go b/.history/api/myTest/testRoute/testroute_20220728132505.go new file mode 100644 index 0000000..ff8782d --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132505.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + age, _ = strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132510.go b/.history/api/myTest/testRoute/testroute_20220728132510.go new file mode 100644 index 0000000..e6ca287 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132510.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, _ = strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132511.go b/.history/api/myTest/testRoute/testroute_20220728132511.go new file mode 100644 index 0000000..e6ca287 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132511.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, _ = strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132515.go b/.history/api/myTest/testRoute/testroute_20220728132515.go new file mode 100644 index 0000000..03dc265 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132515.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err = strconv.Atoi(age) + + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132523.go b/.history/api/myTest/testRoute/testroute_20220728132523.go new file mode 100644 index 0000000..b669090 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132523.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil{ + + } + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132533.go b/.history/api/myTest/testRoute/testroute_20220728132533.go new file mode 100644 index 0000000..e555e07 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132533.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil{ + publicmethod. + } + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132535.go b/.history/api/myTest/testRoute/testroute_20220728132535.go new file mode 100644 index 0000000..ab82c0f --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132535.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil{ + publicmethod.ErrorCodeMsg + } + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132543.go b/.history/api/myTest/testRoute/testroute_20220728132543.go new file mode 100644 index 0000000..31064bd --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132543.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result() + } + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132613.go b/.history/api/myTest/testRoute/testroute_20220728132613.go new file mode 100644 index 0000000..7f05dd8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132613.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), c) + } + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132614.go b/.history/api/myTest/testRoute/testroute_20220728132614.go new file mode 100644 index 0000000..17c549b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132614.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: age, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132618.go b/.history/api/myTest/testRoute/testroute_20220728132618.go new file mode 100644 index 0000000..661c116 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132618.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: new, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132619.go b/.history/api/myTest/testRoute/testroute_20220728132619.go new file mode 100644 index 0000000..7b635b6 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132619.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132621.go b/.history/api/myTest/testRoute/testroute_20220728132621.go new file mode 100644 index 0000000..1bc3287 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132621.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132640.go b/.history/api/myTest/testRoute/testroute_20220728132640.go new file mode 100644 index 0000000..703d20c --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132640.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + publicmethod. +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132642.go b/.history/api/myTest/testRoute/testroute_20220728132642.go new file mode 100644 index 0000000..92c1874 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132642.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + publicmethod.re +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132643.go b/.history/api/myTest/testRoute/testroute_20220728132643.go new file mode 100644 index 0000000..fb861f6 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132643.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + publicmethod.Result() +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132649.go b/.history/api/myTest/testRoute/testroute_20220728132649.go new file mode 100644 index 0000000..dfd47f4 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132649.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + publicmethod.Result(0,) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132652.go b/.history/api/myTest/testRoute/testroute_20220728132652.go new file mode 100644 index 0000000..9120e0e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132652.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132705.go b/.history/api/myTest/testRoute/testroute_20220728132705.go new file mode 100644 index 0000000..13e9e23 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132705.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Println() + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728132713.go b/.history/api/myTest/testRoute/testroute_20220728132713.go new file mode 100644 index 0000000..f6f0ded --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728132713.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135054.go b/.history/api/myTest/testRoute/testroute_20220728135054.go new file mode 100644 index 0000000..75896e4 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135054.go @@ -0,0 +1,27 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + json.u + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135055.go b/.history/api/myTest/testRoute/testroute_20220728135055.go new file mode 100644 index 0000000..4f58493 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135055.go @@ -0,0 +1,28 @@ +package testroute + +import ( + "encoding/json" + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + json.Unmarshal() + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135100.go b/.history/api/myTest/testRoute/testroute_20220728135100.go new file mode 100644 index 0000000..2854980 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135100.go @@ -0,0 +1,28 @@ +package testroute + +import ( + "encoding/json" + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + json.Unmarshal(data) + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135101.go b/.history/api/myTest/testRoute/testroute_20220728135101.go new file mode 100644 index 0000000..4f58493 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135101.go @@ -0,0 +1,28 @@ +package testroute + +import ( + "encoding/json" + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + json.Unmarshal() + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135106.go b/.history/api/myTest/testRoute/testroute_20220728135106.go new file mode 100644 index 0000000..032e0e2 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135106.go @@ -0,0 +1,28 @@ +package testroute + +import ( + "encoding/json" + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + json.Unmarshal(&p1) + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135108.go b/.history/api/myTest/testRoute/testroute_20220728135108.go new file mode 100644 index 0000000..6b9423e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135108.go @@ -0,0 +1,28 @@ +package testroute + +import ( + "encoding/json" + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + json.Unmarshal(,&p1) + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135148.go b/.history/api/myTest/testRoute/testroute_20220728135148.go new file mode 100644 index 0000000..f6f0ded --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135148.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135211.go b/.history/api/myTest/testRoute/testroute_20220728135211.go new file mode 100644 index 0000000..614c0f8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135211.go @@ -0,0 +1,27 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) + fmt.Printf("%#v", p1) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135213.go b/.history/api/myTest/testRoute/testroute_20220728135213.go new file mode 100644 index 0000000..2bd1c37 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135213.go @@ -0,0 +1,27 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135215.go b/.history/api/myTest/testRoute/testroute_20220728135215.go new file mode 100644 index 0000000..5536e18 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135215.go @@ -0,0 +1,27 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + fmt.Printf("%#v", p) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135221.go b/.history/api/myTest/testRoute/testroute_20220728135221.go new file mode 100644 index 0000000..f6f0ded --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135221.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135222.go b/.history/api/myTest/testRoute/testroute_20220728135222.go new file mode 100644 index 0000000..f6f0ded --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135222.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135233.go b/.history/api/myTest/testRoute/testroute_20220728135233.go new file mode 100644 index 0000000..ca25457 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135233.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135312.go b/.history/api/myTest/testRoute/testroute_20220728135312.go new file mode 100644 index 0000000..d870538 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135312.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135318.go b/.history/api/myTest/testRoute/testroute_20220728135318.go new file mode 100644 index 0000000..5430941 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135318.go @@ -0,0 +1,26 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + ctx.Qu + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135322.go b/.history/api/myTest/testRoute/testroute_20220728135322.go new file mode 100644 index 0000000..b1fe778 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135322.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + name := ctx.Query("name") + age := ctx.Query("age") + newAge, err := strconv.Atoi(age) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135351.go b/.history/api/myTest/testRoute/testroute_20220728135351.go new file mode 100644 index 0000000..ca6e939 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135351.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135355.go b/.history/api/myTest/testRoute/testroute_20220728135355.go new file mode 100644 index 0000000..82cf3d2 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135355.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + ctx.Bind() + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + var p1 = Person{ + Name: name, + Age: newAge, + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135358.go b/.history/api/myTest/testRoute/testroute_20220728135358.go new file mode 100644 index 0000000..97b9182 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135358.go @@ -0,0 +1,18 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + ctx.Bind() + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135404.go b/.history/api/myTest/testRoute/testroute_20220728135404.go new file mode 100644 index 0000000..ebfae01 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135404.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + var p1 + ctx.Bind() + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135406.go b/.history/api/myTest/testRoute/testroute_20220728135406.go new file mode 100644 index 0000000..2f1a3b3 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135406.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + "strconv" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + var p1 Person + ctx.Bind() + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135409.go b/.history/api/myTest/testRoute/testroute_20220728135409.go new file mode 100644 index 0000000..ab7cd84 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135409.go @@ -0,0 +1,18 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + var p1 Person + ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728135416.go b/.history/api/myTest/testRoute/testroute_20220728135416.go new file mode 100644 index 0000000..d569ba9 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728135416.go @@ -0,0 +1,18 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140526.go b/.history/api/myTest/testRoute/testroute_20220728140526.go new file mode 100644 index 0000000..b9dbf52 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140526.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140530.go b/.history/api/myTest/testRoute/testroute_20220728140530.go new file mode 100644 index 0000000..529959b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140530.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + fmt.prin + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140532.go b/.history/api/myTest/testRoute/testroute_20220728140532.go new file mode 100644 index 0000000..4bb3272 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140532.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + fmt.Println() + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140542.go b/.history/api/myTest/testRoute/testroute_20220728140542.go new file mode 100644 index 0000000..06a621d --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140542.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + fmt.Println(ctx.Query("name")) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140543.go b/.history/api/myTest/testRoute/testroute_20220728140543.go new file mode 100644 index 0000000..ef9495a --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140543.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + var p1 Person + fmt.Println(ctx.Query("name")) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140545.go b/.history/api/myTest/testRoute/testroute_20220728140545.go new file mode 100644 index 0000000..06a621d --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140545.go @@ -0,0 +1,19 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + fmt.Println(ctx.Query("name")) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140550.go b/.history/api/myTest/testRoute/testroute_20220728140550.go new file mode 100644 index 0000000..e923bd7 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140550.go @@ -0,0 +1,20 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + fmt.Println(ctx.Query("name")) + fmt.Println(ctx.Query("age")s) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140551.go b/.history/api/myTest/testRoute/testroute_20220728140551.go new file mode 100644 index 0000000..4dd0190 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140551.go @@ -0,0 +1,20 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + fmt.Println(ctx.Query("name")) + fmt.Println(ctx.Query("age")) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140612.go b/.history/api/myTest/testRoute/testroute_20220728140612.go new file mode 100644 index 0000000..c23962d --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140612.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + fmt.Println(ctx.Query("name")) + fmt.Println(ctx.Query("age")) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140619.go b/.history/api/myTest/testRoute/testroute_20220728140619.go new file mode 100644 index 0000000..c4ee17e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140619.go @@ -0,0 +1,20 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + ctx.Query("name") + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140627.go b/.history/api/myTest/testRoute/testroute_20220728140627.go new file mode 100644 index 0000000..2e43729 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140627.go @@ -0,0 +1,20 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140637.go b/.history/api/myTest/testRoute/testroute_20220728140637.go new file mode 100644 index 0000000..5bbd028 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140637.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.pr + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140639.go b/.history/api/myTest/testRoute/testroute_20220728140639.go new file mode 100644 index 0000000..e1464c8 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140639.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Println(name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140642.go b/.history/api/myTest/testRoute/testroute_20220728140642.go new file mode 100644 index 0000000..f781612 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140642.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf(name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140649.go b/.history/api/myTest/testRoute/testroute_20220728140649.go new file mode 100644 index 0000000..898f19e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140649.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的参数为:") + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140654.go b/.history/api/myTest/testRoute/testroute_20220728140654.go new file mode 100644 index 0000000..d6a193e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140654.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:") + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140658.go b/.history/api/myTest/testRoute/testroute_20220728140658.go new file mode 100644 index 0000000..3bf93a1 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140658.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:%v", name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140703.go b/.history/api/myTest/testRoute/testroute_20220728140703.go new file mode 100644 index 0000000..8fa8170 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140703.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140704.go b/.history/api/myTest/testRoute/testroute_20220728140704.go new file mode 100644 index 0000000..8fa8170 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140704.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140817.go b/.history/api/myTest/testRoute/testroute_20220728140817.go new file mode 100644 index 0000000..fdc19db --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140817.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Nma为:") + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140825.go b/.history/api/myTest/testRoute/testroute_20220728140825.go new file mode 100644 index 0000000..6afa9b3 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140825.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:%v",name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140828.go b/.history/api/myTest/testRoute/testroute_20220728140828.go new file mode 100644 index 0000000..8fa8170 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140828.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728140830.go b/.history/api/myTest/testRoute/testroute_20220728140830.go new file mode 100644 index 0000000..8fa8170 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728140830.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.Query("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728141159.go b/.history/api/myTest/testRoute/testroute_20220728141159.go new file mode 100644 index 0000000..2c18a16 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728141159.go @@ -0,0 +1,21 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145250.go b/.history/api/myTest/testRoute/testroute_20220728145250.go new file mode 100644 index 0000000..e48ef23 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145250.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + db + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145251.go b/.history/api/myTest/testRoute/testroute_20220728145251.go new file mode 100644 index 0000000..dbdbb55 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145251.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145612.go b/.history/api/myTest/testRoute/testroute_20220728145612.go new file mode 100644 index 0000000..ab6cfeb --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145612.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + gor + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145615.go b/.history/api/myTest/testRoute/testroute_20220728145615.go new file mode 100644 index 0000000..5d739c1 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145615.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + gorm. + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145617.go b/.history/api/myTest/testRoute/testroute_20220728145617.go new file mode 100644 index 0000000..f8d1e1b --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145617.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + gorm.c + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145622.go b/.history/api/myTest/testRoute/testroute_20220728145622.go new file mode 100644 index 0000000..30cba48 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145622.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + gorm.Open(gorm.) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145623.go b/.history/api/myTest/testRoute/testroute_20220728145623.go new file mode 100644 index 0000000..89a3a95 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145623.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + gorm.Open(gorm.c) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145625.go b/.history/api/myTest/testRoute/testroute_20220728145625.go new file mode 100644 index 0000000..30c4fb1 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145625.go @@ -0,0 +1,23 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + gorm.Open(gorm.Config{}) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145647.go b/.history/api/myTest/testRoute/testroute_20220728145647.go new file mode 100644 index 0000000..1987e94 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145647.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145651.go b/.history/api/myTest/testRoute/testroute_20220728145651.go new file mode 100644 index 0000000..3c85d88 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145651.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "user:pass@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145656.go b/.history/api/myTest/testRoute/testroute_20220728145656.go new file mode 100644 index 0000000..d727c22 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145656.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:pass@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145700.go b/.history/api/myTest/testRoute/testroute_20220728145700.go new file mode 100644 index 0000000..2c9f773 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145700.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:root@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145701.go b/.history/api/myTest/testRoute/testroute_20220728145701.go new file mode 100644 index 0000000..2c9f773 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145701.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:root@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145708.go b/.history/api/myTest/testRoute/testroute_20220728145708.go new file mode 100644 index 0000000..f004bd3 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145708.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:root@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + db. + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145710.go b/.history/api/myTest/testRoute/testroute_20220728145710.go new file mode 100644 index 0000000..7977044 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145710.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:root@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + db.sele + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145712.go b/.history/api/myTest/testRoute/testroute_20220728145712.go new file mode 100644 index 0000000..32f91b9 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145712.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:root@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + db.Select() + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145806.go b/.history/api/myTest/testRoute/testroute_20220728145806.go new file mode 100644 index 0000000..54a257e --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145806.go @@ -0,0 +1,25 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + dsn := "root:root@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local" + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/testroute_20220728145926.go b/.history/api/myTest/testRoute/testroute_20220728145926.go new file mode 100644 index 0000000..dbdbb55 --- /dev/null +++ b/.history/api/myTest/testRoute/testroute_20220728145926.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/.history/api/myTest/testRoute/type_20220728105357.go b/.history/api/myTest/testRoute/type_20220728105357.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/api/myTest/testRoute/type_20220728105401.go b/.history/api/myTest/testRoute/type_20220728105401.go new file mode 100644 index 0000000..7f8513b --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105401.go @@ -0,0 +1 @@ +pack \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728105404.go b/.history/api/myTest/testRoute/type_20220728105404.go new file mode 100644 index 0000000..16e5d88 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105404.go @@ -0,0 +1 @@ +package mytests \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728105405.go b/.history/api/myTest/testRoute/type_20220728105405.go new file mode 100644 index 0000000..2d1f664 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105405.go @@ -0,0 +1 @@ +package mytest diff --git a/.history/api/myTest/testRoute/type_20220728105423.go b/.history/api/myTest/testRoute/type_20220728105423.go new file mode 100644 index 0000000..9067dd1 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105423.go @@ -0,0 +1,2 @@ +package mytest + diff --git a/.history/api/myTest/testRoute/type_20220728105427.go b/.history/api/myTest/testRoute/type_20220728105427.go new file mode 100644 index 0000000..24cf1a3 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105427.go @@ -0,0 +1,3 @@ +package mytest + +type \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728105434.go b/.history/api/myTest/testRoute/type_20220728105434.go new file mode 100644 index 0000000..9067dd1 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105434.go @@ -0,0 +1,2 @@ +package mytest + diff --git a/.history/api/myTest/testRoute/type_20220728105451.go b/.history/api/myTest/testRoute/type_20220728105451.go new file mode 100644 index 0000000..7c6e53e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105451.go @@ -0,0 +1 @@ +package mytestroute diff --git a/.history/api/myTest/testRoute/type_20220728105539.go b/.history/api/myTest/testRoute/type_20220728105539.go new file mode 100644 index 0000000..ddbbe2a --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105539.go @@ -0,0 +1,3 @@ +package mytestroute + +type ApiMethod \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728105541.go b/.history/api/myTest/testRoute/type_20220728105541.go new file mode 100644 index 0000000..e177103 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105541.go @@ -0,0 +1,3 @@ +package mytestroute + +type ApiMethod struct{} diff --git a/.history/api/myTest/testRoute/type_20220728105631.go b/.history/api/myTest/testRoute/type_20220728105631.go new file mode 100644 index 0000000..fc4632e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105631.go @@ -0,0 +1,9 @@ +package mytestroute + +type ApiMethod struct{} + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728105639.go b/.history/api/myTest/testRoute/type_20220728105639.go new file mode 100644 index 0000000..40c8263 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105639.go @@ -0,0 +1,11 @@ +package mytestroute + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728105641.go b/.history/api/myTest/testRoute/type_20220728105641.go new file mode 100644 index 0000000..e761c22 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105641.go @@ -0,0 +1,17 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} diff --git a/.history/api/myTest/testRoute/type_20220728105646.go b/.history/api/myTest/testRoute/type_20220728105646.go new file mode 100644 index 0000000..77b732e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105646.go @@ -0,0 +1,16 @@ +package mytestroute + +import ( + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} diff --git a/.history/api/myTest/testRoute/type_20220728105703.go b/.history/api/myTest/testRoute/type_20220728105703.go new file mode 100644 index 0000000..e761c22 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105703.go @@ -0,0 +1,17 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} diff --git a/.history/api/myTest/testRoute/type_20220728105710.go b/.history/api/myTest/testRoute/type_20220728105710.go new file mode 100644 index 0000000..e9542e3 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105710.go @@ -0,0 +1,17 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "" + publicmethod.Result(0, outputCont, c) +} diff --git a/.history/api/myTest/testRoute/type_20220728105716.go b/.history/api/myTest/testRoute/type_20220728105716.go new file mode 100644 index 0000000..6e4657f --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105716.go @@ -0,0 +1,17 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} diff --git a/.history/api/myTest/testRoute/type_20220728105721.go b/.history/api/myTest/testRoute/type_20220728105721.go new file mode 100644 index 0000000..6e4657f --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728105721.go @@ -0,0 +1,17 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} diff --git a/.history/api/myTest/testRoute/type_20220728131004.go b/.history/api/myTest/testRoute/type_20220728131004.go new file mode 100644 index 0000000..01a2b16 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131004.go @@ -0,0 +1,19 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type struct diff --git a/.history/api/myTest/testRoute/type_20220728131009.go b/.history/api/myTest/testRoute/type_20220728131009.go new file mode 100644 index 0000000..2559bf5 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131009.go @@ -0,0 +1,19 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type Person struct diff --git a/.history/api/myTest/testRoute/type_20220728131014.go b/.history/api/myTest/testRoute/type_20220728131014.go new file mode 100644 index 0000000..76d8392 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131014.go @@ -0,0 +1,21 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type Person struct{ + Name +} diff --git a/.history/api/myTest/testRoute/type_20220728131020.go b/.history/api/myTest/testRoute/type_20220728131020.go new file mode 100644 index 0000000..10a459d --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131020.go @@ -0,0 +1,21 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type Person struct{ + Name string `` +} diff --git a/.history/api/myTest/testRoute/type_20220728131032.go b/.history/api/myTest/testRoute/type_20220728131032.go new file mode 100644 index 0000000..c063a02 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131032.go @@ -0,0 +1,22 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type Person struct{ + Name string `json:"name"` + Age int +} diff --git a/.history/api/myTest/testRoute/type_20220728131035.go b/.history/api/myTest/testRoute/type_20220728131035.go new file mode 100644 index 0000000..86aab25 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131035.go @@ -0,0 +1,22 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type Person struct{ + Name string `json:"name"` + Age int `json:` +} diff --git a/.history/api/myTest/testRoute/type_20220728131039.go b/.history/api/myTest/testRoute/type_20220728131039.go new file mode 100644 index 0000000..909087c --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131039.go @@ -0,0 +1,22 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +type Person struct { + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131043.go b/.history/api/myTest/testRoute/type_20220728131043.go new file mode 100644 index 0000000..ea5a4f3 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131043.go @@ -0,0 +1,22 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} +// +type Person struct { + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131048.go b/.history/api/myTest/testRoute/type_20220728131048.go new file mode 100644 index 0000000..757656c --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131048.go @@ -0,0 +1,23 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131213.go b/.history/api/myTest/testRoute/type_20220728131213.go new file mode 100644 index 0000000..7b76e95 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131213.go @@ -0,0 +1,24 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + id int `json:"name"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131217.go b/.history/api/myTest/testRoute/type_20220728131217.go new file mode 100644 index 0000000..a5ee7c7 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131217.go @@ -0,0 +1,24 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"name"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131218.go b/.history/api/myTest/testRoute/type_20220728131218.go new file mode 100644 index 0000000..a5ee7c7 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131218.go @@ -0,0 +1,24 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"name"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131222.go b/.history/api/myTest/testRoute/type_20220728131222.go new file mode 100644 index 0000000..16c293c --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131222.go @@ -0,0 +1,24 @@ +package mytestroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131841.go b/.history/api/myTest/testRoute/type_20220728131841.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/api/myTest/testRoute/type_20220728131850.go b/.history/api/myTest/testRoute/type_20220728131850.go new file mode 100644 index 0000000..59c77e4 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131850.go @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/.history/api/myTest/testRoute/type_20220728131852.go b/.history/api/myTest/testRoute/type_20220728131852.go new file mode 100644 index 0000000..ddd1131 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131852.go @@ -0,0 +1,24 @@ + + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131856.go b/.history/api/myTest/testRoute/type_20220728131856.go new file mode 100644 index 0000000..ae7c3d0 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131856.go @@ -0,0 +1,24 @@ +package + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131900.go b/.history/api/myTest/testRoute/type_20220728131900.go new file mode 100644 index 0000000..74fe37e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131900.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131902.go b/.history/api/myTest/testRoute/type_20220728131902.go new file mode 100644 index 0000000..74fe37e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131902.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131917.go b/.history/api/myTest/testRoute/type_20220728131917.go new file mode 100644 index 0000000..74fe37e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131917.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728131937.go b/.history/api/myTest/testRoute/type_20220728131937.go new file mode 100644 index 0000000..74fe37e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728131937.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728141047.go b/.history/api/myTest/testRoute/type_20220728141047.go new file mode 100644 index 0000000..9e88425 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728141047.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id"` + Name string `json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728141053.go b/.history/api/myTest/testRoute/type_20220728141053.go new file mode 100644 index 0000000..7e8f3d2 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728141053.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id"` + Name string `form:"name" json:"name"` + Age int `json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728141058.go b/.history/api/myTest/testRoute/type_20220728141058.go new file mode 100644 index 0000000..5f6ab21 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728141058.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id"` + Name string `form:"name" json:"name"` + Age int `json:"age" json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728141255.go b/.history/api/myTest/testRoute/type_20220728141255.go new file mode 100644 index 0000000..aed459e --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728141255.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id"` + Name string `form:"name" json:"name"` + Age int `form:"age" json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728145213.go b/.history/api/myTest/testRoute/type_20220728145213.go new file mode 100644 index 0000000..f1e6536 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728145213.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id" mapstructure` + Name string `form:"name" json:"name"` + Age int `form:"age" json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728145219.go b/.history/api/myTest/testRoute/type_20220728145219.go new file mode 100644 index 0000000..fb0cc73 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728145219.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id" mapstructure:"id"` + Name string `form:"name" json:"name"` + Age int `form:"age" json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728145226.go b/.history/api/myTest/testRoute/type_20220728145226.go new file mode 100644 index 0000000..a13a3ce --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728145226.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id" mapstructure:"id"` + Name string `form:"name" json:"name" mapstructure:"name"` + Age int `form:"age" json:"age"` +} diff --git a/.history/api/myTest/testRoute/type_20220728145231.go b/.history/api/myTest/testRoute/type_20220728145231.go new file mode 100644 index 0000000..30b5ae5 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728145231.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id" mapstructure:"id"` + Name string `form:"name" json:"name" mapstructure:"name"` + Age int `form:"age" json:"age" mapstructure` +} diff --git a/.history/api/myTest/testRoute/type_20220728145233.go b/.history/api/myTest/testRoute/type_20220728145233.go new file mode 100644 index 0000000..b18daf0 --- /dev/null +++ b/.history/api/myTest/testRoute/type_20220728145233.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id" mapstructure:"id"` + Name string `form:"name" json:"name" mapstructure:"name"` + Age int `form:"age" json:"age" mapstructure:"age"` +} diff --git a/.history/api/version1/honoraryArchives/honors_20220727153717.go b/.history/api/version1/honoraryArchives/honors_20220727153717.go new file mode 100644 index 0000000..1e46c3a --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220727153717.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729090701.go b/.history/api/version1/honoraryArchives/honors_20220729090701.go new file mode 100644 index 0000000..b1cf602 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729090701.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729090708.go b/.history/api/version1/honoraryArchives/honors_20220729090708.go new file mode 100644 index 0000000..b1cf602 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729090708.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729090730.go b/.history/api/version1/honoraryArchives/honors_20220729090730.go new file mode 100644 index 0000000..9b33e3e --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729090730.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont // + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729090740.go b/.history/api/version1/honoraryArchives/honors_20220729090740.go new file mode 100644 index 0000000..73b9b0b --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729090740.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729092037.go b/.history/api/version1/honoraryArchives/honors_20220729092037.go new file mode 100644 index 0000000..7af79f4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729092037.go @@ -0,0 +1,336 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} + + diff --git a/.history/api/version1/honoraryArchives/honors_20220729094120.go b/.history/api/version1/honoraryArchives/honors_20220729094120.go new file mode 100644 index 0000000..8e754d6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729094120.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属哪个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729100358.go b/.history/api/version1/honoraryArchives/honors_20220729100358.go new file mode 100644 index 0000000..d514503 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729100358.go @@ -0,0 +1,335 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属哪个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + requestData.i + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729100400.go b/.history/api/version1/honoraryArchives/honors_20220729100400.go new file mode 100644 index 0000000..7699df0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729100400.go @@ -0,0 +1,335 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属哪个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + requestData.Id + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220729100406.go b/.history/api/version1/honoraryArchives/honors_20220729100406.go new file mode 100644 index 0000000..8e754d6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220729100406.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属哪个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/honors_20220801084517.go b/.history/api/version1/honoraryArchives/honors_20220801084517.go new file mode 100644 index 0000000..8e754d6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/honors_20220801084517.go @@ -0,0 +1,334 @@ +package honoraryArchives + +import ( + "fmt" + "key_performance_indicators/middleware/snowflake" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +//荣誉列表 +func (a *ApiMethod) HonorList(c *gin.Context) { + var requestData honorListKey + c.ShouldBindJSON(&requestData) + var honorsList []models.HonoraryArchives + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + if requestData.IssuingAgency != "" { + gormDb = gormDb.Where("`issuing_unit` LIKE ?", "%"+requestData.IssuingAgency+"%") + } + if requestData.Carrier != 0 { + gormDb = gormDb.Where("carrier = ?", requestData.Carrier) + } + if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin != "" && requestData.AwardTimeEnd == "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeBegin) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeBegin) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } else if requestData.AwardTimeBegin == "" && requestData.AwardTimeEnd != "" { + timeBegin := fmt.Sprintf("%v 00:00:00", requestData.AwardTimeEnd) + timeEnd := fmt.Sprintf("%v 23:59:59", requestData.AwardTimeEnd) + gormDb = gormDb.Where("`award_time` BETWEEN ?", timeBegin, timeEnd) + } + if requestData.Organize != "" { + gormDb = gormDb.Where("organization = ?", requestData.Organize) + } + if requestData.UserKey != "" { + gormDb = gormDb.Where("userid = ?", requestData.UserKey) + } + var total int64 + totalErr := gormDb.Count(&total).Error + if totalErr != nil { + total = 0 + } + gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize) + err := gormDb.Order("`id` DESC").Find(&honorsList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(honorsList)), honorsList, c) +} + +//添加荣誉 +func (a *ApiMethod) AddHonorCont(c *gin.Context) { + var requestData addHonorCont //添加荣誉字段 + c.ShouldBindJSON(&requestData) + if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + var uuId int64 = 0 + snowflakeId, snowflakeErr := snowflake.NewWorker(1) + if snowflakeErr != nil { + uuId = publicmethod.TableNumber() + } else { + uuId = snowflakeId.GetId() + } + var honorCont models.HonoraryArchives + honorCont.Id = uuId + honorCont.Name = requestData.Name //荣誉名称"` + honorCont.IssuingUnit = requestData.IssuingAgency //发放单位"` + honorCont.Carrier = int64(requestData.Carrier) //载体"` + awardTime, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + honorCont.AwardTime = awardTime //获奖时间"` + if requestData.EfficientDate != "" { + termvalidity, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if termvalidity <= awardTime { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } + honorCont.TermOfValidity = termvalidity //有效期限"` + } + + honorCont.Contet = requestData.Remark //备注"` + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + honorCont.Organization = organizationId //归属行政组织"` + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + honorCont.Userid = userId //归属人员"` + } + honorCont.Time = time.Now().Unix() //创建时间"` + honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + if len(requestData.ImgUrl) > 0 { + var imgList []models.PhotosGallery //图片档案 + for _, v := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = uuId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属哪个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgList = append(imgList, imgCont) + } + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if err := tx.Create(&honorCont).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + if err := tx.Create(&imgList).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + return nil + }) + if addErr != nil { + publicmethod.Result(104, addErr.Error(), c) + } else { + publicmethod.Result(0, addErr, c) + } + } else { + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&honorCont) + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } + } +} + +//编辑荣誉 +func (a *ApiMethod) EidyHonorCont(c *gin.Context) { + var requestData eidtHonorCont + c.ShouldBindJSON(&requestData) + if requestData.Id == "" || requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.Carrier == 0 { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + //原信息 + var honContOld models.HonoraryArchives + err := honContOld.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } + //要修改的内容 + saveData := publicmethod.MapOut[string]() + if requestData.Name != "" && requestData.Name != honContOld.Name { + saveData["name"] = requestData.Name + } + if requestData.IssuingAgency != "" && requestData.IssuingAgency != honContOld.IssuingUnit { + saveData["issuing_unit"] = requestData.IssuingAgency + } + if requestData.Carrier != honContOld.Carrier { + saveData["carrier"] = requestData.Carrier + } + var awardTime int64 = 0 + if requestData.AwardTime != "" { + awardTime, _ = publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.AwardTime)) + if awardTime != honContOld.AwardTime { + saveData["award_time"] = awardTime + } + } + if requestData.EfficientDate != "" { + efficientDate, _ := publicmethod.DateToTimeStamp(fmt.Sprintf("%v 12:00:00", requestData.EfficientDate)) + if efficientDate != honContOld.TermOfValidity { + if awardTime != 0 && awardTime >= efficientDate { + publicmethod.Result(1, requestData, c, "有效日期必须晚于获奖日期!") + return + } else { + saveData["award_time"] = efficientDate + } + + } + } + if requestData.Organize != "" { + organizationId, _ := strconv.ParseInt(requestData.Organize, 10, 64) + if organizationId != honContOld.Organization { + saveData["organization"] = organizationId + } + } + if requestData.UserKey != "" { + userId, _ := strconv.ParseInt(requestData.UserKey, 10, 64) + if userId != honContOld.Userid { + saveData["userid"] = userId + } + } + if requestData.Remark != "" && requestData.Remark != honContOld.Contet { + saveData["contet"] = requestData.Remark + } + var imgUrlListNoId []models.PhotosGallery + var pldImgId []int64 + if len(requestData.ImgUrl) > 0 { + for _, v := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } + } + + if len(imgUrlListNoId) > 0 { + var imgList models.PhotosGallery + saveErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Transaction(func(tx *gorm.DB) error { + if len(pldImgId) > 0 { + if err := tx.Not(map[string]interface{}{"`id`": pldImgId}).Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } else { + if err := tx.Where(map[string]interface{}{"`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList).Error; err != nil { + return err + } + } + + saveData["time"] = time.Now().Unix() + + if err := tx.Model(&models.HonoraryArchives{}).Where(where).Updates(&saveData).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + if err := tx.Create(&imgUrlListNoId).Error; err != nil { + // 返回任何错误都会回滚事务 + return err + } + + return nil + }) + if saveErr == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + + } else { + saveData["time"] = time.Now().Unix() + saveErr := honContOld.EiteCont(where, saveData) + if saveErr == nil { + var imgList models.PhotosGallery + if len(pldImgId) > 0 { + overall.CONSTANT_DB_MANAGE_ARCHIVES.Not(map[string]interface{}{"`id`": pldImgId, "`ascription_id`": requestData.Id, "`ascription_data_sheet`": "honorary_archives"}).Delete(&imgList) + } else { + imgList.DelCont(map[string]interface{}{"ascription_id": requestData.Id, "ascription_data_sheet": "honorary_archives"}) + } + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(106, err, c) + } + } +} + +//编辑状态 +func (a *ApiMethod) EidyHonorContState(c *gin.Context) { + var requestData publicmethod.PublicState + c.ShouldBindJSON(&requestData) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + if requestData.State == 0 { + requestData.State = 1 + } + if requestData.IsTrue == 0 { + requestData.IsTrue = 2 + } + where := publicmethod.MapOut[string]() + where["id"] = requestData.Id + var carrierTypeCont models.HonoraryArchives + judgeErr := carrierTypeCont.GetCont(where, "`id`") + if judgeErr != nil { + publicmethod.Result(107, judgeErr, c) + return + } + if requestData.State != 3 { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + if requestData.IsTrue == 1 { + err := carrierTypeCont.DelCont(where) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } else { + err := carrierTypeCont.EiteCont(where, map[string]interface{}{"`state`": requestData.State}) + if err != nil { + publicmethod.Result(106, err, c) + return + } + } + } + publicmethod.Result(0, carrierTypeCont, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729085406.go b/.history/api/version1/honoraryArchives/operate_photo_20220729085406.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729085612.go b/.history/api/version1/honoraryArchives/operate_photo_20220729085612.go new file mode 100644 index 0000000..87b893f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729085612.go @@ -0,0 +1 @@ +package honoraryArchives diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729085621.go b/.history/api/version1/honoraryArchives/operate_photo_20220729085621.go new file mode 100644 index 0000000..2e9e5f7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729085621.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +// 加载图片 diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729085623.go b/.history/api/version1/honoraryArchives/operate_photo_20220729085623.go new file mode 100644 index 0000000..119ff0d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729085623.go @@ -0,0 +1,5 @@ +package honoraryArchives + + +// 加载图片 +func \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729085628.go b/.history/api/version1/honoraryArchives/operate_photo_20220729085628.go new file mode 100644 index 0000000..ae0d610 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729085628.go @@ -0,0 +1,5 @@ +package honoraryArchives + + +// 加载图片 +func () \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729085638.go b/.history/api/version1/honoraryArchives/operate_photo_20220729085638.go new file mode 100644 index 0000000..87b893f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729085638.go @@ -0,0 +1 @@ +package honoraryArchives diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092055.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092055.go new file mode 100644 index 0000000..9f5843d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092055.go @@ -0,0 +1,3 @@ +package honoraryArchives + + diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092059.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092059.go new file mode 100644 index 0000000..568e398 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092059.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +func \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092120.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092120.go new file mode 100644 index 0000000..99fd9ca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092120.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +func Review images \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092122.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092122.go new file mode 100644 index 0000000..176f63b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092122.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +func ReviewImages \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092125.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092125.go new file mode 100644 index 0000000..87156c4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092125.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +func eeviewImages \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092127.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092127.go new file mode 100644 index 0000000..e2d27a5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092127.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +func reviewImages \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092130.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092130.go new file mode 100644 index 0000000..17cf880 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092130.go @@ -0,0 +1,4 @@ +package honoraryArchives + + +func reviewImages() \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092136.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092136.go new file mode 100644 index 0000000..7f1e602 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092136.go @@ -0,0 +1,3 @@ +package honoraryArchives + +func reviewImages(a ApiMethod) diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092139.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092139.go new file mode 100644 index 0000000..9bb3094 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092139.go @@ -0,0 +1,3 @@ +package honoraryArchives + +func reviewImages(a @ApiMethod) diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092140.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092140.go new file mode 100644 index 0000000..7f1e602 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092140.go @@ -0,0 +1,3 @@ +package honoraryArchives + +func reviewImages(a ApiMethod) diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092141.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092141.go new file mode 100644 index 0000000..fa9de03 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092141.go @@ -0,0 +1,3 @@ +package honoraryArchives + +func reviewImages(a *ApiMethod) diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092204.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092204.go new file mode 100644 index 0000000..58d763f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092204.go @@ -0,0 +1,5 @@ +package honoraryArchives + +func reviewImages(a *ApiMethod){ + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092210.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092210.go new file mode 100644 index 0000000..a7dd378 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092210.go @@ -0,0 +1,5 @@ +package honoraryArchives + +func (a *ApiMethod)reviewImages{ + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092216.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092216.go new file mode 100644 index 0000000..a98fa13 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092216.go @@ -0,0 +1,5 @@ +package honoraryArchives + +func (a *ApiMethod)reviewImages(c *gin.){ + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092329.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092329.go new file mode 100644 index 0000000..4bd9578 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092329.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092331.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092331.go new file mode 100644 index 0000000..d7bb7cf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092331.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { +`` +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092333.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092333.go new file mode 100644 index 0000000..bbedfc8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092333.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092528.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092528.go new file mode 100644 index 0000000..d6e8299 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092528.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092538.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092538.go new file mode 100644 index 0000000..04e38f0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092538.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData po +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092541.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092541.go new file mode 100644 index 0000000..922806d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092541.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData poto +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092543.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092543.go new file mode 100644 index 0000000..6e451e1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092543.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData PhotosGallery +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092559.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092559.go new file mode 100644 index 0000000..898cf0a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092559.go @@ -0,0 +1,7 @@ +package honoraryArchives + +import "github.com/gin-gonic/gin" + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData o +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092601.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092601.go new file mode 100644 index 0000000..0e64dad --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092601.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData overall. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092603.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092603.go new file mode 100644 index 0000000..0e64dad --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092603.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData overall. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092606.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092606.go new file mode 100644 index 0000000..0e64dad --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092606.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData overall. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092612.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092612.go new file mode 100644 index 0000000..58a9fb5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092612.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData me +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092616.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092616.go new file mode 100644 index 0000000..d91959e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092616.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092622.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092622.go new file mode 100644 index 0000000..7129e6d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092622.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092624.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092624.go new file mode 100644 index 0000000..a0605d4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092624.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092658.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092658.go new file mode 100644 index 0000000..a0605d4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092658.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092703.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092703.go new file mode 100644 index 0000000..476c2d8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092703.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092706.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092706.go new file mode 100644 index 0000000..49cbbe5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092706.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c.con +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729092708.go b/.history/api/version1/honoraryArchives/operate_photo_20220729092708.go new file mode 100644 index 0000000..a0605d4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729092708.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093032.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093032.go new file mode 100644 index 0000000..4c8c7e8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093032.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c.shoubui +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093033.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093033.go new file mode 100644 index 0000000..4ecc4bf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093033.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c.shoub +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093038.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093038.go new file mode 100644 index 0000000..685b308 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093038.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c.shouldbind +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093040.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093040.go new file mode 100644 index 0000000..ce7c29b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093040.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c.ShouldBindJSON() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093044.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093044.go new file mode 100644 index 0000000..310d0f7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093044.go @@ -0,0 +1,12 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData models.PhotosGallery + c.ShouldBindJSON(requestData) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093219.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093219.go new file mode 100644 index 0000000..b431ca7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093219.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093228.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093228.go new file mode 100644 index 0000000..d57d5cf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093228.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData ph +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093230.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093230.go new file mode 100644 index 0000000..c989b9d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093230.go @@ -0,0 +1,10 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093232.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093232.go new file mode 100644 index 0000000..177bd1d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093232.go @@ -0,0 +1,10 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093237.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093237.go new file mode 100644 index 0000000..22aeb9d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093237.go @@ -0,0 +1,10 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.shou +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093240.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093240.go new file mode 100644 index 0000000..5d0ab95 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093240.go @@ -0,0 +1,10 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093243.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093243.go new file mode 100644 index 0000000..6783759 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093243.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093244.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093244.go new file mode 100644 index 0000000..a030da9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093244.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729093311.go b/.history/api/version1/honoraryArchives/operate_photo_20220729093311.go new file mode 100644 index 0000000..6783759 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729093311.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729094010.go b/.history/api/version1/honoraryArchives/operate_photo_20220729094010.go new file mode 100644 index 0000000..f423a4a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729094010.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + c. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729094020.go b/.history/api/version1/honoraryArchives/operate_photo_20220729094020.go new file mode 100644 index 0000000..9942e30 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729094020.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + if requestData. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729094457.go b/.history/api/version1/honoraryArchives/operate_photo_20220729094457.go new file mode 100644 index 0000000..6783759 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729094457.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095039.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095039.go new file mode 100644 index 0000000..6783759 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095039.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095521.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095521.go new file mode 100644 index 0000000..6783759 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095521.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095537.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095537.go new file mode 100644 index 0000000..3f8e158 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095537.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095541.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095541.go new file mode 100644 index 0000000..8277edd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095541.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var phots +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095542.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095542.go new file mode 100644 index 0000000..4a79166 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095542.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var phot +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095548.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095548.go new file mode 100644 index 0000000..c634bde --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095548.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var photo_List +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095550.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095550.go new file mode 100644 index 0000000..5951a42 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095550.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095553.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095553.go new file mode 100644 index 0000000..d7d41e5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095553.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095555.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095555.go new file mode 100644 index 0000000..adf073d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095555.go @@ -0,0 +1,11 @@ +package honoraryArchives + +import ( + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List [] +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095559.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095559.go new file mode 100644 index 0000000..c5f3c1e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095559.go @@ -0,0 +1,13 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.g +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095600.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095600.go new file mode 100644 index 0000000..a707036 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095600.go @@ -0,0 +1,13 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095610.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095610.go new file mode 100644 index 0000000..31b8910 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095610.go @@ -0,0 +1,14 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095618.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095618.go new file mode 100644 index 0000000..31556ac --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095618.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095707.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095707.go new file mode 100644 index 0000000..0ea8732 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095707.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095719.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095719.go new file mode 100644 index 0000000..409ba39 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095719.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095722.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095722.go new file mode 100644 index 0000000..258967e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095722.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095727.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095727.go new file mode 100644 index 0000000..db99682 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095727.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&model.p) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095728.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095728.go new file mode 100644 index 0000000..b5efc65 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095728.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&model.ph) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095731.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095731.go new file mode 100644 index 0000000..c380ec6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095731.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&model.PhotosGallery) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095733.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095733.go new file mode 100644 index 0000000..5a9824e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095733.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095741.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095741.go new file mode 100644 index 0000000..be3ca0a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095741.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095753.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095753.go new file mode 100644 index 0000000..a8464b5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095753.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095834.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095834.go new file mode 100644 index 0000000..5128076 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095834.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("") +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095850.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095850.go new file mode 100644 index 0000000..aec63cc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095850.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095906.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095906.go new file mode 100644 index 0000000..f299aaf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095906.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + gormDboverall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095907.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095907.go new file mode 100644 index 0000000..7cb251f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095907.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095918.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095918.go new file mode 100644 index 0000000..5a2ac26 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095918.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明 + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095925.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095925.go new file mode 100644 index 0000000..aba012a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095925.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明ron + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095930.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095930.go new file mode 100644 index 0000000..ffed4ba --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095930.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) + var Photo_List []models.PhotosGallery + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095938.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095938.go new file mode 100644 index 0000000..946b6df --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095938.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行绑定 + var Photo_List []models.PhotosGallery + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729095959.go b/.history/api/version1/honoraryArchives/operate_photo_20220729095959.go new file mode 100644 index 0000000..ae77914 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729095959.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100005.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100005.go new file mode 100644 index 0000000..8436b8f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100005.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100009.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100009.go new file mode 100644 index 0000000..d58a742 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100009.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100015.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100015.go new file mode 100644 index 0000000..3157251 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100015.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100024.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100024.go new file mode 100644 index 0000000..cb121fc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100024.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获取 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100118.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100118.go new file mode 100644 index 0000000..cb121fc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100118.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获取 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100140.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100140.go new file mode 100644 index 0000000..e74a34d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100140.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100142.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100142.go new file mode 100644 index 0000000..cb121fc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100142.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获取 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100143.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100143.go new file mode 100644 index 0000000..98669da --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100143.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100145.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100145.go new file mode 100644 index 0000000..097fb78 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100145.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获取chu +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100157.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100157.go new file mode 100644 index 0000000..b95f8a0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100157.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获取除除删除 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100200.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100200.go new file mode 100644 index 0000000..ca7a7e2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100200.go @@ -0,0 +1,15 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) // 获取除了删除 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100205.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100205.go new file mode 100644 index 0000000..6c8737a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100205.go @@ -0,0 +1,16 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100224.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100224.go new file mode 100644 index 0000000..0d3ee0f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100224.go @@ -0,0 +1,16 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100533.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100533.go new file mode 100644 index 0000000..d606c10 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100533.go @@ -0,0 +1,16 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100535.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100535.go new file mode 100644 index 0000000..44789a0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100535.go @@ -0,0 +1,16 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100540.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100540.go new file mode 100644 index 0000000..021e184 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100540.go @@ -0,0 +1,16 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100551.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100551.go new file mode 100644 index 0000000..bdcc09e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100551.go @@ -0,0 +1,16 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" || requestData. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100619.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100619.go new file mode 100644 index 0000000..e6dcf1f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100619.go @@ -0,0 +1,18 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100628.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100628.go new file mode 100644 index 0000000..5c20109 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100628.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100649.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100649.go new file mode 100644 index 0000000..1ba36cc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100649.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100654.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100654.go new file mode 100644 index 0000000..1ba36cc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100654.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100703.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100703.go new file mode 100644 index 0000000..eb4421a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100703.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100705.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100705.go new file mode 100644 index 0000000..ec40402 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100705.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := p +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100707.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100707.go new file mode 100644 index 0000000..e30e1e3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100707.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100712.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100712.go new file mode 100644 index 0000000..94f6987 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100712.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[]() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100718.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100718.go new file mode 100644 index 0000000..73f2bb1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100718.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100722.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100722.go new file mode 100644 index 0000000..43c17f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100722.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100729.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100729.go new file mode 100644 index 0000000..43c17f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100729.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100734.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100734.go new file mode 100644 index 0000000..36b0d39 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100734.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100807.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100807.go new file mode 100644 index 0000000..270e7c9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100807.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" || requestData.{ + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100816.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100816.go new file mode 100644 index 0000000..1c982ef --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100816.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" || requestData{ + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100819.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100819.go new file mode 100644 index 0000000..36b0d39 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100819.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100844.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100844.go new file mode 100644 index 0000000..8c3fce4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100844.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100850.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100850.go new file mode 100644 index 0000000..24334c8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100850.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100852.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100852.go new file mode 100644 index 0000000..394d3f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100852.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where[""] + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100903.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100903.go new file mode 100644 index 0000000..377f630 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100903.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["AscriptionId"] = + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100908.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100908.go new file mode 100644 index 0000000..bcb2f43 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100908.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + where["AscriptionId"] = requestData.Id + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100928.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100928.go new file mode 100644 index 0000000..e209ce8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100928.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取 + where["AscriptionId"] = requestData.Id + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729100933.go b/.history/api/version1/honoraryArchives/operate_photo_20220729100933.go new file mode 100644 index 0000000..6b59500 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729100933.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101030.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101030.go new file mode 100644 index 0000000..f193b31 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101030.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101205.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101205.go new file mode 100644 index 0000000..542d423 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101205.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101208.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101208.go new file mode 100644 index 0000000..542d423 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101208.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101214.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101214.go new file mode 100644 index 0000000..f193b31 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101214.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101224.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101224.go new file mode 100644 index 0000000..542d423 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101224.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101226.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101226.go new file mode 100644 index 0000000..69a22a1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101226.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var p +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101231.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101231.go new file mode 100644 index 0000000..ea83ed5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101231.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photo +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101235.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101235.go new file mode 100644 index 0000000..ca2f569 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101235.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGallery +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101237.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101237.go new file mode 100644 index 0000000..d0810c6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101237.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryBy +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101531.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101531.go new file mode 100644 index 0000000..8ca1bb4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101531.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101536.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101536.go new file mode 100644 index 0000000..17330d9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101536.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId mode +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101541.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101541.go new file mode 100644 index 0000000..444b709 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101541.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId model +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101545.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101545.go new file mode 100644 index 0000000..0f0a95d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101545.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101546.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101546.go new file mode 100644 index 0000000..dc6de9a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101546.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101551.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101551.go new file mode 100644 index 0000000..2ed63aa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101551.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + photoGalleryByAscriptionId = +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101556.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101556.go new file mode 100644 index 0000000..2ed63aa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101556.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + photoGalleryByAscriptionId = +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101616.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101616.go new file mode 100644 index 0000000..6ddc0cf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101616.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + photoGalleryByAscriptionId.get +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101619.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101619.go new file mode 100644 index 0000000..6c34f25 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101619.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + photoGalleryByAscriptionId.GetCont(where) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101624.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101624.go new file mode 100644 index 0000000..dcea6d0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101624.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101628.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101628.go new file mode 100644 index 0000000..1f35aba --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101628.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) + if err != +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101630.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101630.go new file mode 100644 index 0000000..63d37bf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101630.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) + if err != nil { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101637.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101637.go new file mode 100644 index 0000000..cd37f19 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101637.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + retur + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101638.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101638.go new file mode 100644 index 0000000..21861f8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101638.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101652.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101652.go new file mode 100644 index 0000000..d87f220 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101652.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101655.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101655.go new file mode 100644 index 0000000..7d9baf0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101655.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) //g + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101657.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101657.go new file mode 100644 index 0000000..3a2e023 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101657.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) //根据 + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101750.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101750.go new file mode 100644 index 0000000..afa3353 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101750.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) //根据归属id获取图片 + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101752.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101752.go new file mode 100644 index 0000000..3777cd6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101752.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) //根据归属id获取图片 + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101754.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101754.go new file mode 100644 index 0000000..c421908 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101754.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := photoGalleryByAscriptionId.GetCont(where) //根据归属id获取图片 + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101841.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101841.go new file mode 100644 index 0000000..5117c84 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101841.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb. + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101843.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101843.go new file mode 100644 index 0000000..b9d909d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101843.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.ge + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101847.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101847.go new file mode 100644 index 0000000..a8d7317 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101847.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.fin + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729101848.go b/.history/api/version1/honoraryArchives/operate_photo_20220729101848.go new file mode 100644 index 0000000..7914dc9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729101848.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Find() + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102224.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102224.go new file mode 100644 index 0000000..c890210 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102224.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("") + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102231.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102231.go new file mode 100644 index 0000000..f7d3d5f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102231.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid") + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102233.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102233.go new file mode 100644 index 0000000..6ecc985 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102233.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ") + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102236.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102236.go new file mode 100644 index 0000000..5542af7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102236.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ".) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102238.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102238.go new file mode 100644 index 0000000..1ec3ad3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102238.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?".) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102239.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102239.go new file mode 100644 index 0000000..01c5982 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102239.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + where := publicmethod.MapOut[string]() + // 获取归属id + where["AscriptionId"] = requestData.Id + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?",) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102251.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102251.go new file mode 100644 index 0000000..5dc6e8e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102251.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?",) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102256.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102256.go new file mode 100644 index 0000000..601d66a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102256.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?", requestData.Id) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102304.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102304.go new file mode 100644 index 0000000..0e31f20 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102304.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?", requestData.Id).find + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102305.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102305.go new file mode 100644 index 0000000..a1d6a82 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102305.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?", requestData.Id).Find() + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102332.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102332.go new file mode 100644 index 0000000..b092b18 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102332.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?", requestData.Id).Find(&ph) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102333.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102333.go new file mode 100644 index 0000000..826c979 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102333.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102334.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102334.go new file mode 100644 index 0000000..826c979 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102334.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + err := gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102337.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102337.go new file mode 100644 index 0000000..287f01b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102337.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) + if err != nil { + publicmethod.Result(107, err, c) + return + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102346.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102346.go new file mode 100644 index 0000000..2cdf986 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102346.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) + + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102506.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102506.go new file mode 100644 index 0000000..a75c22d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102506.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) + for + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102510.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102510.go new file mode 100644 index 0000000..dd1dc95 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102510.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) + for + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102523.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102523.go new file mode 100644 index 0000000..340f306 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102523.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102538.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102538.go new file mode 100644 index 0000000..55378c7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102538.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102541.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102541.go new file mode 100644 index 0000000..5e561be --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102541.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102556.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102556.go new file mode 100644 index 0000000..5e561be --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102556.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102645.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102645.go new file mode 100644 index 0000000..23ecf00 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102645.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102652.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102652.go new file mode 100644 index 0000000..d9c7212 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102652.go @@ -0,0 +1,23 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) > 1 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102706.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102706.go new file mode 100644 index 0000000..bb0a428 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102706.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) > 1 { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102709.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102709.go new file mode 100644 index 0000000..1f7242a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102709.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) > 1 { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102718.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102718.go new file mode 100644 index 0000000..5ac247b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102718.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) < 1 { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102722.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102722.go new file mode 100644 index 0000000..73c801c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102722.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) <= 0 { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102737.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102737.go new file mode 100644 index 0000000..8453e98 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102737.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) <= 0 { + pub + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102739.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102739.go new file mode 100644 index 0000000..f26bdc9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102739.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) <= 0 { + publicmethod. + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102803.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102803.go new file mode 100644 index 0000000..73c801c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102803.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + gormDb.Where("ascriptionid = ?", requestData.Id).Find(&Photo_List) // 根据归属获取荣誉图片 + if len(Photo_List) <= 0 { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102823.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102823.go new file mode 100644 index 0000000..118df7a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102823.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + // var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102826.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102826.go new file mode 100644 index 0000000..729037d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102826.go @@ -0,0 +1,22 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + var Photo_List []models.PhotosGallery // 声明荣誉图片列表 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102830.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102830.go new file mode 100644 index 0000000..3102542 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102830.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state betweent ? and ?", 1, 2) + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102835.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102835.go new file mode 100644 index 0000000..ae3fb4f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102835.go @@ -0,0 +1,19 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102839.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102839.go new file mode 100644 index 0000000..3adc0f2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102839.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102840.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102840.go new file mode 100644 index 0000000..e5a740c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102840.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102842.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102842.go new file mode 100644 index 0000000..ae3fb4f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102842.go @@ -0,0 +1,19 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102843.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102843.go new file mode 100644 index 0000000..9ab8a3d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102843.go @@ -0,0 +1,19 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102852.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102852.go new file mode 100644 index 0000000..a92a62c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102852.go @@ -0,0 +1,19 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102900.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102900.go new file mode 100644 index 0000000..ca82564 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102900.go @@ -0,0 +1,19 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[]() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102905.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102905.go new file mode 100644 index 0000000..c1e8edc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102905.go @@ -0,0 +1,19 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[string]() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102906.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102906.go new file mode 100644 index 0000000..aae5d0a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102906.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[string]() + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102910.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102910.go new file mode 100644 index 0000000..7db709d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102910.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[string]() + where[""] +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102915.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102915.go new file mode 100644 index 0000000..4cc0285 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102915.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102917.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102917.go new file mode 100644 index 0000000..6f58703 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102917.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102919.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102919.go new file mode 100644 index 0000000..980ace8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102919.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = eq +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102922.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102922.go new file mode 100644 index 0000000..c0f8d54 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102922.go @@ -0,0 +1,20 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102923.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102923.go new file mode 100644 index 0000000..792fa0e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102923.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102926.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102926.go new file mode 100644 index 0000000..6917f77 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102926.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + po +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102929.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102929.go new file mode 100644 index 0000000..e48408f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102929.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + photoGalleryByAscriptionId. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102933.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102933.go new file mode 100644 index 0000000..2975101 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102933.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + photoGalleryByAscriptionId.GetCont(where) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102943.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102943.go new file mode 100644 index 0000000..2673ceb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102943.go @@ -0,0 +1,21 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102949.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102949.go new file mode 100644 index 0000000..9439bc7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102949.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err := nil{ + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102951.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102951.go new file mode 100644 index 0000000..9439bc7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102951.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err := nil{ + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102955.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102955.go new file mode 100644 index 0000000..6d8c54e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102955.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err = nil{ + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729102957.go b/.history/api/version1/honoraryArchives/operate_photo_20220729102957.go new file mode 100644 index 0000000..a551003 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729102957.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103000.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103000.go new file mode 100644 index 0000000..b115866 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103000.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103005.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103005.go new file mode 100644 index 0000000..1d1f767 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103005.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + publicmethod.re + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103009.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103009.go new file mode 100644 index 0000000..400582b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103009.go @@ -0,0 +1,24 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + publicmethod.Result(107) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103022.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103022.go new file mode 100644 index 0000000..2154897 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103022.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103032.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103032.go new file mode 100644 index 0000000..2154897 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103032.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103041.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103041.go new file mode 100644 index 0000000..a013b02 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103041.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103049.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103049.go new file mode 100644 index 0000000..c0d7274 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103049.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) // 根据 + if err != nil { + publicmethod.Result(107, err, c) + return + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103053.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103053.go new file mode 100644 index 0000000..d0fa465 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103053.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103055.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103055.go new file mode 100644 index 0000000..7974d45 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103055.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103057.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103057.go new file mode 100644 index 0000000..80edc15 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103057.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103208.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103208.go new file mode 100644 index 0000000..5e13211 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103208.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + p +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103211.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103211.go new file mode 100644 index 0000000..76327b2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103211.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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.re +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103213.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103213.go new file mode 100644 index 0000000..0d6343e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103213.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103220.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103220.go new file mode 100644 index 0000000..cb94178 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103220.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103224.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103224.go new file mode 100644 index 0000000..e509cee --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103224.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,req) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103228.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103228.go new file mode 100644 index 0000000..cba5cd8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103228.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,requestData) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103229.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103229.go new file mode 100644 index 0000000..4f64596 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103229.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,requestData,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103232.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103232.go new file mode 100644 index 0000000..d6842e7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103232.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103250.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103250.go new file mode 100644 index 0000000..570b59d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103250.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + + +func (a *ApiMethod) \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103255.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103255.go new file mode 100644 index 0000000..390796c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103255.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + + +func (a *ApiMethod) edit \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103300.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103300.go new file mode 100644 index 0000000..8eb54ca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103300.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImages(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + + +func (a *ApiMethod) editImage) \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103303.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103303.go new file mode 100644 index 0000000..d30f63d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103303.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + + +func (a *ApiMethod) editImage) \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103307.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103307.go new file mode 100644 index 0000000..a2f4d22 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103307.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + + +func (a *ApiMethod) editImage(c ) \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103310.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103310.go new file mode 100644 index 0000000..5cc05b9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103310.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +func (a *ApiMethod) editImage(c *gin.Context) diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103311.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103311.go new file mode 100644 index 0000000..7f9cbb8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103311.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +func (a *ApiMethod) editImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103314.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103314.go new file mode 100644 index 0000000..7f9cbb8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103314.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +func (a *ApiMethod) editImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103324.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103324.go new file mode 100644 index 0000000..9e9b426 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103324.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +func (a *ApiMethod) editImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103344.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103344.go new file mode 100644 index 0000000..5bec302 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103344.go @@ -0,0 +1,33 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103346.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103346.go new file mode 100644 index 0000000..f07c7d0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103346.go @@ -0,0 +1,32 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103357.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103357.go new file mode 100644 index 0000000..ed0d3fb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103357.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103359.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103359.go new file mode 100644 index 0000000..0a67eb2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103359.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) del diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103401.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103401.go new file mode 100644 index 0000000..38dd9a6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103401.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) de diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103403.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103403.go new file mode 100644 index 0000000..0a67eb2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103403.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) reviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) del diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103423.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103423.go new file mode 100644 index 0000000..0ac04b0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103423.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) editImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) del diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103425.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103425.go new file mode 100644 index 0000000..5d81448 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103425.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) del diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103428.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103428.go new file mode 100644 index 0000000..5f05534 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103428.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) Del diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103431.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103431.go new file mode 100644 index 0000000..a2af8a6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103431.go @@ -0,0 +1,36 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + + +// 删除图片 +func (a *ApiMethod) DelImage() diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103437.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103437.go new file mode 100644 index 0000000..c223c11 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103437.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103459.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103459.go new file mode 100644 index 0000000..c223c11 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103459.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103506.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103506.go new file mode 100644 index 0000000..c223c11 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103506.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729103516.go b/.history/api/version1/honoraryArchives/operate_photo_20220729103516.go new file mode 100644 index 0000000..c223c11 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729103516.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104344.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104344.go new file mode 100644 index 0000000..f3404dc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104344.go @@ -0,0 +1,38 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, requestData, c) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104414.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104414.go new file mode 100644 index 0000000..886384d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104414.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104422.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104422.go new file mode 100644 index 0000000..8da7d68 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104422.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + imgU +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104424.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104424.go new file mode 100644 index 0000000..065a00d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104424.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + imgUrlList +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104427.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104427.go new file mode 100644 index 0000000..838e2a4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104427.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + imgUrlList +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104433.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104433.go new file mode 100644 index 0000000..5f473c6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104433.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104500.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104500.go new file mode 100644 index 0000000..886384d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104500.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104822.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104822.go new file mode 100644 index 0000000..886384d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104822.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104825.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104825.go new file mode 100644 index 0000000..602ddc6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104825.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + var +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104826.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104826.go new file mode 100644 index 0000000..47ab3ae --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104826.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + var new +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104833.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104833.go new file mode 100644 index 0000000..1813c32 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104833.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + var newImage +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104835.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104835.go new file mode 100644 index 0000000..1802699 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104835.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + var newImage mode +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104839.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104839.go new file mode 100644 index 0000000..579af99 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104839.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + var newImage models. +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104843.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104843.go new file mode 100644 index 0000000..5f23b7f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104843.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + var newImage models.PhotosGallery +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104849.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104849.go new file mode 100644 index 0000000..886384d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104849.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104853.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104853.go new file mode 100644 index 0000000..872a9a8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104853.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + pu +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104855.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104855.go new file mode 100644 index 0000000..12efa8a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104855.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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.re +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104856.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104856.go new file mode 100644 index 0000000..66d7c6b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104856.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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() +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104858.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104858.go new file mode 100644 index 0000000..91a41e0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104858.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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(1) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104900.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104900.go new file mode 100644 index 0000000..e5ac4aa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104900.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104906.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104906.go new file mode 100644 index 0000000..b659e27 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104906.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,pho) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104908.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104908.go new file mode 100644 index 0000000..ebd7b96 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104908.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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,) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104909.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104909.go new file mode 100644 index 0000000..728c8e5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104909.go @@ -0,0 +1,37 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104922.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104922.go new file mode 100644 index 0000000..b88d6c0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104922.go @@ -0,0 +1,39 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104929.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104929.go new file mode 100644 index 0000000..bc085ec --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104929.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newI + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104932.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104932.go new file mode 100644 index 0000000..219ee0c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104932.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var new + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104936.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104936.go new file mode 100644 index 0000000..0b00a9f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104936.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPho + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104937.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104937.go new file mode 100644 index 0000000..93e8218 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104937.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPhoo + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104944.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104944.go new file mode 100644 index 0000000..ad8e214 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104944.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPhotoGalley + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104946.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104946.go new file mode 100644 index 0000000..7644e8e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104946.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPhotoGalley mode + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104951.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104951.go new file mode 100644 index 0000000..57ce6fd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104951.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPhotoGalley models.PhotosGallery + new + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729104956.go b/.history/api/version1/honoraryArchives/operate_photo_20220729104956.go new file mode 100644 index 0000000..6c9bd15 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729104956.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPhotoGalley models.PhotosGallery{ + + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105004.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105004.go new file mode 100644 index 0000000..6c9bd15 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105004.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + var newPhotoGalley models.PhotosGallery{ + + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105007.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105007.go new file mode 100644 index 0000000..82bf0b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105007.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105010.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105010.go new file mode 100644 index 0000000..82bf0b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105010.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105015.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105015.go new file mode 100644 index 0000000..82bf0b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105015.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105017.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105017.go new file mode 100644 index 0000000..be665b1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105017.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 + } + + phot + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105027.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105027.go new file mode 100644 index 0000000..708e4e9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105027.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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.u + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105028.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105028.go new file mode 100644 index 0000000..8f6118d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105028.go @@ -0,0 +1,40 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105033.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105033.go new file mode 100644 index 0000000..dca31a8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105033.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105035.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105035.go new file mode 100644 index 0000000..b104d3f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105035.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, photoGalleryByAscriptionId, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105038.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105038.go new file mode 100644 index 0000000..4dd1f28 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105038.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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, pho, c) // 将查询结果返回 +} + +// 编辑图片 +func (a *ApiMethod) EditImage(c *gin.Context) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105039.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105039.go new file mode 100644 index 0000000..158f998 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105039.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105046.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105046.go new file mode 100644 index 0000000..efdb5ee --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105046.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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) { + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105141.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105141.go new file mode 100644 index 0000000..35f9077 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105141.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105144.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105144.go new file mode 100644 index 0000000..45718cb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105144.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 pho +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105145.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105145.go new file mode 100644 index 0000000..00b6914 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105145.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoListKey //声明荣誉查询字段 + 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 photoListKey +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105342.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105342.go new file mode 100644 index 0000000..bf2c626 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105342.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 photoListKey +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105347.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105347.go new file mode 100644 index 0000000..6c2d0c4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105347.go @@ -0,0 +1,41 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105402.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105402.go new file mode 100644 index 0000000..8854c4d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105402.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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.show +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105408.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105408.go new file mode 100644 index 0000000..f9eb81d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105408.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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() +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105411.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105411.go new file mode 100644 index 0000000..76ff2fd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105411.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉查询字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105415.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105415.go new file mode 100644 index 0000000..765b35a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105415.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105425.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105425.go new file mode 100644 index 0000000..3266647 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105425.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105429.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105429.go new file mode 100644 index 0000000..d9c8cca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105429.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105431.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105431.go new file mode 100644 index 0000000..5498ca2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105431.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105433.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105433.go new file mode 100644 index 0000000..7424c2e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105433.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105437.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105437.go new file mode 100644 index 0000000..353fcef --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105437.go @@ -0,0 +1,42 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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绑定 +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105441.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105441.go new file mode 100644 index 0000000..22775bc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105441.go @@ -0,0 +1,43 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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绑定 + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729105509.go b/.history/api/version1/honoraryArchives/operate_photo_20220729105509.go new file mode 100644 index 0000000..5e55379 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729105509.go @@ -0,0 +1,43 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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绑定 + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113035.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113035.go new file mode 100644 index 0000000..22775bc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113035.go @@ -0,0 +1,43 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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绑定 + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113038.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113038.go new file mode 100644 index 0000000..e0378da --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113038.go @@ -0,0 +1,43 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113043.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113043.go new file mode 100644 index 0000000..5df0af2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113043.go @@ -0,0 +1,43 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113047.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113047.go new file mode 100644 index 0000000..b93750d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113047.go @@ -0,0 +1,45 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == ""{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113053.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113053.go new file mode 100644 index 0000000..987aecb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113053.go @@ -0,0 +1,45 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ur{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113054.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113054.go new file mode 100644 index 0000000..a3701e0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113054.go @@ -0,0 +1,45 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ImgUrl{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113103.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113103.go new file mode 100644 index 0000000..ad9036a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113103.go @@ -0,0 +1,45 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ImgUrl == "" || requestData.{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113116.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113116.go new file mode 100644 index 0000000..ad9036a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113116.go @@ -0,0 +1,45 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ImgUrl == "" || requestData.{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113205.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113205.go new file mode 100644 index 0000000..22e8b8e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113205.go @@ -0,0 +1,45 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ImgUrl == "" || requestData.I{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113212.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113212.go new file mode 100644 index 0000000..f3dfa32 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113212.go @@ -0,0 +1,46 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ImgUrl == ""{ + + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113224.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113224.go new file mode 100644 index 0000000..c0a22ff --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113224.go @@ -0,0 +1,46 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == "" || requestData.ImgUrl == ""{ + publicmethod.Result(101,requestData,c) + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113233.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113233.go new file mode 100644 index 0000000..3fa739a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113233.go @@ -0,0 +1,46 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 == ""{ + publicmethod.Result(101,requestData,c) + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113235.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113235.go new file mode 100644 index 0000000..fc1f293 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113235.go @@ -0,0 +1,46 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) == ""{ + publicmethod.Result(101,requestData,c) + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113238.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113238.go new file mode 100644 index 0000000..de015ad --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113238.go @@ -0,0 +1,46 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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) + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113243.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113243.go new file mode 100644 index 0000000..3b7436a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113243.go @@ -0,0 +1,46 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113245.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113245.go new file mode 100644 index 0000000..61619e7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113245.go @@ -0,0 +1,47 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113300.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113300.go new file mode 100644 index 0000000..23e0113 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113300.go @@ -0,0 +1,48 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113302.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113302.go new file mode 100644 index 0000000..863f470 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113302.go @@ -0,0 +1,49 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113305.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113305.go new file mode 100644 index 0000000..b2820f3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113305.go @@ -0,0 +1,49 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + // +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113312.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113312.go new file mode 100644 index 0000000..2a3aa8f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113312.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + // 原始图片信息 + old +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113318.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113318.go new file mode 100644 index 0000000..4810abd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113318.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + // 原始图片信息 + oldImage := +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113332.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113332.go new file mode 100644 index 0000000..1106a81 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113332.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113334.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113334.go new file mode 100644 index 0000000..7572563 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113334.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 me +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113337.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113337.go new file mode 100644 index 0000000..0fed72f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113337.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 mo +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113339.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113339.go new file mode 100644 index 0000000..647633e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113339.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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. +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113340.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113340.go new file mode 100644 index 0000000..fea04a0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113340.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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.m +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113341.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113341.go new file mode 100644 index 0000000..647633e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113341.go @@ -0,0 +1,50 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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. +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113354.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113354.go new file mode 100644 index 0000000..532712e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113354.go @@ -0,0 +1,51 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + oldImage.GetCont(where) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113401.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113401.go new file mode 100644 index 0000000..84c2159 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113401.go @@ -0,0 +1,54 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + if err != nil { + publicmethod.Result(107, err, c) + return + }oldImage.GetCont(where) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113402.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113402.go new file mode 100644 index 0000000..84c2159 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113402.go @@ -0,0 +1,54 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + if err != nil { + publicmethod.Result(107, err, c) + return + }oldImage.GetCont(where) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113405.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113405.go new file mode 100644 index 0000000..532712e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113405.go @@ -0,0 +1,51 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + oldImage.GetCont(where) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113406.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113406.go new file mode 100644 index 0000000..5534b61 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113406.go @@ -0,0 +1,55 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + oldImage.GetCont(where) + if err != nil { + publicmethod.Result(107, err, c) + return + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113409.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113409.go new file mode 100644 index 0000000..ef4ae31 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113409.go @@ -0,0 +1,55 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113426.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113426.go new file mode 100644 index 0000000..c943efc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113426.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113559.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113559.go new file mode 100644 index 0000000..a9bf0f9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113559.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + if +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113600.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113600.go new file mode 100644 index 0000000..c943efc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113600.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113632.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113632.go new file mode 100644 index 0000000..0e04435 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113632.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113634.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113634.go new file mode 100644 index 0000000..a322d82 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113634.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value := +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113636.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113636.go new file mode 100644 index 0000000..986859f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113636.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value := req +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113637.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113637.go new file mode 100644 index 0000000..4583af9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113637.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value := re +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113641.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113641.go new file mode 100644 index 0000000..e74bf37 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113641.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value := request +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113645.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113645.go new file mode 100644 index 0000000..677ca2c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113645.go @@ -0,0 +1,56 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value := requestData. +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113650.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113650.go new file mode 100644 index 0000000..9007996 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113650.go @@ -0,0 +1,58 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _,value := requestData.ImgUrl{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113656.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113656.go new file mode 100644 index 0000000..bb90693 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113656.go @@ -0,0 +1,58 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := requestData.ImgUrl{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113706.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113706.go new file mode 100644 index 0000000..d17b5b9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113706.go @@ -0,0 +1,58 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := requestData.ImgUrl{ + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113716.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113716.go new file mode 100644 index 0000000..af7fce7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113716.go @@ -0,0 +1,58 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113718.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113718.go new file mode 100644 index 0000000..a3e996e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113718.go @@ -0,0 +1,58 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113743.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113743.go new file mode 100644 index 0000000..76d8900 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113743.go @@ -0,0 +1,74 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + if v.Id != "" { + oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + pldImgId = append(pldImgId, oldIdInt) + } + } else { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113809.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113809.go new file mode 100644 index 0000000..9ac2951 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113809.go @@ -0,0 +1,74 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // if v.Id != "" { + // oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + // if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + // pldImgId = append(pldImgId, oldIdInt) + // } + // } else { + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + // } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113825.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113825.go new file mode 100644 index 0000000..7932811 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113825.go @@ -0,0 +1,77 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // if v.Id != "" { + // oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + // if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + // pldImgId = append(pldImgId, oldIdInt) + // } + // } else { + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + // } +} + + + + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113828.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113828.go new file mode 100644 index 0000000..76c9323 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113828.go @@ -0,0 +1,75 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // if v.Id != "" { + // oldIdInt, _ := strconv.ParseInt(v.Id, 10, 64) + // if publicmethod.IsInTrue[int64](oldIdInt, pldImgId) == false { + // pldImgId = append(pldImgId, oldIdInt) + // } + // } else { + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + // } +} + + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113900.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113900.go new file mode 100644 index 0000000..5f3466b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113900.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // } else { + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + // } +} + + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113903.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113903.go new file mode 100644 index 0000000..d8a3041 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113903.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + // } +} + + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113906.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113906.go new file mode 100644 index 0000000..85b9465 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113906.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + // +} + + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113912.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113912.go new file mode 100644 index 0000000..606f792 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113912.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113916.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113916.go new file mode 100644 index 0000000..cd54a73 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113916.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + // var imgCont models.PhotosGallery + // imgCont.Url = v.Url //图片地址"` + // imgCont.ImgPath = v.Imgpath //物理地址"` + // imgCont.Name = v.Name //文档名称"` + // imgCont.FileSize = v.FileSize //文档大小"` + // imgCont.Time = time.Now().Unix() //创建时间"` + // imgCont.AscriptionId = honContOld.Id //归属"` + // imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + // imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + // imgUrlListNoId = append(imgUrlListNoId, imgCont) + // } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113922.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113922.go new file mode 100644 index 0000000..0640a79 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113922.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113923.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113923.go new file mode 100644 index 0000000..0640a79 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113923.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = v.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113928.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113928.go new file mode 100644 index 0000000..746d5f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113928.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = v.Imgpath //物理地址"` + imgCont.Name = v.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113930.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113930.go new file mode 100644 index 0000000..c4f073a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113930.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = v.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113931.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113931.go new file mode 100644 index 0000000..045e6dc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113931.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113935.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113935.go new file mode 100644 index 0000000..045e6dc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113935.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113939.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113939.go new file mode 100644 index 0000000..045e6dc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113939.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId 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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + } +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729113943.go b/.history/api/version1/honoraryArchives/operate_photo_20220729113943.go new file mode 100644 index 0000000..fce216d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729113943.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = honContOld.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114015.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114015.go new file mode 100644 index 0000000..d7d12ed --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114015.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = im.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114018.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114018.go new file mode 100644 index 0000000..a332fc1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114018.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = imgurl.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114022.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114022.go new file mode 100644 index 0000000..1ff6fc8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114022.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114025.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114025.go new file mode 100644 index 0000000..2bf9ddb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114025.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = re //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114027.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114027.go new file mode 100644 index 0000000..bdef68e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114027.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = requ //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114030.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114030.go new file mode 100644 index 0000000..872fb85 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114030.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114045.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114045.go new file mode 100644 index 0000000..c1bacab --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114045.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = stri requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114047.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114047.go new file mode 100644 index 0000000..c983496 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114047.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strig requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114053.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114053.go new file mode 100644 index 0000000..2efd446 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114053.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = stco requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114059.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114059.go new file mode 100644 index 0000000..9096e53 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114059.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv. requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114103.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114103.go new file mode 100644 index 0000000..f199c26 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114103.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.at requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114104.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114104.go new file mode 100644 index 0000000..9096e53 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114104.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv. requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114109.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114109.go new file mode 100644 index 0000000..c6971bd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114109.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.int requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114120.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114120.go new file mode 100644 index 0000000..0953bf3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114120.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt() requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114122.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114122.go new file mode 100644 index 0000000..07a73bf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114122.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114127.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114127.go new file mode 100644 index 0000000..d845728 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114127.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id,) //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114133.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114133.go new file mode 100644 index 0000000..12d383b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114133.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id,10,) //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114134.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114134.go new file mode 100644 index 0000000..3a0ce69 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114134.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id,10,64) //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114135.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114135.go new file mode 100644 index 0000000..b047757 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114135.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id, 10, 64) //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114147.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114147.go new file mode 100644 index 0000000..ec7bd67 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114147.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id, 64) //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114232.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114232.go new file mode 100644 index 0000000..b047757 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114232.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = strconv.ParseInt(requestData.Id, 10, 64) //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114239.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114239.go new file mode 100644 index 0000000..be691ea --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114239.go @@ -0,0 +1,70 @@ +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 + } + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114241.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114241.go new file mode 100644 index 0000000..3262704 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114241.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 + } + for _, value := range requestData.ImgUrl { + strconv.ParseInt(requestData.Id, 10, 64) + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114246.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114246.go new file mode 100644 index 0000000..d92e6c2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114246.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 + } + for _, value := range requestData.ImgUrl { + id,strconv.ParseInt(requestData.Id, 10, 64) + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114248.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114248.go new file mode 100644 index 0000000..51e6d38 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114248.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 + } + for _, value := range requestData.ImgUrl { + id,err := strconv.ParseInt(requestData.Id, 10, 64) + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114259.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114259.go new file mode 100644 index 0000000..a506015 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114259.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 + } + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114302.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114302.go new file mode 100644 index 0000000..fc59cf5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114302.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 + } + id,err := strconv.ParseInt(requestData.Id, 10, 64) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114312.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114312.go new file mode 100644 index 0000000..15c85d8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114312.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 + } + id,_ := strconv.ParseInt(requestData.Id, 10, 64) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114313.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114313.go new file mode 100644 index 0000000..15c85d8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114313.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 + } + id,_ := strconv.ParseInt(requestData.Id, 10, 64) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114317.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114317.go new file mode 100644 index 0000000..d0efc3d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114317.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 + } + id, _ := strconv.ParseInt(requestData.Id, 10, 64) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + imgUrlListNoId = append(imgUrlListNoId, imgCont) + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114324.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114324.go new file mode 100644 index 0000000..d48066a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114324.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 + } + id, _ := strconv.ParseInt(requestData.Id, 10, 64) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114331.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114331.go new file mode 100644 index 0000000..6df1380 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114331.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) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114332.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114332.go new file mode 100644 index 0000000..ba89d40 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114332.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) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = id //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114337.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114337.go new file mode 100644 index 0000000..9b19f36 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114337.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) + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114339.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114339.go new file mode 100644 index 0000000..97e26d1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114339.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) // + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114342.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114342.go new file mode 100644 index 0000000..13c24af --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114342.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 + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114350.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114350.go new file mode 100644 index 0000000..2b77a78 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114350.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转为int + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114354.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114354.go new file mode 100644 index 0000000..5399101 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114354.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类型 + + for _, value := range requestData.ImgUrl { + + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114545.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114545.go new file mode 100644 index 0000000..f261d1b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114545.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类型 + + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114555.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114555.go new file mode 100644 index 0000000..6f9a6b4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114555.go @@ -0,0 +1,70 @@ +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类型 + + for _, value := range requestData.ImgUrl { + + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114557.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114557.go new file mode 100644 index 0000000..f261d1b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114557.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类型 + + for _, value := range requestData.ImgUrl { + var imgCont models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114604.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114604.go new file mode 100644 index 0000000..6c75d31 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114604.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类型 + + for _, value := range requestData.ImgUrl { + var newImage models.PhotosGallery + imgCont.Url = value.Url //图片地址"` + imgCont.ImgPath = value.Imgpath //物理地址"` + imgCont.Name = value.Name //文档名称"` + imgCont.FileSize = value.FileSize //文档大小"` + imgCont.Time = time.Now().Unix() //创建时间"` + imgCont.AscriptionId = ascriptionId //归属"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114610.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114610.go new file mode 100644 index 0000000..0a8761a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114610.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类型 + + 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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114640.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114640.go new file mode 100644 index 0000000..7adb7bf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114640.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类型 + + 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:删除)"` + } + + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114826.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114826.go new file mode 100644 index 0000000..0a8761a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114826.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类型 + + 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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114829.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114829.go new file mode 100644 index 0000000..7adb7bf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114829.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类型 + + 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:删除)"` + } + + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114841.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114841.go new file mode 100644 index 0000000..0a8761a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114841.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类型 + + 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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114843.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114843.go new file mode 100644 index 0000000..c8da730 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114843.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类型 + + 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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114845.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114845.go new file mode 100644 index 0000000..18d2947 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114845.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类型 + + 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:删除)"` + } + + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114847.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114847.go new file mode 100644 index 0000000..7adb7bf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114847.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类型 + + 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:删除)"` + } + + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114849.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114849.go new file mode 100644 index 0000000..1bc5ded --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114849.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类型 + + 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:删除)"` + } + new + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114855.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114855.go new file mode 100644 index 0000000..0a8761a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114855.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类型 + + 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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114858.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114858.go new file mode 100644 index 0000000..79565be --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114858.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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114901.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114901.go new file mode 100644 index 0000000..dad6693 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114901.go @@ -0,0 +1,70 @@ +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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114904.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114904.go new file mode 100644 index 0000000..ab59c6f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114904.go @@ -0,0 +1,70 @@ +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:删除)"` + } + +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114907.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114907.go new file mode 100644 index 0000000..4deb121 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114907.go @@ -0,0 +1,70 @@ +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:删除)"` + } + newImage. +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114909.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114909.go new file mode 100644 index 0000000..5645dff --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114909.go @@ -0,0 +1,70 @@ +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:删除)"` + } + newImage.c +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114911.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114911.go new file mode 100644 index 0000000..9494597 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114911.go @@ -0,0 +1,70 @@ +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:删除)"` + } + newImage.EiteCont() +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114941.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114941.go new file mode 100644 index 0000000..5a3bfc8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114941.go @@ -0,0 +1,70 @@ +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:删除)"` + } + newImage.EiteCont(where,) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114945.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114945.go new file mode 100644 index 0000000..c9e475c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114945.go @@ -0,0 +1,70 @@ +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:删除)"` + } + newImage.EiteCont(where,new) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114947.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114947.go new file mode 100644 index 0000000..d12e8c0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114947.go @@ -0,0 +1,70 @@ +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:删除)"` + } + newImage.EiteCont(where,newImage) +} + +// 删除图片 +func (a *ApiMethod) DelImage(c *gin.Context) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114951.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114951.go new file mode 100644 index 0000000..dcdd5f7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114951.go @@ -0,0 +1,70 @@ +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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114954.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114954.go new file mode 100644 index 0000000..5442e08 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114954.go @@ -0,0 +1,70 @@ +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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220729114955.go b/.history/api/version1/honoraryArchives/operate_photo_20220729114955.go new file mode 100644 index 0000000..2ab7df3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220729114955.go @@ -0,0 +1,70 @@ +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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730075728.go b/.history/api/version1/honoraryArchives/operate_photo_20220730075728.go new file mode 100644 index 0000000..912a91c --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730080540.go b/.history/api/version1/honoraryArchives/operate_photo_20220730080540.go new file mode 100644 index 0000000..ec6b229 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730080546.go b/.history/api/version1/honoraryArchives/operate_photo_20220730080546.go new file mode 100644 index 0000000..5a2928d --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730080550.go b/.history/api/version1/honoraryArchives/operate_photo_20220730080550.go new file mode 100644 index 0000000..72cb2cc --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730081213.go b/.history/api/version1/honoraryArchives/operate_photo_20220730081213.go new file mode 100644 index 0000000..5a2928d --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730081323.go b/.history/api/version1/honoraryArchives/operate_photo_20220730081323.go new file mode 100644 index 0000000..df4ea25 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730081335.go b/.history/api/version1/honoraryArchives/operate_photo_20220730081335.go new file mode 100644 index 0000000..ebff995 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730081338.go b/.history/api/version1/honoraryArchives/operate_photo_20220730081338.go new file mode 100644 index 0000000..5a2928d --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730081813.go b/.history/api/version1/honoraryArchives/operate_photo_20220730081813.go new file mode 100644 index 0000000..ec6b229 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082047.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082047.go new file mode 100644 index 0000000..319a614 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082049.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082049.go new file mode 100644 index 0000000..3fd323e --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082051.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082051.go new file mode 100644 index 0000000..f863541 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082053.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082053.go new file mode 100644 index 0000000..a148368 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082054.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082054.go new file mode 100644 index 0000000..dbdd5d9 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082058.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082058.go new file mode 100644 index 0000000..1df9b3f --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082100.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082100.go new file mode 100644 index 0000000..6266ec4 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082103.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082103.go new file mode 100644 index 0000000..87da116 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082230.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082230.go new file mode 100644 index 0000000..b343ab7 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082232.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082232.go new file mode 100644 index 0000000..59db83d --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082237.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082237.go new file mode 100644 index 0000000..ebba598 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082243.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082243.go new file mode 100644 index 0000000..9f44047 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082245.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082245.go new file mode 100644 index 0000000..cdb9598 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082246.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082246.go new file mode 100644 index 0000000..f9e8387 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082248.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082248.go new file mode 100644 index 0000000..0f09a18 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082255.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082255.go new file mode 100644 index 0000000..5f683e2 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082256.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082256.go new file mode 100644 index 0000000..0f09a18 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082300.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082300.go new file mode 100644 index 0000000..9f926e9 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082305.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082305.go new file mode 100644 index 0000000..452cdb2 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082306.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082306.go new file mode 100644 index 0000000..1a405c2 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082313.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082313.go new file mode 100644 index 0000000..73b6752 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082316.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082316.go new file mode 100644 index 0000000..f62782f --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082326.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082326.go new file mode 100644 index 0000000..95ef1d5 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082408.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082408.go new file mode 100644 index 0000000..3a1c687 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082415.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082415.go new file mode 100644 index 0000000..43e7727 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082422.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082422.go new file mode 100644 index 0000000..5155f62 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082423.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082423.go new file mode 100644 index 0000000..5155f62 --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082612.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082612.go new file mode 100644 index 0000000..4ac1f1e --- /dev/null +++ b/.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) { + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082623.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082623.go new file mode 100644 index 0000000..e92e13e --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082631.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082631.go new file mode 100644 index 0000000..31bb717 --- /dev/null +++ b/.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 + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082636.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082636.go new file mode 100644 index 0000000..d383062 --- /dev/null +++ b/.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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082639.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082639.go new file mode 100644 index 0000000..31bb717 --- /dev/null +++ b/.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 + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082656.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082656.go new file mode 100644 index 0000000..c7719b3 --- /dev/null +++ b/.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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082706.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082706.go new file mode 100644 index 0000000..37e3275 --- /dev/null +++ b/.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 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082715.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082715.go new file mode 100644 index 0000000..41d30d7 --- /dev/null +++ b/.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. +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082716.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082716.go new file mode 100644 index 0000000..234d272 --- /dev/null +++ b/.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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082719.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082719.go new file mode 100644 index 0000000..02be63e --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082720.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082720.go new file mode 100644 index 0000000..02be63e --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082723.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082723.go new file mode 100644 index 0000000..7873eb6 --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082733.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082733.go new file mode 100644 index 0000000..e053d02 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082736.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082736.go new file mode 100644 index 0000000..1485bfb --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082741.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082741.go new file mode 100644 index 0000000..42cff82 --- /dev/null +++ b/.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 + } + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082744.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082744.go new file mode 100644 index 0000000..b1a7dcf --- /dev/null +++ b/.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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082751.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082751.go new file mode 100644 index 0000000..d24b95d --- /dev/null +++ b/.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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082753.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082753.go new file mode 100644 index 0000000..c9ee103 --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082811.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082811.go new file mode 100644 index 0000000..5e8045e --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082817.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082817.go new file mode 100644 index 0000000..eb319a6 --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730082821.go b/.history/api/version1/honoraryArchives/operate_photo_20220730082821.go new file mode 100644 index 0000000..4b8bb39 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083119.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083119.go new file mode 100644 index 0000000..71d8032 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083120.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083120.go new file mode 100644 index 0000000..71d8032 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083124.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083124.go new file mode 100644 index 0000000..4b8bb39 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083128.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083128.go new file mode 100644 index 0000000..22916b7 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083131.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083131.go new file mode 100644 index 0000000..28b59b8 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083144.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083144.go new file mode 100644 index 0000000..ab321c2 --- /dev/null +++ b/.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 + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083152.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083152.go new file mode 100644 index 0000000..0a28a8b --- /dev/null +++ b/.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 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083155.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083155.go new file mode 100644 index 0000000..2209e58 --- /dev/null +++ b/.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() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083204.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083204.go new file mode 100644 index 0000000..fe49745 --- /dev/null +++ b/.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,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083209.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083209.go new file mode 100644 index 0000000..d17c6fe --- /dev/null +++ b/.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,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083210.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083210.go new file mode 100644 index 0000000..65ac1fe --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083315.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083315.go new file mode 100644 index 0000000..a08c673 --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083318.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083318.go new file mode 100644 index 0000000..a08c673 --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730083347.go b/.history/api/version1/honoraryArchives/operate_photo_20220730083347.go new file mode 100644 index 0000000..a08c673 --- /dev/null +++ b/.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) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084015.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084015.go new file mode 100644 index 0000000..c453f40 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084018.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084018.go new file mode 100644 index 0000000..72e51be --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084028.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084028.go new file mode 100644 index 0000000..a9016dc --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084040.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084040.go new file mode 100644 index 0000000..39690fa --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084042.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084042.go new file mode 100644 index 0000000..b956405 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084046.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084046.go new file mode 100644 index 0000000..7e4072f --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084048.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084048.go new file mode 100644 index 0000000..7f71aaf --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084049.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084049.go new file mode 100644 index 0000000..352bfb2 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084051.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084051.go new file mode 100644 index 0000000..a0697c0 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084103.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084103.go new file mode 100644 index 0000000..26f1376 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084124.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084124.go new file mode 100644 index 0000000..30654db --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084153.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084153.go new file mode 100644 index 0000000..30654db --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084308.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084308.go new file mode 100644 index 0000000..812a6c4 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084310.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084310.go new file mode 100644 index 0000000..f57b342 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084349.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084349.go new file mode 100644 index 0000000..51c5e9f --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084357.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084357.go new file mode 100644 index 0000000..9a4133e --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084359.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084359.go new file mode 100644 index 0000000..87d048c --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084407.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084407.go new file mode 100644 index 0000000..87d048c --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084413.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084413.go new file mode 100644 index 0000000..9664cb2 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084423.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084423.go new file mode 100644 index 0000000..9a4133e --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084431.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084431.go new file mode 100644 index 0000000..f57b342 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084447.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084447.go new file mode 100644 index 0000000..c4e800a --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084451.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084451.go new file mode 100644 index 0000000..ecffb71 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084457.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084457.go new file mode 100644 index 0000000..36d3487 --- /dev/null +++ b/.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) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084632.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084632.go new file mode 100644 index 0000000..3be80d9 --- /dev/null +++ b/.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) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084636.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084636.go new file mode 100644 index 0000000..42bef1d --- /dev/null +++ b/.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) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084640.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084640.go new file mode 100644 index 0000000..6d9e373 --- /dev/null +++ b/.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) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084647.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084647.go new file mode 100644 index 0000000..66a276c --- /dev/null +++ b/.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) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084653.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084653.go new file mode 100644 index 0000000..66a276c --- /dev/null +++ b/.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) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084727.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084727.go new file mode 100644 index 0000000..75d5e2a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084727.go @@ -0,0 +1,91 @@ +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) + where[] + + // err := photoGalleryByAscriptionId.DelCont(where) + // if err == nil { + // publicmethod.Result(0, err, c) + // } else { + // publicmethod.Result(108, err, c) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084736.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084736.go new file mode 100644 index 0000000..e4747bb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084736.go @@ -0,0 +1,91 @@ +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) + where["ImgPath"] + + // err := photoGalleryByAscriptionId.DelCont(where) + // if err == nil { + // publicmethod.Result(0, err, c) + // } else { + // publicmethod.Result(108, err, c) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084742.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084742.go new file mode 100644 index 0000000..e40baa8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084742.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] + + // err := photoGalleryByAscriptionId.DelCont(where) + // if err == nil { + // publicmethod.Result(0, err, c) + // } else { + // publicmethod.Result(108, err, c) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084743.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084743.go new file mode 100644 index 0000000..60f64b9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084743.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] = req + + // err := photoGalleryByAscriptionId.DelCont(where) + // if err == nil { + // publicmethod.Result(0, err, c) + // } else { + // publicmethod.Result(108, err, c) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084749.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084749.go new file mode 100644 index 0000000..4071289 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084749.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] = photoGalleryByAscriptionId. + + // err := photoGalleryByAscriptionId.DelCont(where) + // if err == nil { + // publicmethod.Result(0, err, c) + // } else { + // publicmethod.Result(108, err, c) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084752.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084752.go new file mode 100644 index 0000000..6270045 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084752.go @@ -0,0 +1,92 @@ +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + + + // err := photoGalleryByAscriptionId.DelCont(where) + // if err == nil { + // publicmethod.Result(0, err, c) + // } else { + // publicmethod.Result(108, err, c) + // } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084758.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084758.go new file mode 100644 index 0000000..2a4a0aa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084758.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + + err := photoGalleryByAscriptionId.DelCont(where) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084801.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084801.go new file mode 100644 index 0000000..8eda7b9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084801.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + + err := photoGalleryByAscriptionId.DelCont(where[]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084803.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084803.go new file mode 100644 index 0000000..6435644 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084803.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + + err := photoGalleryByAscriptionId.DelCont(where["im"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084806.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084806.go new file mode 100644 index 0000000..11eaadc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084806.go @@ -0,0 +1,91 @@ +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730084807.go b/.history/api/version1/honoraryArchives/operate_photo_20220730084807.go new file mode 100644 index 0000000..f6ed3ab --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730084807.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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730085124.go b/.history/api/version1/honoraryArchives/operate_photo_20220730085124.go new file mode 100644 index 0000000..f6ed3ab --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730085124.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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730085958.go b/.history/api/version1/honoraryArchives/operate_photo_20220730085958.go new file mode 100644 index 0000000..95a6691 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730085958.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[0]) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090011.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090011.go new file mode 100644 index 0000000..0b785a5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090011.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 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[0]) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090013.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090013.go new file mode 100644 index 0000000..45e0f07 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090013.go @@ -0,0 +1,87 @@ +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 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[0]) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090016.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090016.go new file mode 100644 index 0000000..e809e98 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090016.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 + } + + 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 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[0]) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090020.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090020.go new file mode 100644 index 0000000..fe23a7e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090020.go @@ -0,0 +1,85 @@ +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 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, newImageList[0]) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090025.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090025.go new file mode 100644 index 0000000..624ba38 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090025.go @@ -0,0 +1,85 @@ +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 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, new) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090026.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090026.go new file mode 100644 index 0000000..72d913e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090026.go @@ -0,0 +1,85 @@ +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 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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090032.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090032.go new file mode 100644 index 0000000..49581d8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090032.go @@ -0,0 +1,85 @@ +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 newImage models.PhotosGallery + newImage.Url = ol.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090034.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090034.go new file mode 100644 index 0000000..ae33f8a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090034.go @@ -0,0 +1,85 @@ +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 newImage models.PhotosGallery + newImage.Url = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090037.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090037.go new file mode 100644 index 0000000..e617bae --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090037.go @@ -0,0 +1,85 @@ +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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.Imgpath //物理地址"` + newImage.Name = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090039.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090039.go new file mode 100644 index 0000000..f74c9fb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090039.go @@ -0,0 +1,85 @@ +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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.Imgpath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090046.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090046.go new file mode 100644 index 0000000..4a92589 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090046.go @@ -0,0 +1,85 @@ +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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = ol //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090047.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090047.go new file mode 100644 index 0000000..bb21841 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090047.go @@ -0,0 +1,85 @@ +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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090058.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090058.go new file mode 100644 index 0000000..b6c9601 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090058.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090807.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090807.go new file mode 100644 index 0000000..b6c9601 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090807.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090813.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090813.go new file mode 100644 index 0000000..e8529b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090813.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090828.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090828.go new file mode 100644 index 0000000..ea01f4e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090828.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 + } + + 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 newImage models.PhotosGallery + + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090830.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090830.go new file mode 100644 index 0000000..ea01f4e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090830.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 + } + + 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 newImage models.PhotosGallery + + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090833.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090833.go new file mode 100644 index 0000000..ea01f4e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090833.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 + } + + 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 newImage models.PhotosGallery + + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090835.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090835.go new file mode 100644 index 0000000..e8529b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090835.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090838.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090838.go new file mode 100644 index 0000000..ea01f4e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090838.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 + } + + 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 newImage models.PhotosGallery + + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090847.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090847.go new file mode 100644 index 0000000..ea01f4e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090847.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 + } + + 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 newImage models.PhotosGallery + + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090850.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090850.go new file mode 100644 index 0000000..5ad2fa5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090850.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 + } + + 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 newImage models.PhotosGallery + var + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090857.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090857.go new file mode 100644 index 0000000..e8529b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090857.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090907.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090907.go new file mode 100644 index 0000000..e394280 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090907.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 + } + + 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 newImage req + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090909.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090909.go new file mode 100644 index 0000000..135432b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090909.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 + } + + 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 newImage + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090912.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090912.go new file mode 100644 index 0000000..54ec3af --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090912.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 + } + + 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 newImage requ + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090916.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090916.go new file mode 100644 index 0000000..20055de --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090916.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 + } + + 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 newImage requestD + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090920.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090920.go new file mode 100644 index 0000000..0b915cb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090920.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 + } + + 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 newImage requestData + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090928.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090928.go new file mode 100644 index 0000000..e474146 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090928.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 + } + + 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类型 + newia + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090933.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090933.go new file mode 100644 index 0000000..3704dcb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090933.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 + } + + 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类型 + newimage := requestData. + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090938.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090938.go new file mode 100644 index 0000000..7b7cf46 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090938.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 + } + + 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类型 + newimage := requestData.ImgUrl[0] + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730090939.go b/.history/api/version1/honoraryArchives/operate_photo_20220730090939.go new file mode 100644 index 0000000..7b7cf46 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730090939.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 + } + + 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类型 + newimage := requestData.ImgUrl[0] + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091007.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091007.go new file mode 100644 index 0000000..3a9d540 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091007.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 + } + + 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类型 + newImagePa + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091015.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091015.go new file mode 100644 index 0000000..ad16d72 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091015.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 + } + + 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类型 + newImagePath := requestData.ImgUrl[0] + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091016.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091016.go new file mode 100644 index 0000000..29a74b0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091016.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 + } + + 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类型 + newImagePath := requestData.ImgUrl[0]. + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091032.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091032.go new file mode 100644 index 0000000..135432b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091032.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 + } + + 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 newImage + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091040.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091040.go new file mode 100644 index 0000000..39f8aae --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091040.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 + } + + 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 newImage meth + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091042.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091042.go new file mode 100644 index 0000000..de21eef --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091042.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 + } + + 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 newImage mode + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091046.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091046.go new file mode 100644 index 0000000..42ebfdc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091046.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 + } + + 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 newImage models. + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091048.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091048.go new file mode 100644 index 0000000..e8529b6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091048.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = oldImage.Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091053.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091053.go new file mode 100644 index 0000000..9484d0b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091053.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = req //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091056.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091056.go new file mode 100644 index 0000000..850821e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091056.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData. //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091101.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091101.go new file mode 100644 index 0000000..c199b79 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091101.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0]. //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091103.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091103.go new file mode 100644 index 0000000..981d719 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091103.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = oldImage.ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091108.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091108.go new file mode 100644 index 0000000..35f2596 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091108.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].ImgPath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091111.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091111.go new file mode 100644 index 0000000..1075c3f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091111.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0]. //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091114.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091114.go new file mode 100644 index 0000000..7bc876f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091114.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = oldImage.Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091118.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091118.go new file mode 100644 index 0000000..29c24ac --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091118.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0] //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091120.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091120.go new file mode 100644 index 0000000..598f41a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091120.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = oldImage.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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091124.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091124.go new file mode 100644 index 0000000..7c32299 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091124.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0]. //文档大小"` + 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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091127.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091127.go new file mode 100644 index 0000000..89ee97a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091127.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091133.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091133.go new file mode 100644 index 0000000..9e4a9e1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091133.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = new //归属"` + newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091135.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091135.go new file mode 100644 index 0000000..efe6b23 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091135.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = requestData.ImgUrl[0]. //归属"` + newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091141.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091141.go new file mode 100644 index 0000000..b05f303 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091141.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = requestData.ImgUrl[0].AscriptionId //归属"` + newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091149.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091149.go new file mode 100644 index 0000000..f3b4a26 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091149.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 + } + + 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 newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = //归属"` + newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091150.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091150.go new file mode 100644 index 0000000..16ba782 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091150.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 + } + + 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.ImgUrl[0].AscriptionId.Id, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = //归属"` + newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091153.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091153.go new file mode 100644 index 0000000..af1080b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091153.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = //归属"` + newImage.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091155.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091155.go new file mode 100644 index 0000000..72cf145 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091155.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].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) { + 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091206.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091206.go new file mode 100644 index 0000000..d2abd0d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091206.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = old //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091208.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091208.go new file mode 100644 index 0000000..52966f2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091208.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage. //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091213.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091213.go new file mode 100644 index 0000000..03bb6be --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091213.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091218.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091218.go new file mode 100644 index 0000000..c6a845e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091218.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + new + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091220.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091220.go new file mode 100644 index 0000000..70e871d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091220.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage. + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091226.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091226.go new file mode 100644 index 0000000..e92a012 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091226.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Id = old + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091227.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091227.go new file mode 100644 index 0000000..d40bf1c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091227.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + oldImage.EiteCont(where, newImage) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091247.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091247.go new file mode 100644 index 0000000..9cdbbc6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091247.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + new +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091249.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091249.go new file mode 100644 index 0000000..a70dabe --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091249.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.e +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091251.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091251.go new file mode 100644 index 0000000..711f385 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091251.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091334.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091334.go new file mode 100644 index 0000000..711f385 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091334.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + var newImage models.PhotosGallery + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091337.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091337.go new file mode 100644 index 0000000..c97593b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091337.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091339.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091339.go new file mode 100644 index 0000000..ebc1631 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091339.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + save + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091345.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091345.go new file mode 100644 index 0000000..fff5859 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091345.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod. + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091348.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091348.go new file mode 100644 index 0000000..3f5fe1c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091348.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[]() + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091350.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091350.go new file mode 100644 index 0000000..4af4c39 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091350.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage.Id = oldImage.Id + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091358.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091358.go new file mode 100644 index 0000000..a4a5c42 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091358.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage.Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091402.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091402.go new file mode 100644 index 0000000..8d19ad7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091402.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveDataUrl = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091403.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091403.go new file mode 100644 index 0000000..bedbdea --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091403.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData[Url = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091407.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091407.go new file mode 100644 index 0000000..f10abd8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091407.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + newImage.ImgPath = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091414.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091414.go new file mode 100644 index 0000000..75fa6be --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091414.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["url"] = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091416.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091416.go new file mode 100644 index 0000000..990cb73 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091416.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imag"] = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091420.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091420.go new file mode 100644 index 0000000..c3f2b6e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091420.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + newImage.Name = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091429.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091429.go new file mode 100644 index 0000000..4f38a41 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091429.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["url"] = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091432.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091432.go new file mode 100644 index 0000000..8528a2f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091432.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + newImage.FileSize = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091436.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091436.go new file mode 100644 index 0000000..8cdb41c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091436.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["url"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091440.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091440.go new file mode 100644 index 0000000..7b46710 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091440.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesiz"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091441.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091441.go new file mode 100644 index 0000000..e5be951 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091441.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091455.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091455.go new file mode 100644 index 0000000..72375d2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091455.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + if requestData + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091504.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091504.go new file mode 100644 index 0000000..879ae6a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091504.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + requestData, + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091507.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091507.go new file mode 100644 index 0000000..43c1258 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091507.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + requestData.ur + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091509.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091509.go new file mode 100644 index 0000000..beae076 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091509.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + requestData. + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091515.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091515.go new file mode 100644 index 0000000..bb9c601 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091515.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + requestData.ImgUrl[0].Url + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091518.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091518.go new file mode 100644 index 0000000..bf2e9b1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091518.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + requestData.ImgUrl[0] + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091527.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091527.go new file mode 100644 index 0000000..d9e38cd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091527.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091531.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091531.go new file mode 100644 index 0000000..724d72d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091531.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if new + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091533.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091533.go new file mode 100644 index 0000000..fc4002f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091533.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage. + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091541.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091541.go new file mode 100644 index 0000000..3928c8c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091541.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != nil + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091545.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091545.go new file mode 100644 index 0000000..a836925 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091545.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091547.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091547.go new file mode 100644 index 0000000..51ffb41 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091547.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091549.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091549.go new file mode 100644 index 0000000..1bd0c3e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091549.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && new + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091554.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091554.go new file mode 100644 index 0000000..04f2f29 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091554.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url ! + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091557.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091557.go new file mode 100644 index 0000000..5d2c470 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091557.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != old + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091559.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091559.go new file mode 100644 index 0000000..180da92 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091559.go @@ -0,0 +1,85 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091602.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091602.go new file mode 100644 index 0000000..d458316 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091602.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url{ + + } + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091603.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091603.go new file mode 100644 index 0000000..a90c47e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091603.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url{ + + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091604.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091604.go new file mode 100644 index 0000000..4682f5e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091604.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091609.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091609.go new file mode 100644 index 0000000..dfc7a03 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091609.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if new + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091612.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091612.go new file mode 100644 index 0000000..b88b6be --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091612.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091617.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091617.go new file mode 100644 index 0000000..a35b70d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091617.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091620.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091620.go new file mode 100644 index 0000000..864836a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091620.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && new(type) + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091622.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091622.go new file mode 100644 index 0000000..eda2d03 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091622.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newim + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091624.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091624.go new file mode 100644 index 0000000..b8184ca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091624.go @@ -0,0 +1,87 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091628.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091628.go new file mode 100644 index 0000000..903ffca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091628.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath{ + } + + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091630.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091630.go new file mode 100644 index 0000000..548fde6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091630.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath{ + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091631.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091631.go new file mode 100644 index 0000000..659f403 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091631.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091634.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091634.go new file mode 100644 index 0000000..a05992d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091634.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + if new + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091644.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091644.go new file mode 100644 index 0000000..f88d9e8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091644.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + if newImage.Name != "" && new + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091650.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091650.go new file mode 100644 index 0000000..8d57df5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091650.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + if newImage.Name != "" && newImage.Name != old + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091652.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091652.go new file mode 100644 index 0000000..ae2efdd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091652.go @@ -0,0 +1,91 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name{ + + } + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091653.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091653.go new file mode 100644 index 0000000..b29fdc3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091653.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + } + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091659.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091659.go new file mode 100644 index 0000000..6f6bd1b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091659.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + } + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091702.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091702.go new file mode 100644 index 0000000..faabbdc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091702.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //文档名称"` + } + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091706.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091706.go new file mode 100644 index 0000000..a570ed9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091706.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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091711.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091711.go new file mode 100644 index 0000000..d5866a8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091711.go @@ -0,0 +1,91 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091715.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091715.go new file mode 100644 index 0000000..451ae71 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091715.go @@ -0,0 +1,91 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if new + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091722.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091722.go new file mode 100644 index 0000000..a65cccb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091722.go @@ -0,0 +1,91 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize !="" && new + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091728.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091728.go new file mode 100644 index 0000000..17d9924 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091728.go @@ -0,0 +1,91 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize !="" && newImage.FileSize != old + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091731.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091731.go new file mode 100644 index 0000000..b36c406 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091731.go @@ -0,0 +1,91 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize !="" && newImage.FileSize != oldImage. + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091733.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091733.go new file mode 100644 index 0000000..aac03aa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091733.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize !="" && newImage.FileSize != oldImage.FileSize{ + + } + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091735.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091735.go new file mode 100644 index 0000000..dc78855 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091735.go @@ -0,0 +1,92 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091738.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091738.go new file mode 100644 index 0000000..10e758b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091738.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091741.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091741.go new file mode 100644 index 0000000..d9ca194 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091741.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData[] + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091745.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091745.go new file mode 100644 index 0000000..de4f0d6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091745.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091749.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091749.go new file mode 100644 index 0000000..7954b1d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091749.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.no + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091753.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091753.go new file mode 100644 index 0000000..756d5d7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091753.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.now() + newImage.Time = time.Now().Unix() //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091756.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091756.go new file mode 100644 index 0000000..330a2c7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091756.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.now() + newImage.Time = //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091757.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091757.go new file mode 100644 index 0000000..e3e83ab --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091757.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.Now().Unix() + newImage.Time = //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091800.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091800.go new file mode 100644 index 0000000..6286923 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091800.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.Now().Unix() //创建时间" + newImage.Time = ` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091802.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091802.go new file mode 100644 index 0000000..e3e83ab --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091802.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.Now().Unix() + newImage.Time = //创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091806.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091806.go new file mode 100644 index 0000000..b781bd6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091806.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.Now().Unix()//创建时间"` + newImage.Time = + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091811.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091811.go new file mode 100644 index 0000000..72408b3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091811.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.Time = + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091813.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091813.go new file mode 100644 index 0000000..587c628 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091813.go @@ -0,0 +1,92 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091821.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091821.go new file mode 100644 index 0000000..4a1943c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091821.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage. + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091824.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091824.go new file mode 100644 index 0000000..c0bd8c4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091824.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091828.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091828.go new file mode 100644 index 0000000..acdb707 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091828.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091837.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091837.go new file mode 100644 index 0000000..8e7b022 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091837.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.FileSize + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091845.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091845.go new file mode 100644 index 0000000..36c9777 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091845.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 + } + + 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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != as + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091854.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091854.go new file mode 100644 index 0000000..d156780 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091854.go @@ -0,0 +1,95 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId{ + + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091855.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091855.go new file mode 100644 index 0000000..3a441c6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091855.go @@ -0,0 +1,95 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId{ + + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091856.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091856.go new file mode 100644 index 0000000..a967fd9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091856.go @@ -0,0 +1,94 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091907.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091907.go new file mode 100644 index 0000000..9308b87 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091907.go @@ -0,0 +1,92 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + "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 + } + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091913.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091913.go new file mode 100644 index 0000000..a967fd9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091913.go @@ -0,0 +1,94 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091919.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091919.go new file mode 100644 index 0000000..de2748b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091919.go @@ -0,0 +1,94 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091920.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091920.go new file mode 100644 index 0000000..a967fd9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091920.go @@ -0,0 +1,94 @@ +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.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + newImage := requestData.ImgUrl[0] + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091922.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091922.go new file mode 100644 index 0000000..c9d8eea --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091922.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + ascriptionId, _ := strconv.ParseInt(requestData.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + saveData := publicmethod.MapOut[string]() + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091923.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091923.go new file mode 100644 index 0000000..fd2a6ec --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091923.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + ascriptionId, _ := strconv.ParseInt(requestData.ImgUrl[0].AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091929.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091929.go new file mode 100644 index 0000000..6bf71aa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091929.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + ascriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091933.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091933.go new file mode 100644 index 0000000..dc4b18c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091933.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + newImage, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091935.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091935.go new file mode 100644 index 0000000..ada94b8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091935.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + newImage.AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730091945.go b/.history/api/version1/honoraryArchives/operate_photo_20220730091945.go new file mode 100644 index 0000000..539543f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730091945.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + newImage.AscriptionId, _ = strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092010.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092010.go new file mode 100644 index 0000000..66b2899 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092010.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ = strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092013.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092013.go new file mode 100644 index 0000000..b43f11f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092013.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && newImage.AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092019.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092019.go new file mode 100644 index 0000000..a8294a3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092019.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != "" && AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092022.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092022.go new file mode 100644 index 0000000..0e625d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092022.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if newImage.AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092027.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092027.go new file mode 100644 index 0000000..7e128d6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092027.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["time"] = time.Now().Unix() //新图片创建时间"` + } + newImage.AscriptionId = ascriptionId //归属"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092032.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092032.go new file mode 100644 index 0000000..7e9e45a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092032.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + newImage.AscriptionId = ascriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092035.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092035.go new file mode 100644 index 0000000..099ea7b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092035.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + newImage.AscriptionId = ascriptionIAscriptionIdd //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092037.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092037.go new file mode 100644 index 0000000..ff54ad7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092037.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + newImage.AscriptionId = ascriptionIAscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092039.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092039.go new file mode 100644 index 0000000..5ee32e3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092039.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + newImage.AscriptionId = AscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092048.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092048.go new file mode 100644 index 0000000..0d75181 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092048.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData[""] = AscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092054.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092054.go new file mode 100644 index 0000000..0231dff --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092054.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascirptio"] = AscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092057.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092057.go new file mode 100644 index 0000000..f9b4e8c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092057.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["AscriptionId"] = AscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092058.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092058.go new file mode 100644 index 0000000..e701a0f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092058.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionId"] = AscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092100.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092100.go new file mode 100644 index 0000000..ef911a2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092100.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092115.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092115.go new file mode 100644 index 0000000..af7cc04 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092115.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if new + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092118.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092118.go new file mode 100644 index 0000000..e8de911 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092118.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage. + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092120.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092120.go new file mode 100644 index 0000000..5516dd8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092120.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.a + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092122.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092122.go new file mode 100644 index 0000000..f68476a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092122.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.asc + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092130.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092130.go new file mode 100644 index 0000000..925ac20 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092130.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet !="" && old + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092134.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092134.go new file mode 100644 index 0000000..919f4bd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092134.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet !="" && oldImage.AscriptionDataSheet + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092136.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092136.go new file mode 100644 index 0000000..5859004 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092136.go @@ -0,0 +1,97 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet !="" && oldImage.AscriptionDataSheet{ + + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092138.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092138.go new file mode 100644 index 0000000..1300928 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092138.go @@ -0,0 +1,97 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet !="" && oldImage.AscriptionDataSheet{ + + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092139.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092139.go new file mode 100644 index 0000000..1a079ca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092139.go @@ -0,0 +1,96 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet != "" && oldImage.AscriptionDataSheet { + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092148.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092148.go new file mode 100644 index 0000000..74e1c50 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092148.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092151.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092151.go new file mode 100644 index 0000000..8f2ccf5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092151.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092153.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092153.go new file mode 100644 index 0000000..74e1c50 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092153.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092154.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092154.go new file mode 100644 index 0000000..1a079ca --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092154.go @@ -0,0 +1,96 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet != "" && oldImage.AscriptionDataSheet { + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092156.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092156.go new file mode 100644 index 0000000..2d772da --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092156.go @@ -0,0 +1,96 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + if newImage.AscriptionDataSheet !="" && oldImage.AscriptionDataSheet{ + newImage.AscriptionDataSheet = oldImage.AscriptionDataSheet //归属拿个数据表"` + } + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092201.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092201.go new file mode 100644 index 0000000..5003d00 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092201.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["oldImage.AscriptionDataSheet"] + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092204.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092204.go new file mode 100644 index 0000000..4cd1736 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092204.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["sscriptionDataSheet"] + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092206.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092206.go new file mode 100644 index 0000000..4d047c1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092206.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptionDataSheet"] + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092209.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092209.go new file mode 100644 index 0000000..1c50971 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092209.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondataSheet"] + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092211.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092211.go new file mode 100644 index 0000000..4790f12 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092211.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092213.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092213.go new file mode 100644 index 0000000..56e5c77 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092213.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092218.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092218.go new file mode 100644 index 0000000..3071571 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092218.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage. + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092219.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092219.go new file mode 100644 index 0000000..094bc97 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092219.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.State = 1 //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092230.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092230.go new file mode 100644 index 0000000..4b34e6a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092230.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["time"] = time.Now().Unix() //新图片创建时间"` + //状态(1:启用;2:禁用;3:删除)"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092239.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092239.go new file mode 100644 index 0000000..bd2a159 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092239.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 + } + + 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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["time"] = time.Now().Unix() //新图片创建时间"` + newImage.EiteCont() +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092329.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092329.go new file mode 100644 index 0000000..756cfea --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092329.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 + } + + 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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := honContOld.EiteCont(where, saveData) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092333.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092333.go new file mode 100644 index 0000000..f50615e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092333.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 + } + + 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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092345.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092345.go new file mode 100644 index 0000000..130ff32 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092345.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData[] + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092349.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092349.go new file mode 100644 index 0000000..ff70703 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092349.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData[] = oldImage. + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092411.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092411.go new file mode 100644 index 0000000..79d1b3a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092411.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage. + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092414.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092414.go new file mode 100644 index 0000000..40a052f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092414.go @@ -0,0 +1,94 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092509.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092509.go new file mode 100644 index 0000000..6c51f30 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092509.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092540.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092540.go new file mode 100644 index 0000000..8ab305e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092540.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if as +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092543.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092543.go new file mode 100644 index 0000000..e342e94 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092543.go @@ -0,0 +1,95 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if save +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092552.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092552.go new file mode 100644 index 0000000..a9e7fbd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092552.go @@ -0,0 +1,97 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil{ + publicmethod.re + } +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092554.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092554.go new file mode 100644 index 0000000..1965f10 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092554.go @@ -0,0 +1,97 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil{ + publicmethod.Result() + } +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092637.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092637.go new file mode 100644 index 0000000..7853e08 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092637.go @@ -0,0 +1,98 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil{ + publicmethod.Result() + } + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092640.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092640.go new file mode 100644 index 0000000..2908994 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092640.go @@ -0,0 +1,99 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil{ + publicmethod.Result() + return + } + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092643.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092643.go new file mode 100644 index 0000000..3159c28 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092643.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil{ + publicmethod.Result() + return + } + + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092646.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092646.go new file mode 100644 index 0000000..ff5b1a1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092646.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil{ + publicmethod.Result() + return + } + publicmethod.re + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092651.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092651.go new file mode 100644 index 0000000..e2d4d0e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092651.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil { + publicmethod.Result() + return + } + publicmethod.Result(0, requestData, c) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092716.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092716.go new file mode 100644 index 0000000..83aa5a0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092716.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil { + publicmethod.Result(106,saveErr,) + return + } + publicmethod.Result(0, requestData, c) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092718.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092718.go new file mode 100644 index 0000000..40db76b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092718.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil { + publicmethod.Result(106, saveErr, c) + return + } + publicmethod.Result(0, requestData, c) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730092817.go b/.history/api/version1/honoraryArchives/operate_photo_20220730092817.go new file mode 100644 index 0000000..40db76b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730092817.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil { + publicmethod.Result(106, saveErr, c) + return + } + publicmethod.Result(0, requestData, c) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730093216.go b/.history/api/version1/honoraryArchives/operate_photo_20220730093216.go new file mode 100644 index 0000000..baaf958 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730093216.go @@ -0,0 +1,100 @@ +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 + } + newImage := requestData.ImgUrl[0] + saveData := publicmethod.MapOut[string]() + AscriptionId, _ := strconv.ParseInt(newImage.AscriptionId, 10, 64) // 将id转为int64类型 + if newImage.Url != "" && newImage.Url != oldImage.Url { + saveData["url"] = requestData.ImgUrl[0].Url //新图片地址"` + } + if newImage.Imgpath != "" && newImage.Imgpath != oldImage.ImgPath { + saveData["imgpath"] = requestData.ImgUrl[0].Imgpath //新图片物理地址"` + } + if newImage.Name != "" && newImage.Name != oldImage.Name { + saveData["name"] = requestData.ImgUrl[0].Name //新图片文档名称"` + } + if newImage.FileSize != "" && newImage.FileSize != oldImage.FileSize { + saveData["filesize"] = requestData.ImgUrl[0].FileSize //文档大小"` + } + if AscriptionId != 0 && AscriptionId != oldImage.AscriptionId { + saveData["ascriptionid"] = AscriptionId //归属"` + } + saveData["ascriptiondatasheet"] = oldImage.AscriptionDataSheet + saveData["state"] = oldImage.State + saveData["time"] = time.Now().Unix() //新图片创建时间"` + saveErr := oldImage.EiteCont(where, saveData) + if saveErr != nil { + publicmethod.Result(106, saveErr, c) + return + } + publicmethod.Result(0, requestData, c) + +} + +// 删除图片 +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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730093438.go b/.history/api/version1/honoraryArchives/operate_photo_20220730093438.go new file mode 100644 index 0000000..d6955bc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730093438.go @@ -0,0 +1,54 @@ +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) 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730093441.go b/.history/api/version1/honoraryArchives/operate_photo_20220730093441.go new file mode 100644 index 0000000..16ca9a1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730093441.go @@ -0,0 +1,54 @@ +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) 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) + where["imgpath"] = photoGalleryByAscriptionId.ImgPath + err := photoGalleryByAscriptionId.DelCont(where["imgpath"]) + if err == nil { + publicmethod.Result(0, err, c) + } else { + publicmethod.Result(108, err, c) + } +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730093451.go b/.history/api/version1/honoraryArchives/operate_photo_20220730093451.go new file mode 100644 index 0000000..9bf83a5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730093451.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []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) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730093534.go b/.history/api/version1/honoraryArchives/operate_photo_20220730093534.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730093534.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095005.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095005.go new file mode 100644 index 0000000..9244e28 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095005.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + err := nil + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095126.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095126.go new file mode 100644 index 0000000..f625c9d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095126.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095127.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095127.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095127.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095743.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095743.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095743.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095746.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095746.go new file mode 100644 index 0000000..0ca0b8e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095746.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + photoGalleryByAscriptionId. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095751.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095751.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095751.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095812.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095812.go new file mode 100644 index 0000000..7db7df8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095812.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + re + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095813.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095813.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095813.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095818.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095818.go new file mode 100644 index 0000000..0ca0b8e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095818.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + photoGalleryByAscriptionId. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095823.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095823.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095823.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095902.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095902.go new file mode 100644 index 0000000..f055666 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095902.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + dbGrom + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730095909.go b/.history/api/version1/honoraryArchives/operate_photo_20220730095909.go new file mode 100644 index 0000000..b6ca6d5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730095909.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101039.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101039.go new file mode 100644 index 0000000..1fbcd26 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101039.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101047.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101047.go new file mode 100644 index 0000000..a11cd88 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101047.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.cons + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101049.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101049.go new file mode 100644 index 0000000..cf35c9e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101049.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.consatan + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101052.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101052.go new file mode 100644 index 0000000..61e4a11 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101052.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.consatant + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101054.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101054.go new file mode 100644 index 0000000..c4fc869 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101054.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.consat + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101056.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101056.go new file mode 100644 index 0000000..d2145f0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101056.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.consatnt + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101100.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101100.go new file mode 100644 index 0000000..1694ac7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101100.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.consatnt_Db_ + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101107.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101107.go new file mode 100644 index 0000000..05ca004 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101107.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101141.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101141.go new file mode 100644 index 0000000..05ca004 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101141.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101147.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101147.go new file mode 100644 index 0000000..09c47af --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101147.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.CONSTANT_DB_MANAGE_ARCHIVES + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101148.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101148.go new file mode 100644 index 0000000..4452603 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101148.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.CONSTANT_DB_MANAGE_ARCHIVES. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101201.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101201.go new file mode 100644 index 0000000..7965eaf --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101201.go @@ -0,0 +1,32 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.CONSTANT_DB_MANAGE_ARCHIVES + over + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101204.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101204.go new file mode 100644 index 0000000..72b7d9d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101204.go @@ -0,0 +1,32 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.CONSTANT_DB_MANAGE_ARCHIVES + over + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101209.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101209.go new file mode 100644 index 0000000..6cb597e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101209.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall. + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101213.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101213.go new file mode 100644 index 0000000..3b33411 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101213.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall. + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101223.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101223.go new file mode 100644 index 0000000..39548e4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101223.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "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 + overall. + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101233.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101233.go new file mode 100644 index 0000000..9fcbac2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101233.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + +) + +// 查询图片 +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 + overall. + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101242.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101242.go new file mode 100644 index 0000000..075c426 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101242.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" +) + +// 查询图片 +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 + o + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101246.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101246.go new file mode 100644 index 0000000..075c426 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101246.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" +) + +// 查询图片 +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 + o + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101248.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101248.go new file mode 100644 index 0000000..c102b7b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101248.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" +) + +// 查询图片 +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 + + // if err != nil { + // publicmethod.Result(107, err, c) + // return + // } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101252.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101252.go new file mode 100644 index 0000000..4452603 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101252.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.CONSTANT_DB_MANAGE_ARCHIVES. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101254.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101254.go new file mode 100644 index 0000000..09c47af --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101254.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall.CONSTANT_DB_MANAGE_ARCHIVES + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101303.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101303.go new file mode 100644 index 0000000..8fa949b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101303.go @@ -0,0 +1,32 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + o + err := nil + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101306.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101306.go new file mode 100644 index 0000000..1e95a14 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101306.go @@ -0,0 +1,32 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall. + err := nil + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101314.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101314.go new file mode 100644 index 0000000..fc2dfe3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101314.go @@ -0,0 +1,32 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + overall. + err nil + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101323.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101323.go new file mode 100644 index 0000000..1124c3f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101323.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + err := error. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101325.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101325.go new file mode 100644 index 0000000..59529c3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101325.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + // "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + err := error. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101330.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101330.go new file mode 100644 index 0000000..59529c3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101330.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + // "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + err := error. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101351.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101351.go new file mode 100644 index 0000000..43fc363 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101351.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + er + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101353.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101353.go new file mode 100644 index 0000000..665051d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101353.go @@ -0,0 +1,30 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + error. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101400.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101400.go new file mode 100644 index 0000000..1124c3f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101400.go @@ -0,0 +1,31 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + err := error. + if err != nil { + publicmethod.Result(107, err, c) + return + } + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101412.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101412.go new file mode 100644 index 0000000..fc56412 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101412.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + + + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101638.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101638.go new file mode 100644 index 0000000..88289dd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101638.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101912.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101912.go new file mode 100644 index 0000000..92d2ebe --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101912.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101917.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101917.go new file mode 100644 index 0000000..afd17db --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101917.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + overall.con + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101919.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101919.go new file mode 100644 index 0000000..d2e384d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101919.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + overall.cona + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101927.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101927.go new file mode 100644 index 0000000..1768683 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101927.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + // overall.cona + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101930.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101930.go new file mode 100644 index 0000000..92d2ebe --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101930.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101931.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101931.go new file mode 100644 index 0000000..7f0511f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101931.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + // publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101932.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101932.go new file mode 100644 index 0000000..92d2ebe --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101932.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + // gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101934.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101934.go new file mode 100644 index 0000000..88289dd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101934.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}).Where("state BETWEEN ? AND ?", 1, 2) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730101957.go b/.history/api/version1/honoraryArchives/operate_photo_20220730101957.go new file mode 100644 index 0000000..a7c0692 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730101957.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.HonoraryArchives{}) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102014.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102014.go new file mode 100644 index 0000000..dd2d20f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102014.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102020.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102020.go new file mode 100644 index 0000000..26794e8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102020.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102021.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102021.go new file mode 100644 index 0000000..1c249c8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102021.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102309.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102309.go new file mode 100644 index 0000000..2d1acbb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102309.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb. + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102443.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102443.go new file mode 100644 index 0000000..0824c26 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102443.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.wher + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102444.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102444.go new file mode 100644 index 0000000..dc65b25 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102444.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where() + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102448.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102448.go new file mode 100644 index 0000000..0340453 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102448.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where("") + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102451.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102451.go new file mode 100644 index 0000000..bd8f771 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102451.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where("as") + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102456.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102456.go new file mode 100644 index 0000000..52375e4 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102456.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(whe) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102457.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102457.go new file mode 100644 index 0000000..21075f8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102457.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102500.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102500.go new file mode 100644 index 0000000..96113d6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102500.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find() + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102502.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102502.go new file mode 100644 index 0000000..660a452 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102502.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102507.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102507.go new file mode 100644 index 0000000..050667b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102507.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102508.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102508.go new file mode 100644 index 0000000..050667b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102508.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102516.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102516.go new file mode 100644 index 0000000..050667b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102516.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + // photoUrl := photoGalleryByAscriptionId.Url + // publicmethod.Result(0, photoUrl, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730102812.go b/.history/api/version1/honoraryArchives/operate_photo_20220730102812.go new file mode 100644 index 0000000..9ad1e73 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730102812.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103004.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103004.go new file mode 100644 index 0000000..e9fce06 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103004.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103014.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103014.go new file mode 100644 index 0000000..a2de2df --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103014.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103019.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103019.go new file mode 100644 index 0000000..c6c2b9f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103019.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,req) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103021.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103021.go new file mode 100644 index 0000000..2e6d74c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103021.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,request) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103023.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103023.go new file mode 100644 index 0000000..3a88689 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103023.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,requestD) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103028.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103028.go new file mode 100644 index 0000000..19ef528 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103028.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,requestData.P) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103029.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103029.go new file mode 100644 index 0000000..b51ada9 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103029.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,requestData.) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103032.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103032.go new file mode 100644 index 0000000..9ad1e73 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103032.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103206.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103206.go new file mode 100644 index 0000000..17a801d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103206.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103215.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103215.go new file mode 100644 index 0000000..a368174 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103215.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103218.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103218.go new file mode 100644 index 0000000..88b9b7a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103218.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.Resu +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103219.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103219.go new file mode 100644 index 0000000..e9fce06 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103219.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103221.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103221.go new file mode 100644 index 0000000..a2de2df --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103221.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103227.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103227.go new file mode 100644 index 0000000..e820ad3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103227.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,1,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103232.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103232.go new file mode 100644 index 0000000..df50277 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103232.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,p) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103234.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103234.go new file mode 100644 index 0000000..7df406b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103234.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,ov) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103237.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103237.go new file mode 100644 index 0000000..eeb8faa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103237.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,overall.) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103243.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103243.go new file mode 100644 index 0000000..e9fce06 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103243.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList() +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103305.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103305.go new file mode 100644 index 0000000..c24e36b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103305.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,public) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103308.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103308.go new file mode 100644 index 0000000..d11c81c --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103308.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.LimitPage(.)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103312.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103312.go new file mode 100644 index 0000000..3887a82 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103312.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.pa) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103316.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103316.go new file mode 100644 index 0000000..db2748e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103316.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103318.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103318.go new file mode 100644 index 0000000..1930796 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103318.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103333.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103333.go new file mode 100644 index 0000000..fb78db5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103333.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publi) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103335.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103335.go new file mode 100644 index 0000000..5f5d1f3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103335.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103339.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103339.go new file mode 100644 index 0000000..c59ffe7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103339.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.pag) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103340.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103340.go new file mode 100644 index 0000000..67956af --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103340.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.PagesTurn.) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103342.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103342.go new file mode 100644 index 0000000..eab09f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103342.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.PagesTurn.PageSize) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103344.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103344.go new file mode 100644 index 0000000..b650510 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103344.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.PagesTurn.PageSize,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103347.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103347.go new file mode 100644 index 0000000..d775ce5 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103347.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.PagesTurn.PageSize,len()) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103351.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103351.go new file mode 100644 index 0000000..0299e01 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103351.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0,publicmethod.PagesTurn.Page,publicmethod.PagesTurn.PageSize,len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103352.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103352.go new file mode 100644 index 0000000..a338cfd --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103352.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, publicmethod.PagesTurn.Page, publicmethod.PagesTurn.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103507.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103507.go new file mode 100644 index 0000000..b81d371 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103507.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, pr, publicmethod.PagesTurn.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103509.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103509.go new file mode 100644 index 0000000..843af6f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103509.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, req, publicmethod.PagesTurn.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103511.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103511.go new file mode 100644 index 0000000..2179637 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103511.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, publicmethod.PagesTurn.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103515.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103515.go new file mode 100644 index 0000000..7c052f6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103515.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, req.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103516.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103516.go new file mode 100644 index 0000000..1338e38 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103516.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103517.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103517.go new file mode 100644 index 0000000..3f988c6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103517.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId)) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103536.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103536.go new file mode 100644 index 0000000..ddee245 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103536.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103538.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103538.go new file mode 100644 index 0000000..6f823ba --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103538.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),pho) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103541.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103541.go new file mode 100644 index 0000000..ddee245 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103541.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103544.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103544.go new file mode 100644 index 0000000..6f823ba --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103544.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),pho) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103548.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103548.go new file mode 100644 index 0000000..2306ec7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103548.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),photoG) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103550.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103550.go new file mode 100644 index 0000000..9834ec1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103550.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103601.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103601.go new file mode 100644 index 0000000..c6c48f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103601.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103605.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103605.go new file mode 100644 index 0000000..404d00a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103605.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),t,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103608.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103608.go new file mode 100644 index 0000000..c6c48f1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103608.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103630.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103630.go new file mode 100644 index 0000000..a52bc11 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103630.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),gorm,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103633.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103633.go new file mode 100644 index 0000000..87fa9f7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103633.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),gormDb.coun,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103634.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103634.go new file mode 100644 index 0000000..5e4d1a1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103634.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),gormDb.Count(),photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103644.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103644.go new file mode 100644 index 0000000..d9ffbff --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103644.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),gormDb.Count(&),photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103647.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103647.go new file mode 100644 index 0000000..5e4d1a1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103647.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),gormDb.Count(),photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103654.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103654.go new file mode 100644 index 0000000..030a1d0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103654.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + total + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103656.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103656.go new file mode 100644 index 0000000..030a1d0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103656.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + total + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103659.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103659.go new file mode 100644 index 0000000..d524ff3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103659.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103701.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103701.go new file mode 100644 index 0000000..1164e8f --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103701.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103702.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103702.go new file mode 100644 index 0000000..c4c20bb --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103702.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId),gormDb.Count(),photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103709.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103709.go new file mode 100644 index 0000000..4108c49 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103709.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), int64(total), photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103713.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103713.go new file mode 100644 index 0000000..1d01a07 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103713.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), int64(total), photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103716.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103716.go new file mode 100644 index 0000000..5a7e892 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103716.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total), photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103717.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103717.go new file mode 100644 index 0000000..d99d432 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103717.go @@ -0,0 +1,27 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103723.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103723.go new file mode 100644 index 0000000..ff36526 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103723.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103725.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103725.go new file mode 100644 index 0000000..ab024fa --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103725.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + db.co + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103733.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103733.go new file mode 100644 index 0000000..0da87a0 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103733.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count() + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103734.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103734.go new file mode 100644 index 0000000..1850b7d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103734.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103736.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103736.go new file mode 100644 index 0000000..d7b6ae2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103736.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103746.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103746.go new file mode 100644 index 0000000..c11dab1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103746.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, ,photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103751.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103751.go new file mode 100644 index 0000000..b9dbc3a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103751.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total, c,photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103754.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103754.go new file mode 100644 index 0000000..43b41d1 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103754.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, len(photoGalleryByAscriptionId), total,photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103808.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103808.go new file mode 100644 index 0000000..1cc1390 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103808.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total,photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103810.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103810.go new file mode 100644 index 0000000..7825d9a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103810.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total,len(photoGalleryByAscriptionId),,photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103812.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103812.go new file mode 100644 index 0000000..3e31e57 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103812.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, len(photoGalleryByAscriptionId), photoGalleryByAscriptionId) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103818.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103818.go new file mode 100644 index 0000000..f94c96d --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103818.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, len(photoGalleryByAscriptionId), photoGalleryByAscriptionId,) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103820.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103820.go new file mode 100644 index 0000000..564ee6a --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103820.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, len(photoGalleryByAscriptionId), photoGalleryByAscriptionId, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103829.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103829.go new file mode 100644 index 0000000..def7197 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103829.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, intlen(photoGalleryByAscriptionId), photoGalleryByAscriptionId, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103832.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103832.go new file mode 100644 index 0000000..8b165df --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103832.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(photoGalleryByAscriptionId), photoGalleryByAscriptionId, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103833.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103833.go new file mode 100644 index 0000000..db4dfbc --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103833.go @@ -0,0 +1,28 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(photoGalleryByAscriptionId)), photoGalleryByAscriptionId, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730103855.go b/.history/api/version1/honoraryArchives/operate_photo_20220730103855.go new file mode 100644 index 0000000..7644e37 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730103855.go @@ -0,0 +1,29 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + + var total int64 + gormDb.Count(&total) + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(photoGalleryByAscriptionId)), photoGalleryByAscriptionId, c) +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104105.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104105.go new file mode 100644 index 0000000..8dc122b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104105.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104106.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104106.go new file mode 100644 index 0000000..8dc122b --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104106.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104141.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104141.go new file mode 100644 index 0000000..1f13969 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104141.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}). + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104148.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104148.go new file mode 100644 index 0000000..dc41c5e --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104148.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state bet") + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104154.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104154.go new file mode 100644 index 0000000..29862c2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104154.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state = ?") + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104202.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104202.go new file mode 100644 index 0000000..c4a4cc3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104202.go @@ -0,0 +1,26 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state = ?", 1) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 + +} diff --git a/.history/api/version1/honoraryArchives/operate_photo_20220730104833.go b/.history/api/version1/honoraryArchives/operate_photo_20220730104833.go new file mode 100644 index 0000000..a081b17 --- /dev/null +++ b/.history/api/version1/honoraryArchives/operate_photo_20220730104833.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state = ?", 1) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} diff --git a/.history/api/version1/honoraryArchives/type_20220727153717.go b/.history/api/version1/honoraryArchives/type_20220727153717.go new file mode 100644 index 0000000..e91463c --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220727153717.go @@ -0,0 +1,64 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092721.go b/.history/api/version1/honoraryArchives/type_20220729092721.go new file mode 100644 index 0000000..1b610b2 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092721.go @@ -0,0 +1,67 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092736.go b/.history/api/version1/honoraryArchives/type_20220729092736.go new file mode 100644 index 0000000..9293226 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092736.go @@ -0,0 +1,67 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 diff --git a/.history/api/version1/honoraryArchives/type_20220729092740.go b/.history/api/version1/honoraryArchives/type_20220729092740.go new file mode 100644 index 0000000..29472d8 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092740.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 +type pot \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092741.go b/.history/api/version1/honoraryArchives/type_20220729092741.go new file mode 100644 index 0000000..192df38 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092741.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 +type \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092745.go b/.history/api/version1/honoraryArchives/type_20220729092745.go new file mode 100644 index 0000000..00317bc --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092745.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 +type po \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092752.go b/.history/api/version1/honoraryArchives/type_20220729092752.go new file mode 100644 index 0000000..c3fd9a3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092752.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 +type phoyo \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092754.go b/.history/api/version1/honoraryArchives/type_20220729092754.go new file mode 100644 index 0000000..2195bf6 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092754.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 +type photo \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092756.go b/.history/api/version1/honoraryArchives/type_20220729092756.go new file mode 100644 index 0000000..3212727 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092756.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + + +// 荣誉图片查询字段 +type photoList \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729092808.go b/.history/api/version1/honoraryArchives/type_20220729092808.go new file mode 100644 index 0000000..d34bd58 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092808.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092812.go b/.history/api/version1/honoraryArchives/type_20220729092812.go new file mode 100644 index 0000000..1f154fe --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092812.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092831.go b/.history/api/version1/honoraryArchives/type_20220729092831.go new file mode 100644 index 0000000..d34bd58 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092831.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092834.go b/.history/api/version1/honoraryArchives/type_20220729092834.go new file mode 100644 index 0000000..1f154fe --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092834.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092841.go b/.history/api/version1/honoraryArchives/type_20220729092841.go new file mode 100644 index 0000000..a0b6cbc --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092841.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + pho +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092843.go b/.history/api/version1/honoraryArchives/type_20220729092843.go new file mode 100644 index 0000000..1f154fe --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092843.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + +} diff --git a/.history/api/version1/honoraryArchives/type_20220729092909.go b/.history/api/version1/honoraryArchives/type_20220729092909.go new file mode 100644 index 0000000..d34bd58 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729092909.go @@ -0,0 +1,68 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { +} diff --git a/.history/api/version1/honoraryArchives/type_20220729093133.go b/.history/api/version1/honoraryArchives/type_20220729093133.go new file mode 100644 index 0000000..1f154fe --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729093133.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + +} diff --git a/.history/api/version1/honoraryArchives/type_20220729093136.go b/.history/api/version1/honoraryArchives/type_20220729093136.go new file mode 100644 index 0000000..e41425c --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729093136.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId +} diff --git a/.history/api/version1/honoraryArchives/type_20220729093137.go b/.history/api/version1/honoraryArchives/type_20220729093137.go new file mode 100644 index 0000000..55c6323 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729093137.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + +} diff --git a/.history/api/version1/honoraryArchives/type_20220729093153.go b/.history/api/version1/honoraryArchives/type_20220729093153.go new file mode 100644 index 0000000..680efb7 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729093153.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + add +} diff --git a/.history/api/version1/honoraryArchives/type_20220729093158.go b/.history/api/version1/honoraryArchives/type_20220729093158.go new file mode 100644 index 0000000..dcef676 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729093158.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729093204.go b/.history/api/version1/honoraryArchives/type_20220729093204.go new file mode 100644 index 0000000..dcef676 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729093204.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729105117.go b/.history/api/version1/honoraryArchives/type_20220729105117.go new file mode 100644 index 0000000..a853543 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105117.go @@ -0,0 +1,73 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} + + +//添加图片 \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729105120.go b/.history/api/version1/honoraryArchives/type_20220729105120.go new file mode 100644 index 0000000..5c1e38c --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105120.go @@ -0,0 +1,73 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} + + +//添加图片 diff --git a/.history/api/version1/honoraryArchives/type_20220729105124.go b/.history/api/version1/honoraryArchives/type_20220729105124.go new file mode 100644 index 0000000..37ee465 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105124.go @@ -0,0 +1,74 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} + + +//添加图片 +type pho \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729105127.go b/.history/api/version1/honoraryArchives/type_20220729105127.go new file mode 100644 index 0000000..12fb1fc --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105127.go @@ -0,0 +1,74 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} + + +//添加图片 +type photo \ No newline at end of file diff --git a/.history/api/version1/honoraryArchives/type_20220729105131.go b/.history/api/version1/honoraryArchives/type_20220729105131.go new file mode 100644 index 0000000..7e3403b --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105131.go @@ -0,0 +1,72 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} + + diff --git a/.history/api/version1/honoraryArchives/type_20220729105134.go b/.history/api/version1/honoraryArchives/type_20220729105134.go new file mode 100644 index 0000000..dcef676 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105134.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoListKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729105154.go b/.history/api/version1/honoraryArchives/type_20220729105154.go new file mode 100644 index 0000000..7184a99 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105154.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729105209.go b/.history/api/version1/honoraryArchives/type_20220729105209.go new file mode 100644 index 0000000..56b29ad --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105209.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片查询字段 +type struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729105212.go b/.history/api/version1/honoraryArchives/type_20220729105212.go new file mode 100644 index 0000000..e1dbaf3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105212.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729105218.go b/.history/api/version1/honoraryArchives/type_20220729105218.go new file mode 100644 index 0000000..92ecdfc --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105218.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photo struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729105338.go b/.history/api/version1/honoraryArchives/type_20220729105338.go new file mode 100644 index 0000000..c615c8b --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729105338.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220729113126.go b/.history/api/version1/honoraryArchives/type_20220729113126.go new file mode 100644 index 0000000..bdfd389 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729113126.go @@ -0,0 +1,71 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + +} diff --git a/.history/api/version1/honoraryArchives/type_20220729113148.go b/.history/api/version1/honoraryArchives/type_20220729113148.go new file mode 100644 index 0000000..edfd486 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220729113148.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220730075846.go b/.history/api/version1/honoraryArchives/type_20220730075846.go new file mode 100644 index 0000000..cafae85 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730075846.go @@ -0,0 +1,69 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId +} diff --git a/.history/api/version1/honoraryArchives/type_20220730075915.go b/.history/api/version1/honoraryArchives/type_20220730075915.go new file mode 100644 index 0000000..f43ab1c --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730075915.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + +} diff --git a/.history/api/version1/honoraryArchives/type_20220730080042.go b/.history/api/version1/honoraryArchives/type_20220730080042.go new file mode 100644 index 0000000..edfd486 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730080042.go @@ -0,0 +1,70 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont +} diff --git a/.history/api/version1/honoraryArchives/type_20220730103453.go b/.history/api/version1/honoraryArchives/type_20220730103453.go new file mode 100644 index 0000000..a99741a --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730103453.go @@ -0,0 +1,71 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publ +} diff --git a/.history/api/version1/honoraryArchives/type_20220730103455.go b/.history/api/version1/honoraryArchives/type_20220730103455.go new file mode 100644 index 0000000..41a7fe3 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730103455.go @@ -0,0 +1,72 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publicmethod.PublicId + +} diff --git a/.history/api/version1/honoraryArchives/type_20220730103456.go b/.history/api/version1/honoraryArchives/type_20220730103456.go new file mode 100644 index 0000000..a99741a --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730103456.go @@ -0,0 +1,71 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publ +} diff --git a/.history/api/version1/honoraryArchives/type_20220730103458.go b/.history/api/version1/honoraryArchives/type_20220730103458.go new file mode 100644 index 0000000..ff0d305 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730103458.go @@ -0,0 +1,71 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + public +} diff --git a/.history/api/version1/honoraryArchives/type_20220730103500.go b/.history/api/version1/honoraryArchives/type_20220730103500.go new file mode 100644 index 0000000..9a98617 --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730103500.go @@ -0,0 +1,71 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publicmethod. +} diff --git a/.history/api/version1/honoraryArchives/type_20220730103502.go b/.history/api/version1/honoraryArchives/type_20220730103502.go new file mode 100644 index 0000000..b67e81e --- /dev/null +++ b/.history/api/version1/honoraryArchives/type_20220730103502.go @@ -0,0 +1,71 @@ +package honoraryArchives + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +//荣誉档案入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "荣誉档案入口" + publicmethod.Result(0, outputCont, c) +} + +//荣誉列表查询字段 +type honorListKey struct { + publicmethod.PagesTurn + Name string `json:"name"` //名称 + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int `json:"carrier"` //载体 + AwardTimeBegin string `json:"awardtimebegin"` //获奖时间 + AwardTimeEnd string `json:"awardtimeend"` //获奖时间 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key +} + +//添加荣誉 +type addHonorCont struct { + addCarrierCont + IssuingAgency string `json:"issuingagency"` //发放单位 + Carrier int64 `json:"carrier"` //载体 + AwardTime string `json:"awardtime"` //获奖时间 + EfficientDate string `json:"efficientDate"` //有效期限 + Organize string `json:"organize"` //行政组织 + UserKey string `json:"userkey"` //人员Key + Remark string `json:"remark"` //备注 + ImgUrl []publicmethod.PubilcImageCont `json:"imgurl"` //图片集 +} + +//编辑荣誉 +type eidtHonorCont struct { + publicmethod.PublicId + addHonorCont +} + +//载体类型查询字段 +type carrierListKey struct { + publicmethod.PagesTurn + addCarrierCont +} + +//添加载体类型 +type addCarrierCont struct { + Name string `json:"name"` //名称 +} + +//编辑载体类型 +type eidyCarrierCont struct { + publicmethod.PublicId + addCarrierCont +} + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publicmethod.PagesTurn +} diff --git a/.history/apirouter/apishiyan/maptostruct_20220727153717.go b/.history/apirouter/apishiyan/maptostruct_20220727153717.go new file mode 100644 index 0000000..9ce27ba --- /dev/null +++ b/.history/apirouter/apishiyan/maptostruct_20220727153717.go @@ -0,0 +1,20 @@ +package apishiyan + +import ( + "key_performance_indicators/api/shiyan" + + "github.com/gin-gonic/gin" +) + +//实验 + +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("shiyan") + + var methodBinding = shiyan.AppApiEntry.MapToStructApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("maptostructshiyan", methodBinding.MapToStructShiyan) //map转struct + } +} diff --git a/.history/apirouter/apishiyan/maptostruct_20220728145139.go b/.history/apirouter/apishiyan/maptostruct_20220728145139.go new file mode 100644 index 0000000..9ce27ba --- /dev/null +++ b/.history/apirouter/apishiyan/maptostruct_20220728145139.go @@ -0,0 +1,20 @@ +package apishiyan + +import ( + "key_performance_indicators/api/shiyan" + + "github.com/gin-gonic/gin" +) + +//实验 + +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("shiyan") + + var methodBinding = shiyan.AppApiEntry.MapToStructApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("maptostructshiyan", methodBinding.MapToStructShiyan) //map转struct + } +} diff --git a/.history/apirouter/entry_20220727153717.go b/.history/apirouter/entry_20220727153717.go new file mode 100644 index 0000000..f1bbc6c --- /dev/null +++ b/.history/apirouter/entry_20220727153717.go @@ -0,0 +1,19 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728102633.go b/.history/apirouter/entry_20220728102633.go new file mode 100644 index 0000000..f1bbc6c --- /dev/null +++ b/.history/apirouter/entry_20220728102633.go @@ -0,0 +1,19 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728133925.go b/.history/apirouter/entry_20220728133925.go new file mode 100644 index 0000000..671d65b --- /dev/null +++ b/.history/apirouter/entry_20220728133925.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728133930.go b/.history/apirouter/entry_20220728133930.go new file mode 100644 index 0000000..2012c38 --- /dev/null +++ b/.history/apirouter/entry_20220728133930.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728133931.go b/.history/apirouter/entry_20220728133931.go new file mode 100644 index 0000000..c12f78d --- /dev/null +++ b/.history/apirouter/entry_20220728133931.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi api +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728133937.go b/.history/apirouter/entry_20220728133937.go new file mode 100644 index 0000000..2012c38 --- /dev/null +++ b/.history/apirouter/entry_20220728133937.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134020.go b/.history/apirouter/entry_20220728134020.go new file mode 100644 index 0000000..55071a4 --- /dev/null +++ b/.history/apirouter/entry_20220728134020.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi mytest. +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134022.go b/.history/apirouter/entry_20220728134022.go new file mode 100644 index 0000000..8404fb0 --- /dev/null +++ b/.history/apirouter/entry_20220728134022.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi mytest.ApiEntry +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134035.go b/.history/apirouter/entry_20220728134035.go new file mode 100644 index 0000000..b14c3b0 --- /dev/null +++ b/.history/apirouter/entry_20220728134035.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi mytest.Tes +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134037.go b/.history/apirouter/entry_20220728134037.go new file mode 100644 index 0000000..0a71640 --- /dev/null +++ b/.history/apirouter/entry_20220728134037.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi mytest.TestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134041.go b/.history/apirouter/entry_20220728134041.go new file mode 100644 index 0000000..74e8306 --- /dev/null +++ b/.history/apirouter/entry_20220728134041.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi test +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134046.go b/.history/apirouter/entry_20220728134046.go new file mode 100644 index 0000000..a7f33c1 --- /dev/null +++ b/.history/apirouter/entry_20220728134046.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi testroute. +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134050.go b/.history/apirouter/entry_20220728134050.go new file mode 100644 index 0000000..f6d2d91 --- /dev/null +++ b/.history/apirouter/entry_20220728134050.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi testroute.tes +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134052.go b/.history/apirouter/entry_20220728134052.go new file mode 100644 index 0000000..bd7df3e --- /dev/null +++ b/.history/apirouter/entry_20220728134052.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi testroute.TestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134055.go b/.history/apirouter/entry_20220728134055.go new file mode 100644 index 0000000..c0c4185 --- /dev/null +++ b/.history/apirouter/entry_20220728134055.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134102.go b/.history/apirouter/entry_20220728134102.go new file mode 100644 index 0000000..67598c6 --- /dev/null +++ b/.history/apirouter/entry_20220728134102.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi myt +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134104.go b/.history/apirouter/entry_20220728134104.go new file mode 100644 index 0000000..d5f9005 --- /dev/null +++ b/.history/apirouter/entry_20220728134104.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi mytest. +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134107.go b/.history/apirouter/entry_20220728134107.go new file mode 100644 index 0000000..e97938b --- /dev/null +++ b/.history/apirouter/entry_20220728134107.go @@ -0,0 +1,22 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + testroute "key_performance_indicators/api/myTest/testRoute" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MytestApi mytest.ApiEntry +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134113.go b/.history/apirouter/entry_20220728134113.go new file mode 100644 index 0000000..f1bbc6c --- /dev/null +++ b/.history/apirouter/entry_20220728134113.go @@ -0,0 +1,19 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134248.go b/.history/apirouter/entry_20220728134248.go new file mode 100644 index 0000000..845519b --- /dev/null +++ b/.history/apirouter/entry_20220728134248.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134724.go b/.history/apirouter/entry_20220728134724.go new file mode 100644 index 0000000..4f7f7fc --- /dev/null +++ b/.history/apirouter/entry_20220728134724.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134728.go b/.history/apirouter/entry_20220728134728.go new file mode 100644 index 0000000..fb4a50e --- /dev/null +++ b/.history/apirouter/entry_20220728134728.go @@ -0,0 +1,20 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134743.go b/.history/apirouter/entry_20220728134743.go new file mode 100644 index 0000000..0730cdc --- /dev/null +++ b/.history/apirouter/entry_20220728134743.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134745.go b/.history/apirouter/entry_20220728134745.go new file mode 100644 index 0000000..82f8864 --- /dev/null +++ b/.history/apirouter/entry_20220728134745.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest. +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134755.go b/.history/apirouter/entry_20220728134755.go new file mode 100644 index 0000000..c089bd1 --- /dev/null +++ b/.history/apirouter/entry_20220728134755.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest.TestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134850.go b/.history/apirouter/entry_20220728134850.go new file mode 100644 index 0000000..4813971 --- /dev/null +++ b/.history/apirouter/entry_20220728134850.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + mytest "key_performance_indicators/apirouter/myTest" + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest.TestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134852.go b/.history/apirouter/entry_20220728134852.go new file mode 100644 index 0000000..f59c655 --- /dev/null +++ b/.history/apirouter/entry_20220728134852.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + mytest "key_performance_indicators/apirouter/myTest" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest.TestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/entry_20220728134854.go b/.history/apirouter/entry_20220728134854.go new file mode 100644 index 0000000..f59c655 --- /dev/null +++ b/.history/apirouter/entry_20220728134854.go @@ -0,0 +1,21 @@ +package apirouter + +import ( + "key_performance_indicators/apirouter/apishiyan" + "key_performance_indicators/apirouter/empower" + mytest "key_performance_indicators/apirouter/myTest" + honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" + "key_performance_indicators/apirouter/verifyLogin" + // "key_performance_indicators/v1" +) + +//路由结构 +type RouterGroup struct { + EmpowerRouter empower.EmpowerApiRouter + VerifyLogin verifyLogin.ApiRouter + ShiyanApi apishiyan.ApiRouter + HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest.TestApi +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/.history/apirouter/myTest/myTest_route_20220728104853.go b/.history/apirouter/myTest/myTest_route_20220728104853.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/apirouter/myTest/myTest_route_20220728104907.go b/.history/apirouter/myTest/myTest_route_20220728104907.go new file mode 100644 index 0000000..d9f4502 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104907.go @@ -0,0 +1 @@ +pac \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104908.go b/.history/apirouter/myTest/myTest_route_20220728104908.go new file mode 100644 index 0000000..2d1f664 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104908.go @@ -0,0 +1 @@ +package mytest diff --git a/.history/apirouter/myTest/myTest_route_20220728104926.go b/.history/apirouter/myTest/myTest_route_20220728104926.go new file mode 100644 index 0000000..5c6e9a1 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104926.go @@ -0,0 +1,5 @@ +package mytest + +func () { + +} \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104939.go b/.history/apirouter/myTest/myTest_route_20220728104939.go new file mode 100644 index 0000000..fadfa6d --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104939.go @@ -0,0 +1,5 @@ +package mytest + +func RouterGroup() { + +} \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104941.go b/.history/apirouter/myTest/myTest_route_20220728104941.go new file mode 100644 index 0000000..979d8f3 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104941.go @@ -0,0 +1,5 @@ +package mytest + +func ()RouterGroup() { + +} \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104946.go b/.history/apirouter/myTest/myTest_route_20220728104946.go new file mode 100644 index 0000000..6ac5e10 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104946.go @@ -0,0 +1,5 @@ +package mytest + +func (m *)RouterGroup() { + +} \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104952.go b/.history/apirouter/myTest/myTest_route_20220728104952.go new file mode 100644 index 0000000..647dff2 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104952.go @@ -0,0 +1,5 @@ +package mytest + +func (t T)RouterGroup() { + +} \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104955.go b/.history/apirouter/myTest/myTest_route_20220728104955.go new file mode 100644 index 0000000..a283ffa --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104955.go @@ -0,0 +1,5 @@ +package mytest + +func (t *Te)RouterGroup() { + +} \ No newline at end of file diff --git a/.history/apirouter/myTest/myTest_route_20220728104956.go b/.history/apirouter/myTest/myTest_route_20220728104956.go new file mode 100644 index 0000000..98575ed --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728104956.go @@ -0,0 +1,5 @@ +package mytest + +func (t *TestApi) RouterGroup() { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105027.go b/.history/apirouter/myTest/myTest_route_20220728105027.go new file mode 100644 index 0000000..98575ed --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105027.go @@ -0,0 +1,5 @@ +package mytest + +func (t *TestApi) RouterGroup() { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105055.go b/.history/apirouter/myTest/myTest_route_20220728105055.go new file mode 100644 index 0000000..d549616 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105055.go @@ -0,0 +1,5 @@ +package mytest + +func (t *TestApi) RouterGroup() { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105105.go b/.history/apirouter/myTest/myTest_route_20220728105105.go new file mode 100644 index 0000000..d1d3e7d --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105105.go @@ -0,0 +1,5 @@ +package mytest + +func (t *TestApi) RouterGroup(route *gin.r) { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105106.go b/.history/apirouter/myTest/myTest_route_20220728105106.go new file mode 100644 index 0000000..b185819 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105106.go @@ -0,0 +1,5 @@ +package mytest + +func (t *TestApi) RouterGroup(route *gin.) { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105112.go b/.history/apirouter/myTest/myTest_route_20220728105112.go new file mode 100644 index 0000000..1e2fb45 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105112.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105113.go b/.history/apirouter/myTest/myTest_route_20220728105113.go new file mode 100644 index 0000000..abee1c8 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105113.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105120.go b/.history/apirouter/myTest/myTest_route_20220728105120.go new file mode 100644 index 0000000..a9b4202 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105120.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + api +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105128.go b/.history/apirouter/myTest/myTest_route_20220728105128.go new file mode 100644 index 0000000..9f16f96 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105128.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105130.go b/.history/apirouter/myTest/myTest_route_20220728105130.go new file mode 100644 index 0000000..af1fc43 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105130.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := t.RouterGroup() +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105140.go b/.history/apirouter/myTest/myTest_route_20220728105140.go new file mode 100644 index 0000000..8a01d50 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105140.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("") +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105142.go b/.history/apirouter/myTest/myTest_route_20220728105142.go new file mode 100644 index 0000000..4d5e803 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105142.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/") +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105146.go b/.history/apirouter/myTest/myTest_route_20220728105146.go new file mode 100644 index 0000000..9dc7463 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105146.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTes") +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105147.go b/.history/apirouter/myTest/myTest_route_20220728105147.go new file mode 100644 index 0000000..8bde466 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105147.go @@ -0,0 +1,7 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105150.go b/.history/apirouter/myTest/myTest_route_20220728105150.go new file mode 100644 index 0000000..abfb0f0 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105150.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + apiRouter. +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105157.go b/.history/apirouter/myTest/myTest_route_20220728105157.go new file mode 100644 index 0000000..195276d --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105157.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105755.go b/.history/apirouter/myTest/myTest_route_20220728105755.go new file mode 100644 index 0000000..c2cbecb --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105755.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") +// +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105757.go b/.history/apirouter/myTest/myTest_route_20220728105757.go new file mode 100644 index 0000000..66028fc --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105757.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") +/ +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105758.go b/.history/apirouter/myTest/myTest_route_20220728105758.go new file mode 100644 index 0000000..36adc9f --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105758.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + // apiRouter := route.Group("/myTest") +/ +} diff --git a/.history/apirouter/myTest/myTest_route_20220728105759.go b/.history/apirouter/myTest/myTest_route_20220728105759.go new file mode 100644 index 0000000..8d2ac61 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728105759.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + // apiRouter := route.Group("/myTest") + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728132849.go b/.history/apirouter/myTest/myTest_route_20220728132849.go new file mode 100644 index 0000000..195276d --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728132849.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728132850.go b/.history/apirouter/myTest/myTest_route_20220728132850.go new file mode 100644 index 0000000..efd5973 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728132850.go @@ -0,0 +1,8 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728132907.go b/.history/apirouter/myTest/myTest_route_20220728132907.go new file mode 100644 index 0000000..7420236 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728132907.go @@ -0,0 +1,9 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133649.go b/.history/apirouter/myTest/myTest_route_20220728133649.go new file mode 100644 index 0000000..3a0936c --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133649.go @@ -0,0 +1,9 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133651.go b/.history/apirouter/myTest/myTest_route_20220728133651.go new file mode 100644 index 0000000..3a0936c --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133651.go @@ -0,0 +1,9 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133701.go b/.history/apirouter/myTest/myTest_route_20220728133701.go new file mode 100644 index 0000000..fb35df0 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133701.go @@ -0,0 +1,9 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = t. +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133702.go b/.history/apirouter/myTest/myTest_route_20220728133702.go new file mode 100644 index 0000000..3a0936c --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133702.go @@ -0,0 +1,9 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133710.go b/.history/apirouter/myTest/myTest_route_20220728133710.go new file mode 100644 index 0000000..3a0936c --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133710.go @@ -0,0 +1,9 @@ +package mytest + +import "github.com/gin-gonic/gin" + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133719.go b/.history/apirouter/myTest/myTest_route_20220728133719.go new file mode 100644 index 0000000..6d8dfa6 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133719.go @@ -0,0 +1,13 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest. +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133724.go b/.history/apirouter/myTest/myTest_route_20220728133724.go new file mode 100644 index 0000000..aca5f76 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133724.go @@ -0,0 +1,13 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.ApiEntry.Test +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133730.go b/.history/apirouter/myTest/myTest_route_20220728133730.go new file mode 100644 index 0000000..af6d70d --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133730.go @@ -0,0 +1,13 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133750.go b/.history/apirouter/myTest/myTest_route_20220728133750.go new file mode 100644 index 0000000..6d8dfa6 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133750.go @@ -0,0 +1,13 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest. +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133753.go b/.history/apirouter/myTest/myTest_route_20220728133753.go new file mode 100644 index 0000000..b70a58e --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133753.go @@ -0,0 +1,13 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry. +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133755.go b/.history/apirouter/myTest/myTest_route_20220728133755.go new file mode 100644 index 0000000..09d7da1 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133755.go @@ -0,0 +1,14 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133757.go b/.history/apirouter/myTest/myTest_route_20220728133757.go new file mode 100644 index 0000000..709ac81 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133757.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133759.go b/.history/apirouter/myTest/myTest_route_20220728133759.go new file mode 100644 index 0000000..cb31d5a --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133759.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + ap + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133803.go b/.history/apirouter/myTest/myTest_route_20220728133803.go new file mode 100644 index 0000000..ffad631 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133803.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + api + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133805.go b/.history/apirouter/myTest/myTest_route_20220728133805.go new file mode 100644 index 0000000..4be8d11 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133805.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter. + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133809.go b/.history/apirouter/myTest/myTest_route_20220728133809.go new file mode 100644 index 0000000..7b7eef5 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133809.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/") + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133812.go b/.history/apirouter/myTest/myTest_route_20220728133812.go new file mode 100644 index 0000000..40eefa7 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133812.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest") + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133814.go b/.history/apirouter/myTest/myTest_route_20220728133814.go new file mode 100644 index 0000000..623aeb5 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133814.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest`") + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133815.go b/.history/apirouter/myTest/myTest_route_20220728133815.go new file mode 100644 index 0000000..40eefa7 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133815.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest") + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133817.go b/.history/apirouter/myTest/myTest_route_20220728133817.go new file mode 100644 index 0000000..ebfb387 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133817.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest",) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133823.go b/.history/apirouter/myTest/myTest_route_20220728133823.go new file mode 100644 index 0000000..3bd5a06 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133823.go @@ -0,0 +1,16 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133830.go b/.history/apirouter/myTest/myTest_route_20220728133830.go new file mode 100644 index 0000000..c372752 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133830.go @@ -0,0 +1,17 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + apiRouter.GET("/") + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133832.go b/.history/apirouter/myTest/myTest_route_20220728133832.go new file mode 100644 index 0000000..552b7f0 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133832.go @@ -0,0 +1,17 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + apiRouter.GET("/",m) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133833.go b/.history/apirouter/myTest/myTest_route_20220728133833.go new file mode 100644 index 0000000..bd96f7c --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133833.go @@ -0,0 +1,17 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + apiRouter.GET("/",methodBinding.Index) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133834.go b/.history/apirouter/myTest/myTest_route_20220728133834.go new file mode 100644 index 0000000..0660ab1 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133834.go @@ -0,0 +1,18 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + apiRouter.GET("/",methodBinding.Index) + apiRouter.GET("/",methodBinding.Index) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133838.go b/.history/apirouter/myTest/myTest_route_20220728133838.go new file mode 100644 index 0000000..500b551 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133838.go @@ -0,0 +1,18 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + apiRouter.GET("/", methodBinding.Index) + apiRouter.POST("/", methodBinding.Index) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728133844.go b/.history/apirouter/myTest/myTest_route_20220728133844.go new file mode 100644 index 0000000..31c6bad --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728133844.go @@ -0,0 +1,18 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.POST("/myTest", methodBinding.MyTest) + apiRouter.GET("/", methodBinding.Index) + apiRouter.POST("/", methodBinding.Index) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728140734.go b/.history/apirouter/myTest/myTest_route_20220728140734.go new file mode 100644 index 0000000..500b551 --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728140734.go @@ -0,0 +1,18 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.GET("/myTest", methodBinding.MyTest) + apiRouter.GET("/", methodBinding.Index) + apiRouter.POST("/", methodBinding.Index) + } +} diff --git a/.history/apirouter/myTest/myTest_route_20220728140931.go b/.history/apirouter/myTest/myTest_route_20220728140931.go new file mode 100644 index 0000000..31c6bad --- /dev/null +++ b/.history/apirouter/myTest/myTest_route_20220728140931.go @@ -0,0 +1,18 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.POST("/myTest", methodBinding.MyTest) + apiRouter.GET("/", methodBinding.Index) + apiRouter.POST("/", methodBinding.Index) + } +} diff --git a/.history/apirouter/myTest/type_20220728104752.go b/.history/apirouter/myTest/type_20220728104752.go new file mode 100644 index 0000000..e69de29 diff --git a/.history/apirouter/myTest/type_20220728104756.go b/.history/apirouter/myTest/type_20220728104756.go new file mode 100644 index 0000000..3d44f91 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728104756.go @@ -0,0 +1 @@ +var \ No newline at end of file diff --git a/.history/apirouter/myTest/type_20220728104818.go b/.history/apirouter/myTest/type_20220728104818.go new file mode 100644 index 0000000..d9f4502 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728104818.go @@ -0,0 +1 @@ +pac \ No newline at end of file diff --git a/.history/apirouter/myTest/type_20220728104822.go b/.history/apirouter/myTest/type_20220728104822.go new file mode 100644 index 0000000..1a47384 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728104822.go @@ -0,0 +1,3 @@ +package mytest + +var \ No newline at end of file diff --git a/.history/apirouter/myTest/type_20220728104833.go b/.history/apirouter/myTest/type_20220728104833.go new file mode 100644 index 0000000..02be8ec --- /dev/null +++ b/.history/apirouter/myTest/type_20220728104833.go @@ -0,0 +1,3 @@ +package mytest + +var Test str \ No newline at end of file diff --git a/.history/apirouter/myTest/type_20220728104835.go b/.history/apirouter/myTest/type_20220728104835.go new file mode 100644 index 0000000..e612bf1 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728104835.go @@ -0,0 +1,3 @@ +package mytest + +var Test struct{} \ No newline at end of file diff --git a/.history/apirouter/myTest/type_20220728104837.go b/.history/apirouter/myTest/type_20220728104837.go new file mode 100644 index 0000000..9aa7f64 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728104837.go @@ -0,0 +1,3 @@ +package mytest + +var TestApi struct{} diff --git a/.history/apirouter/myTest/type_20220728105052.go b/.history/apirouter/myTest/type_20220728105052.go new file mode 100644 index 0000000..ee962b4 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728105052.go @@ -0,0 +1,3 @@ +package mytest + +type TestApi struct{} diff --git a/.history/apirouter/myTest/type_20220728130856.go b/.history/apirouter/myTest/type_20220728130856.go new file mode 100644 index 0000000..ee484c0 --- /dev/null +++ b/.history/apirouter/myTest/type_20220728130856.go @@ -0,0 +1,4 @@ +package mytest + +type TestApi struct{} + diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220727153717.go b/.history/apirouter/v1/honorsRoute/honors_route_20220727153717.go new file mode 100644 index 0000000..8563465 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220727153717.go @@ -0,0 +1,28 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103606.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103606.go new file mode 100644 index 0000000..738237b --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103606.go @@ -0,0 +1,30 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103611.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103611.go new file mode 100644 index 0000000..9e1f6e7 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103611.go @@ -0,0 +1,30 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103614.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103614.go new file mode 100644 index 0000000..9b297db --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103614.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103615.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103615.go new file mode 100644 index 0000000..7857e91 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103615.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + api + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103618.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103618.go new file mode 100644 index 0000000..80cdd08 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103618.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.ge + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103624.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103624.go new file mode 100644 index 0000000..f412e3d --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103624.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST() + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103625.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103625.go new file mode 100644 index 0000000..ff5bd18 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103625.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103637.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103637.go new file mode 100644 index 0000000..ff5bd18 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103637.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103652.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103652.go new file mode 100644 index 0000000..1911331 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103652.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("ReviewImage") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103654.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103654.go new file mode 100644 index 0000000..02353aa --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103654.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewImage") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103656.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103656.go new file mode 100644 index 0000000..cebe5ef --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103656.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103700.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103700.go new file mode 100644 index 0000000..cefa794 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103700.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",me) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103704.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103704.go new file mode 100644 index 0000000..9f2b45c --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103704.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.R) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103705.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103705.go new file mode 100644 index 0000000..b3355b3 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103705.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103714.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103714.go new file mode 100644 index 0000000..4e991ea --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103714.go @@ -0,0 +1,32 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiro + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103720.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103720.go new file mode 100644 index 0000000..7d8da7e --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103720.go @@ -0,0 +1,32 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103724.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103724.go new file mode 100644 index 0000000..64af50f --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103724.go @@ -0,0 +1,32 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimgae") + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103725.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103725.go new file mode 100644 index 0000000..179863c --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103725.go @@ -0,0 +1,32 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimgae",) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103727.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103727.go new file mode 100644 index 0000000..0b1b4e2 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103727.go @@ -0,0 +1,32 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimage",) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103734.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103734.go new file mode 100644 index 0000000..97a3520 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103734.go @@ -0,0 +1,32 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimage",me) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103751.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103751.go new file mode 100644 index 0000000..eab08a2 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103751.go @@ -0,0 +1,33 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage",methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimage",methodBinding.EditImage) // 编辑图片 + apiRouter.POST("delimage",me) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729103758.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729103758.go new file mode 100644 index 0000000..a0b6c5a --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729103758.go @@ -0,0 +1,33 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimage", methodBinding.EditImage) // 编辑图片 + apiRouter.POST("delimage", methodBinding.DelImage) + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220729105457.go b/.history/apirouter/v1/honorsRoute/honors_route_20220729105457.go new file mode 100644 index 0000000..4aa89c3 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220729105457.go @@ -0,0 +1,33 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 + apiRouter.POST("editimage", methodBinding.EditImage) // 编辑图片 + apiRouter.POST("delimage", methodBinding.DelImage) // 删除图片 + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220730103936.go b/.history/apirouter/v1/honorsRoute/honors_route_20220730103936.go new file mode 100644 index 0000000..e024864 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220730103936.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220730104854.go b/.history/apirouter/v1/honorsRoute/honors_route_20220730104854.go new file mode 100644 index 0000000..e024864 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220730104854.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220730104908.go b/.history/apirouter/v1/honorsRoute/honors_route_20220730104908.go new file mode 100644 index 0000000..e024864 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220730104908.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 + } +} diff --git a/.history/apirouter/v1/honorsRoute/honors_route_20220730113546.go b/.history/apirouter/v1/honorsRoute/honors_route_20220730113546.go new file mode 100644 index 0000000..e024864 --- /dev/null +++ b/.history/apirouter/v1/honorsRoute/honors_route_20220730113546.go @@ -0,0 +1,31 @@ +package honorsRoute + +import ( + "key_performance_indicators/api/version1" + + "github.com/gin-gonic/gin" +) + +//荣誉墙 +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("honors") + + var methodBinding = version1.AppApiEntry.HonorsApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("honorlist", methodBinding.HonorList) //荣誉列表 + apiRouter.POST("addhonorcont", methodBinding.AddHonorCont) //添加荣誉 + apiRouter.POST("eidyhonorcont", methodBinding.EidyHonorCont) //编辑荣誉 + apiRouter.POST("eidyhonorcontstate", methodBinding.EidyHonorContState) //编辑荣誉状态 + + //载体类型 + apiRouter.POST("carrierlist", methodBinding.CarrierList) //载体类型列表 + apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 + apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 + apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 + } +} diff --git a/.history/config/configApp/appConfig_20220727153717.yaml b/.history/config/configApp/appConfig_20220727153717.yaml new file mode 100644 index 0000000..7eda376 --- /dev/null +++ b/.history/config/configApp/appConfig_20220727153717.yaml @@ -0,0 +1,21 @@ + +#App主配置 +appsetup: + port: 6666 #服务端口 + readtime: 3600 #请求的读取操作在超时前的最大持续时间 + writetime : 3600 #回复的写入操作在超时前的最大持续时间 + appkey: 'heng_xin_gao_ke_AppKey' #应用程序密钥 + password: '123456789' #系统默认密码 + prefix: 'HXJT' #系统字段前缀 +logconfig: + path: 'log' #日志保存地址 +#验证码相关设置 +captcha: + key-long: 6 + img-width: 240 + img-height: 80 + +#Redis前缀 +redisprefix: + prefix: "HXGK_GO_ZhixingCollege" + alias: "dev" \ No newline at end of file diff --git a/.history/config/configApp/appConfig_20220728114508.yaml b/.history/config/configApp/appConfig_20220728114508.yaml new file mode 100644 index 0000000..7ef221a --- /dev/null +++ b/.history/config/configApp/appConfig_20220728114508.yaml @@ -0,0 +1,21 @@ + +#App主配置 +appsetup: + port: 8080 #服务端口 + readtime: 3600 #请求的读取操作在超时前的最大持续时间 + writetime : 3600 #回复的写入操作在超时前的最大持续时间 + appkey: 'heng_xin_gao_ke_AppKey' #应用程序密钥 + password: '123456789' #系统默认密码 + prefix: 'HXJT' #系统字段前缀 +logconfig: + path: 'log' #日志保存地址 +#验证码相关设置 +captcha: + key-long: 6 + img-width: 240 + img-height: 80 + +#Redis前缀 +redisprefix: + prefix: "HXGK_GO_ZhixingCollege" + alias: "dev" \ No newline at end of file diff --git a/.history/config/configApp/appConfig_20220728114533.yaml b/.history/config/configApp/appConfig_20220728114533.yaml new file mode 100644 index 0000000..7eda376 --- /dev/null +++ b/.history/config/configApp/appConfig_20220728114533.yaml @@ -0,0 +1,21 @@ + +#App主配置 +appsetup: + port: 6666 #服务端口 + readtime: 3600 #请求的读取操作在超时前的最大持续时间 + writetime : 3600 #回复的写入操作在超时前的最大持续时间 + appkey: 'heng_xin_gao_ke_AppKey' #应用程序密钥 + password: '123456789' #系统默认密码 + prefix: 'HXJT' #系统字段前缀 +logconfig: + path: 'log' #日志保存地址 +#验证码相关设置 +captcha: + key-long: 6 + img-width: 240 + img-height: 80 + +#Redis前缀 +redisprefix: + prefix: "HXGK_GO_ZhixingCollege" + alias: "dev" \ No newline at end of file diff --git a/.history/config/configApp/appConfig_20220728130428.yaml b/.history/config/configApp/appConfig_20220728130428.yaml new file mode 100644 index 0000000..7eda376 --- /dev/null +++ b/.history/config/configApp/appConfig_20220728130428.yaml @@ -0,0 +1,21 @@ + +#App主配置 +appsetup: + port: 6666 #服务端口 + readtime: 3600 #请求的读取操作在超时前的最大持续时间 + writetime : 3600 #回复的写入操作在超时前的最大持续时间 + appkey: 'heng_xin_gao_ke_AppKey' #应用程序密钥 + password: '123456789' #系统默认密码 + prefix: 'HXJT' #系统字段前缀 +logconfig: + path: 'log' #日志保存地址 +#验证码相关设置 +captcha: + key-long: 6 + img-width: 240 + img-height: 80 + +#Redis前缀 +redisprefix: + prefix: "HXGK_GO_ZhixingCollege" + alias: "dev" \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220727153717.go b/.history/config/configDatabase/database_20220727153717.go new file mode 100644 index 0000000..03e714f --- /dev/null +++ b/.history/config/configDatabase/database_20220727153717.go @@ -0,0 +1,82 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220727153717.yaml b/.history/config/configDatabase/database_20220727153717.yaml new file mode 100644 index 0000000..f57cc03 --- /dev/null +++ b/.history/config/configDatabase/database_20220727153717.yaml @@ -0,0 +1,192 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145336.yaml b/.history/config/configDatabase/database_20220728145336.yaml new file mode 100644 index 0000000..cd1c5dd --- /dev/null +++ b/.history/config/configDatabase/database_20220728145336.yaml @@ -0,0 +1,196 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145344.yaml b/.history/config/configDatabase/database_20220728145344.yaml new file mode 100644 index 0000000..8a532b6 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145344.yaml @@ -0,0 +1,196 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145347.yaml b/.history/config/configDatabase/database_20220728145347.yaml new file mode 100644 index 0000000..91e0f28 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145347.yaml @@ -0,0 +1,197 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145401.yaml b/.history/config/configDatabase/database_20220728145401.yaml new file mode 100644 index 0000000..ab7f1bb --- /dev/null +++ b/.history/config/configDatabase/database_20220728145401.yaml @@ -0,0 +1,197 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path:'127.0.0.1' \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145405.yaml b/.history/config/configDatabase/database_20220728145405.yaml new file mode 100644 index 0000000..3d93bb6 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145405.yaml @@ -0,0 +1,198 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path:'127.0.0.1' + \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145407.yaml b/.history/config/configDatabase/database_20220728145407.yaml new file mode 100644 index 0000000..037651d --- /dev/null +++ b/.history/config/configDatabase/database_20220728145407.yaml @@ -0,0 +1,198 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path:'127.0.0.1' + port \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145410.yaml b/.history/config/configDatabase/database_20220728145410.yaml new file mode 100644 index 0000000..5ec3b73 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145410.yaml @@ -0,0 +1,198 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path:'127.0.0.1' + port:3306 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145419.yaml b/.history/config/configDatabase/database_20220728145419.yaml new file mode 100644 index 0000000..6c8fd3c --- /dev/null +++ b/.history/config/configDatabase/database_20220728145419.yaml @@ -0,0 +1,198 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path:'127.0.0.1' + port: 3306 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145420.yaml b/.history/config/configDatabase/database_20220728145420.yaml new file mode 100644 index 0000000..eb8078e --- /dev/null +++ b/.history/config/configDatabase/database_20220728145420.yaml @@ -0,0 +1,198 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path: '127.0.0.1' + port: 3306 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145421.yaml b/.history/config/configDatabase/database_20220728145421.yaml new file mode 100644 index 0000000..ba5b350 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145421.yaml @@ -0,0 +1,199 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path: '127.0.0.1' + port: 3306 + \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145428.yaml b/.history/config/configDatabase/database_20220728145428.yaml new file mode 100644 index 0000000..e3aaf84 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145428.yaml @@ -0,0 +1,207 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145434.yaml b/.history/config/configDatabase/database_20220728145434.yaml new file mode 100644 index 0000000..8fd2f0b --- /dev/null +++ b/.history/config/configDatabase/database_20220728145434.yaml @@ -0,0 +1,207 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145440.yaml b/.history/config/configDatabase/database_20220728145440.yaml new file mode 100644 index 0000000..d6f1e62 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145440.yaml @@ -0,0 +1,207 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'test' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145445.yaml b/.history/config/configDatabase/database_20220728145445.yaml new file mode 100644 index 0000000..47c1fdc --- /dev/null +++ b/.history/config/configDatabase/database_20220728145445.yaml @@ -0,0 +1,207 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + + + #测试数据库 + test: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'test' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 \ No newline at end of file diff --git a/.history/config/configDatabase/database_20220728145509.go b/.history/config/configDatabase/database_20220728145509.go new file mode 100644 index 0000000..d682609 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145509.go @@ -0,0 +1,83 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + test +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145515.go b/.history/config/configDatabase/database_20220728145515.go new file mode 100644 index 0000000..a5358e3 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145515.go @@ -0,0 +1,83 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + Test +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145523.go b/.history/config/configDatabase/database_20220728145523.go new file mode 100644 index 0000000..85bc93b --- /dev/null +++ b/.history/config/configDatabase/database_20220728145523.go @@ -0,0 +1,83 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + Test MasterMysqlSetUp +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145525.go b/.history/config/configDatabase/database_20220728145525.go new file mode 100644 index 0000000..fe9561a --- /dev/null +++ b/.history/config/configDatabase/database_20220728145525.go @@ -0,0 +1,83 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + Test MasterMysqlSetUp +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145530.go b/.history/config/configDatabase/database_20220728145530.go new file mode 100644 index 0000000..7d6ddab --- /dev/null +++ b/.history/config/configDatabase/database_20220728145530.go @@ -0,0 +1,83 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + Test MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145534.go b/.history/config/configDatabase/database_20220728145534.go new file mode 100644 index 0000000..ec3d4c7 --- /dev/null +++ b/.history/config/configDatabase/database_20220728145534.go @@ -0,0 +1,83 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + Test MasterMysqlSetUp `mapstructure:"test" json:"managearchives" yaml:"managearchives"` +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145539.go b/.history/config/configDatabase/database_20220728145539.go new file mode 100644 index 0000000..03e714f --- /dev/null +++ b/.history/config/configDatabase/database_20220728145539.go @@ -0,0 +1,82 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/config/configDatabase/database_20220728145546.yaml b/.history/config/configDatabase/database_20220728145546.yaml new file mode 100644 index 0000000..5aacf0f --- /dev/null +++ b/.history/config/configDatabase/database_20220728145546.yaml @@ -0,0 +1,192 @@ +#数据库配置 + +#主数据库 +master: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'hengxingaoke_tes' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#微信数据库 +wechat: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatuser' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: false #是否开启gorm日志 +#HR数据库 +hrdatabase: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'human_resources_jindie' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#文档属性数据库 +fileBookDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'learn_message' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#错题库 +errorSubjectDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wrong_question_bank' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 +#自我测验 +myTestDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'selftestdatabase' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#图文信息数据库 +imageTextDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'readdocument' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#计分明细数据库 +scoringDetailsDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'league_table_data' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#趣味问答 +questionsAnswersDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'ques_and_answers' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#风云榜统计数据库 +billboardDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'statisticsing' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#健康上报数据库 +healthReportDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'location' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#绩效考核数据库 +kpiDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'performanceappraisal' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#企业微信回调记录 +wechatCallBackLogDate: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'wechatlog' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 + +#管理档案 +managearchives: + url_path: '127.0.0.1' #数据库地址 + port: 3306 #数据库端口 + charset: 'utf8mb4' #数据库编码方式 + parseTime: 'True' #是否自动转换时间 + loc: 'Local' #时区 + name: 'manage_archives' #数据库名称 + username: 'root' #数据库用户民 + password: 'root' #数据库密码 + max_idle_conns: 100 #最大空闲数量 + max_open_conns: 1500 #最大打开数量 + gorm_log: true #是否开启gorm日志 diff --git a/.history/config/configDatabase/database_20220810092953.go b/.history/config/configDatabase/database_20220810092953.go new file mode 100644 index 0000000..03e714f --- /dev/null +++ b/.history/config/configDatabase/database_20220810092953.go @@ -0,0 +1,82 @@ +package configDatabase + +import ( + "fmt" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime == true { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog == true { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + return opDb + } + } + +} diff --git a/.history/go_20220728113319.mod b/.history/go_20220728113319.mod new file mode 100644 index 0000000..666f6f8 --- /dev/null +++ b/.history/go_20220728113319.mod @@ -0,0 +1,55 @@ +module key_performance_indicators + +go 1.18 + +require ( + github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 + github.com/fsnotify/fsnotify v1.5.4 + github.com/gin-gonic/gin v1.8.1 + github.com/go-redis/redis/v8 v8.11.5 + github.com/mitchellh/mapstructure v1.5.0 + github.com/mojocn/base64Captcha v1.3.5 + github.com/mozillazg/go-pinyin v0.19.0 + github.com/spf13/viper v1.12.0 + gorm.io/driver/mysql v1.3.5 + gorm.io/gorm v1.23.8 +) + +require ( + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/flipped-aurora/gin-vue-admin v2.5.3+incompatible // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.3.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect +) diff --git a/.history/go_20220728113347.mod b/.history/go_20220728113347.mod new file mode 100644 index 0000000..666f6f8 --- /dev/null +++ b/.history/go_20220728113347.mod @@ -0,0 +1,55 @@ +module key_performance_indicators + +go 1.18 + +require ( + github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 + github.com/fsnotify/fsnotify v1.5.4 + github.com/gin-gonic/gin v1.8.1 + github.com/go-redis/redis/v8 v8.11.5 + github.com/mitchellh/mapstructure v1.5.0 + github.com/mojocn/base64Captcha v1.3.5 + github.com/mozillazg/go-pinyin v0.19.0 + github.com/spf13/viper v1.12.0 + gorm.io/driver/mysql v1.3.5 + gorm.io/gorm v1.23.8 +) + +require ( + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/flipped-aurora/gin-vue-admin v2.5.3+incompatible // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.3.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect +) diff --git a/.history/go_20220728113424.mod b/.history/go_20220728113424.mod new file mode 100644 index 0000000..8616d06 --- /dev/null +++ b/.history/go_20220728113424.mod @@ -0,0 +1,55 @@ +module key_performance_indicators + +go 1.18 + +require ( + // github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 + github.com/fsnotify/fsnotify v1.5.4 + github.com/gin-gonic/gin v1.8.1 + github.com/go-redis/redis/v8 v8.11.5 + github.com/mitchellh/mapstructure v1.5.0 + github.com/mojocn/base64Captcha v1.3.5 + github.com/mozillazg/go-pinyin v0.19.0 + github.com/spf13/viper v1.12.0 + gorm.io/driver/mysql v1.3.5 + gorm.io/gorm v1.23.8 +) + +require ( + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/flipped-aurora/gin-vue-admin v2.5.3+incompatible // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.3.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect +) diff --git a/.history/go_20220728113427.mod b/.history/go_20220728113427.mod new file mode 100644 index 0000000..8616d06 --- /dev/null +++ b/.history/go_20220728113427.mod @@ -0,0 +1,55 @@ +module key_performance_indicators + +go 1.18 + +require ( + // github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 + github.com/fsnotify/fsnotify v1.5.4 + github.com/gin-gonic/gin v1.8.1 + github.com/go-redis/redis/v8 v8.11.5 + github.com/mitchellh/mapstructure v1.5.0 + github.com/mojocn/base64Captcha v1.3.5 + github.com/mozillazg/go-pinyin v0.19.0 + github.com/spf13/viper v1.12.0 + gorm.io/driver/mysql v1.3.5 + gorm.io/gorm v1.23.8 +) + +require ( + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/flipped-aurora/gin-vue-admin v2.5.3+incompatible // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.3.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect +) diff --git a/.history/go_20220728113449.mod b/.history/go_20220728113449.mod new file mode 100644 index 0000000..666f6f8 --- /dev/null +++ b/.history/go_20220728113449.mod @@ -0,0 +1,55 @@ +module key_performance_indicators + +go 1.18 + +require ( + github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 + github.com/fsnotify/fsnotify v1.5.4 + github.com/gin-gonic/gin v1.8.1 + github.com/go-redis/redis/v8 v8.11.5 + github.com/mitchellh/mapstructure v1.5.0 + github.com/mojocn/base64Captcha v1.3.5 + github.com/mozillazg/go-pinyin v0.19.0 + github.com/spf13/viper v1.12.0 + gorm.io/driver/mysql v1.3.5 + gorm.io/gorm v1.23.8 +) + +require ( + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/flipped-aurora/gin-vue-admin v2.5.3+incompatible // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.3.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect +) diff --git a/.history/initialization/app/run_20220727152945.go b/.history/initialization/app/run_20220727152945.go new file mode 100644 index 0000000..d22ac79 --- /dev/null +++ b/.history/initialization/app/run_20220727152945.go @@ -0,0 +1,27 @@ +package app + +import ( + "fmt" + "key_performance_indicators/initialization" + "key_performance_indicators/initialization/route" + "key_performance_indicators/overall" +) + +type server interface { + ListenAndServe() error +} + +//启动服务 +func RunItem() { + //加载基础配置 + // var appConfig configApp.Server + initialization.RunViper(&overall.CONSTANT_CONFIG) + // fmt.Printf("----------->%v", overall.CONSTANT_CONFIG) + routers := route.InitialRouter() + portStr := fmt.Sprintf(":%d", overall.CONSTANT_CONFIG.Appsetup.Port) + startUp := InitServer(portStr, routers) + + fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) + runErr := startUp.ListenAndServe().Error() + panic(fmt.Errorf(runErr)) +} diff --git a/.history/initialization/app/run_20220728114254.go b/.history/initialization/app/run_20220728114254.go new file mode 100644 index 0000000..794b40c --- /dev/null +++ b/.history/initialization/app/run_20220728114254.go @@ -0,0 +1,27 @@ +package app + +import ( + "fmt" + "key_performance_indicators/initialization" + "key_performance_indicators/initialization/route" + "key_performance_indicators/overall" +) + +type server interface { + ListenAndServe() error +} + +//启动服务 +func RunItem() { + //加载基础配置 + // var appConfig configApp.Server + initialization.RunViper(&overall.CONSTANT_CONFIG) + // fmt.Printf("----------->%v", overall.CONSTANT_CONFIG) + routers := route.InitialRouter() + portStr := fmt.Sprintf(":%d", overall.CONSTANT_CONFIG.Appsetup.Port) + startUp := InitServer(portStr, routers) + + fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) + runErr := startUp.ListenAndServe().Error() + panic(fmt.Errorf(runErr)) +} diff --git a/.history/initialization/app/run_20220728114258.go b/.history/initialization/app/run_20220728114258.go new file mode 100644 index 0000000..954f21e --- /dev/null +++ b/.history/initialization/app/run_20220728114258.go @@ -0,0 +1,27 @@ +package app + +import ( + "fmt" + "key_performance_indicators/initialization" + "key_performance_indicators/initialization/route" + "key_performance_indicators/overall" +) + +type server interface { + ListenAndServe() error +} + +//启动服务 +func RunItem() { + //加载基础配置 + // var appConfig configApp.Server + initialization.RunViper(&overall.CONSTANT_CONFIG) + // fmt.Printf("----------->%v", overall.CONSTANT_CONFIG) + routers := route.InitialRouter() + portStr := fmt.Sprintf(":%d", overall.CONSTANT_CONFIG.Appsetup.Port) + startUp := InitServer(portStr, routers) + startUp. + fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) + runErr := startUp.ListenAndServe().Error() + panic(fmt.Errorf(runErr)) +} diff --git a/.history/initialization/app/run_20220728114300.go b/.history/initialization/app/run_20220728114300.go new file mode 100644 index 0000000..0b7cdd7 --- /dev/null +++ b/.history/initialization/app/run_20220728114300.go @@ -0,0 +1,26 @@ +package app + +import ( + "fmt" + "key_performance_indicators/initialization" + "key_performance_indicators/initialization/route" + "key_performance_indicators/overall" +) + +type server interface { + ListenAndServe() error +} + +//启动服务 +func RunItem() { + //加载基础配置 + // var appConfig configApp.Server + initialization.RunViper(&overall.CONSTANT_CONFIG) + // fmt.Printf("----------->%v", overall.CONSTANT_CONFIG) + routers := route.InitialRouter() + portStr := fmt.Sprintf(":%d", overall.CONSTANT_CONFIG.Appsetup.Port) + startUp := InitServer(portStr, routers) + fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) + runErr := startUp.ListenAndServe().Error() + panic(fmt.Errorf(runErr)) +} diff --git a/.history/initialization/route/initRoute_20220727153717.go b/.history/initialization/route/initRoute_20220727153717.go new file mode 100644 index 0000000..8cfe284 --- /dev/null +++ b/.history/initialization/route/initRoute_20220727153717.go @@ -0,0 +1,59 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728100325.go b/.history/initialization/route/initRoute_20220728100325.go new file mode 100644 index 0000000..86090f2 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728100325.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728100326.go b/.history/initialization/route/initRoute_20220728100326.go new file mode 100644 index 0000000..a7e70dd --- /dev/null +++ b/.history/initialization/route/initRoute_20220728100326.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter. + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728100330.go b/.history/initialization/route/initRoute_20220728100330.go new file mode 100644 index 0000000..f1b4d5c --- /dev/null +++ b/.history/initialization/route/initRoute_20220728100330.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter.r + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728100331.go b/.history/initialization/route/initRoute_20220728100331.go new file mode 100644 index 0000000..a7e70dd --- /dev/null +++ b/.history/initialization/route/initRoute_20220728100331.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter. + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728100336.go b/.history/initialization/route/initRoute_20220728100336.go new file mode 100644 index 0000000..8cfe284 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728100336.go @@ -0,0 +1,59 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101939.go b/.history/initialization/route/initRoute_20220728101939.go new file mode 100644 index 0000000..8f28d61 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101939.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + api + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101941.go b/.history/initialization/route/initRoute_20220728101941.go new file mode 100644 index 0000000..a7e70dd --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101941.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter. + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101942.go b/.history/initialization/route/initRoute_20220728101942.go new file mode 100644 index 0000000..13fcbdd --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101942.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter.RouterGroup + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101945.go b/.history/initialization/route/initRoute_20220728101945.go new file mode 100644 index 0000000..d7df77a --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101945.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter.RouterGroupEntry.shi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101948.go b/.history/initialization/route/initRoute_20220728101948.go new file mode 100644 index 0000000..e2e19f6 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101948.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101952.go b/.history/initialization/route/initRoute_20220728101952.go new file mode 100644 index 0000000..8ff7e27 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101952.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter.RouterGroupEntry.ShiyanApi. + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728101956.go b/.history/initialization/route/initRoute_20220728101956.go new file mode 100644 index 0000000..2ba7214 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728101956.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + apirouter.RouterGroupEntry.ShiyanApi.RouterGroup() + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102000.go b/.history/initialization/route/initRoute_20220728102000.go new file mode 100644 index 0000000..8cfe284 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102000.go @@ -0,0 +1,59 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102704.go b/.history/initialization/route/initRoute_20220728102704.go new file mode 100644 index 0000000..8e7409d --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102704.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + api. + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102708.go b/.history/initialization/route/initRoute_20220728102708.go new file mode 100644 index 0000000..55438e0 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102708.go @@ -0,0 +1,61 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/api" + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + api.ApiGroup + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102712.go b/.history/initialization/route/initRoute_20220728102712.go new file mode 100644 index 0000000..73fdd3a --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102712.go @@ -0,0 +1,61 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/api" + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + apirouter. + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102715.go b/.history/initialization/route/initRoute_20220728102715.go new file mode 100644 index 0000000..38f9425 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102715.go @@ -0,0 +1,61 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/api" + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + apirouter.RouterGroupEntry. + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102719.go b/.history/initialization/route/initRoute_20220728102719.go new file mode 100644 index 0000000..9910cd9 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102719.go @@ -0,0 +1,61 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/api" + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102725.go b/.history/initialization/route/initRoute_20220728102725.go new file mode 100644 index 0000000..c6e9efd --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102725.go @@ -0,0 +1,61 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/api" + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + api + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728102727.go b/.history/initialization/route/initRoute_20220728102727.go new file mode 100644 index 0000000..5131755 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728102727.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728103308.go b/.history/initialization/route/initRoute_20220728103308.go new file mode 100644 index 0000000..5131755 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728103308.go @@ -0,0 +1,60 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728132817.go b/.history/initialization/route/initRoute_20220728132817.go new file mode 100644 index 0000000..56d7e6f --- /dev/null +++ b/.history/initialization/route/initRoute_20220728132817.go @@ -0,0 +1,61 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133859.go b/.history/initialization/route/initRoute_20220728133859.go new file mode 100644 index 0000000..df8cf8c --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133859.go @@ -0,0 +1,63 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133901.go b/.history/initialization/route/initRoute_20220728133901.go new file mode 100644 index 0000000..ad2e661 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133901.go @@ -0,0 +1,63 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + my + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133902.go b/.history/initialization/route/initRoute_20220728133902.go new file mode 100644 index 0000000..6d0d075 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133902.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytest + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133904.go b/.history/initialization/route/initRoute_20220728133904.go new file mode 100644 index 0000000..67d0997 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133904.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133912.go b/.history/initialization/route/initRoute_20220728133912.go new file mode 100644 index 0000000..f093b3c --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133912.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter. + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133915.go b/.history/initialization/route/initRoute_20220728133915.go new file mode 100644 index 0000000..742de15 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133915.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.ro + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728133917.go b/.history/initialization/route/initRoute_20220728133917.go new file mode 100644 index 0000000..94a7be4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728133917.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry. + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134902.go b/.history/initialization/route/initRoute_20220728134902.go new file mode 100644 index 0000000..c388fbf --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134902.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.v + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134903.go b/.history/initialization/route/initRoute_20220728134903.go new file mode 100644 index 0000000..94a7be4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134903.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry. + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134904.go b/.history/initialization/route/initRoute_20220728134904.go new file mode 100644 index 0000000..cf7e251 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134904.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134907.go b/.history/initialization/route/initRoute_20220728134907.go new file mode 100644 index 0000000..94a7be4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134907.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry. + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134910.go b/.history/initialization/route/initRoute_20220728134910.go new file mode 100644 index 0000000..de9f01f --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134910.go @@ -0,0 +1,64 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134911.go b/.history/initialization/route/initRoute_20220728134911.go new file mode 100644 index 0000000..fed2907 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134911.go @@ -0,0 +1,65 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134912.go b/.history/initialization/route/initRoute_20220728134912.go new file mode 100644 index 0000000..9ea95c6 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134912.go @@ -0,0 +1,67 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134917.go b/.history/initialization/route/initRoute_20220728134917.go new file mode 100644 index 0000000..33679af --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134917.go @@ -0,0 +1,67 @@ +package route + +import ( + mytest "key_performance_indicators/api/myTest" + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi. + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220728134920.go b/.history/initialization/route/initRoute_20220728134920.go new file mode 100644 index 0000000..68e47e4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220728134920.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220729110249.go b/.history/initialization/route/initRoute_20220729110249.go new file mode 100644 index 0000000..1715ca7 --- /dev/null +++ b/.history/initialization/route/initRoute_20220729110249.go @@ -0,0 +1,65 @@ +package route + +import ( + "key_performance_indicators/apirouter" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + // VerifyIdentity := router.Group("") + // VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + // { + // //v1版本接口 + // version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + // version1Api.RouterGroup(VerifyIdentity) + // } + // //Token身份验证 + // VerifyIdentityToken := router.Group("") + // VerifyIdentityToken.Use(interceptor.IdentificationToken()) + // { + + // } + return router +} diff --git a/.history/initialization/route/initRoute_20220729110511.go b/.history/initialization/route/initRoute_20220729110511.go new file mode 100644 index 0000000..68e47e4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220729110511.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220729110516.go b/.history/initialization/route/initRoute_20220729110516.go new file mode 100644 index 0000000..64ced05 --- /dev/null +++ b/.history/initialization/route/initRoute_20220729110516.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") +// / VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220729110518.go b/.history/initialization/route/initRoute_20220729110518.go new file mode 100644 index 0000000..7dcc5d7 --- /dev/null +++ b/.history/initialization/route/initRoute_20220729110518.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") +// VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220729110525.go b/.history/initialization/route/initRoute_20220729110525.go new file mode 100644 index 0000000..68e47e4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220729110525.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220729110610.go b/.history/initialization/route/initRoute_20220729110610.go new file mode 100644 index 0000000..6ccd457 --- /dev/null +++ b/.history/initialization/route/initRoute_20220729110610.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + // VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730104956.go b/.history/initialization/route/initRoute_20220730104956.go new file mode 100644 index 0000000..f826297 --- /dev/null +++ b/.history/initialization/route/initRoute_20220730104956.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730110049.go b/.history/initialization/route/initRoute_20220730110049.go new file mode 100644 index 0000000..6f18fc6 --- /dev/null +++ b/.history/initialization/route/initRoute_20220730110049.go @@ -0,0 +1,67 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730110055.go b/.history/initialization/route/initRoute_20220730110055.go new file mode 100644 index 0000000..0662e0c --- /dev/null +++ b/.history/initialization/route/initRoute_20220730110055.go @@ -0,0 +1,67 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentityToken) + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730110200.go b/.history/initialization/route/initRoute_20220730110200.go new file mode 100644 index 0000000..1ade059 --- /dev/null +++ b/.history/initialization/route/initRoute_20220730110200.go @@ -0,0 +1,67 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("/") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentityToken) + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730110201.go b/.history/initialization/route/initRoute_20220730110201.go new file mode 100644 index 0000000..0662e0c --- /dev/null +++ b/.history/initialization/route/initRoute_20220730110201.go @@ -0,0 +1,67 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentityToken) + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730110203.go b/.history/initialization/route/initRoute_20220730110203.go new file mode 100644 index 0000000..0662e0c --- /dev/null +++ b/.history/initialization/route/initRoute_20220730110203.go @@ -0,0 +1,67 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentityToken) + } + return router +} diff --git a/.history/initialization/route/initRoute_20220730154659.go b/.history/initialization/route/initRoute_20220730154659.go new file mode 100644 index 0000000..68e47e4 --- /dev/null +++ b/.history/initialization/route/initRoute_20220730154659.go @@ -0,0 +1,66 @@ +package route + +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +//初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + //OAuth 2.0 授权 + oAuthEmpowerApi := apirouter.RouterGroupEntry.EmpowerRouter + { + oAuthEmpowerApi.RouterGroup(appLoadRouterGroup) + } + //登录验证 + loginVerifyApi := apirouter.RouterGroupEntry.VerifyLogin + { + loginVerifyApi.RouterGroup(appLoadRouterGroup) + } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } + } + + //验证身份接口 + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + //v1版本接口 + version1Api := apirouter.RouterGroupEntry.HonorsSouteRouter + version1Api.RouterGroup(VerifyIdentity) + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/.history/models/photos_gallery_20220727153717.go b/.history/models/photos_gallery_20220727153717.go new file mode 100644 index 0000000..224cdba --- /dev/null +++ b/.history/models/photos_gallery_20220727153717.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属拿个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220729094634.go b/.history/models/photos_gallery_20220729094634.go new file mode 100644 index 0000000..4c669e1 --- /dev/null +++ b/.history/models/photos_gallery_20220729094634.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220729115022.go b/.history/models/photos_gallery_20220729115022.go new file mode 100644 index 0000000..4c669e1 --- /dev/null +++ b/.history/models/photos_gallery_20220729115022.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220801141934.go b/.history/models/photos_gallery_20220801141934.go new file mode 100644 index 0000000..09d280c --- /dev/null +++ b/.history/models/photos_gallery_20220801141934.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220801141942.go b/.history/models/photos_gallery_20220801141942.go new file mode 100644 index 0000000..edc5c6f --- /dev/null +++ b/.history/models/photos_gallery_20220801141942.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220801141944.go b/.history/models/photos_gallery_20220801141944.go new file mode 100644 index 0000000..09d280c --- /dev/null +++ b/.history/models/photos_gallery_20220801141944.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220801142121.go b/.history/models/photos_gallery_20220801142121.go new file mode 100644 index 0000000..d82163b --- /dev/null +++ b/.history/models/photos_gallery_20220801142121.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + returnbang'din +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/.history/models/photos_gallery_20220801142127.go b/.history/models/photos_gallery_20220801142127.go new file mode 100644 index 0000000..09d280c --- /dev/null +++ b/.history/models/photos_gallery_20220801142127.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +//编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/README.md b/README.md index 17e180e..df391cf 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,5 @@ therr = md5(two) 2、合并 md5(md5(md5(CodeString)+md5(AppKey))+AppKey) -``` \ No newline at end of file +``` + diff --git a/api/base/loginVerify/login.go b/api/base/loginVerify/login.go index beb16d3..7a72e9d 100644 --- a/api/base/loginVerify/login.go +++ b/api/base/loginVerify/login.go @@ -32,7 +32,7 @@ func (a *ApiMethod) ScanCodeLogin(c *gin.Context) { // return // } - userAgent := c.Request.Header.Get("User-Agent") + userAgent := c.Request.Header.Get("User-Agent") // 获取用户代理 // userAgent = "250" var md5JiaMiPwd publicmethod.Md5Encryption @@ -43,6 +43,7 @@ func (a *ApiMethod) ScanCodeLogin(c *gin.Context) { // if oldErr == nil { // //原知行学院管理员账号登录 // } + //新的登录认证方式 var userCont models.ManCont userErr := userCont.GetCont(map[string]interface{}{"number": requestData.Username, "password": md5TokenPwd}) diff --git a/api/myTest/entry.go b/api/myTest/entry.go new file mode 100644 index 0000000..71e4fb8 --- /dev/null +++ b/api/myTest/entry.go @@ -0,0 +1,9 @@ +package mytest + +import testroute "key_performance_indicators/api/myTest/testRoute" + +type ApiEntry struct { + Test testroute.ApiMethod +} + +var AppApiEntry = new(ApiEntry) diff --git a/api/myTest/testRoute/testroute.go b/api/myTest/testRoute/testroute.go new file mode 100644 index 0000000..dbdbb55 --- /dev/null +++ b/api/myTest/testRoute/testroute.go @@ -0,0 +1,22 @@ +package testroute + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +func (a *ApiMethod) MyTest(ctx *gin.Context) { + + name := ctx.PostForm("name") + fmt.Printf("传入的Name为:%v\n", name) + var p1 Person + + err := ctx.Bind(&p1) + if err != nil { + publicmethod.Result(1, err.Error(), ctx) + } + fmt.Printf("%#v\n", p1) + publicmethod.Result(0, p1, ctx) +} diff --git a/api/myTest/testRoute/type.go b/api/myTest/testRoute/type.go new file mode 100644 index 0000000..b18daf0 --- /dev/null +++ b/api/myTest/testRoute/type.go @@ -0,0 +1,24 @@ +package testroute + +import ( + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 实验入口 + +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "测试入口" + publicmethod.Result(0, outputCont, c) +} + +// 测试 +type Person struct { + Id int `form:"id" json:"id" mapstructure:"id"` + Name string `form:"name" json:"name" mapstructure:"name"` + Age int `form:"age" json:"age" mapstructure:"age"` +} diff --git a/api/version1/honoraryArchives/honors.go b/api/version1/honoraryArchives/honors.go index 1e46c3a..8e754d6 100644 --- a/api/version1/honoraryArchives/honors.go +++ b/api/version1/honoraryArchives/honors.go @@ -63,7 +63,7 @@ func (a *ApiMethod) HonorList(c *gin.Context) { //添加荣誉 func (a *ApiMethod) AddHonorCont(c *gin.Context) { - var requestData addHonorCont + var requestData addHonorCont //添加荣誉字段 c.ShouldBindJSON(&requestData) if requestData.Name == "" || requestData.IssuingAgency == "" || requestData.AwardTime == "" { publicmethod.Result(101, requestData, c) @@ -108,7 +108,7 @@ func (a *ApiMethod) AddHonorCont(c *gin.Context) { honorCont.Time = time.Now().Unix() //创建时间"` honorCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` if len(requestData.ImgUrl) > 0 { - var imgList []models.PhotosGallery + var imgList []models.PhotosGallery //图片档案 for _, v := range requestData.ImgUrl { var imgCont models.PhotosGallery imgCont.Url = v.Url //图片地址"` @@ -117,7 +117,7 @@ func (a *ApiMethod) AddHonorCont(c *gin.Context) { imgCont.FileSize = v.FileSize //文档大小"` imgCont.Time = time.Now().Unix() //创建时间"` imgCont.AscriptionId = uuId //归属"` - imgCont.AscriptionDataSheet = "honorary_archives" //归属拿个数据表"` + imgCont.AscriptionDataSheet = "honorary_archives" //归属哪个数据表"` imgCont.State = 1 //状态(1:启用;2:禁用;3:删除)"` imgList = append(imgList, imgCont) } diff --git a/api/version1/honoraryArchives/operate_photo.go b/api/version1/honoraryArchives/operate_photo.go new file mode 100644 index 0000000..a081b17 --- /dev/null +++ b/api/version1/honoraryArchives/operate_photo.go @@ -0,0 +1,25 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +// 查询图片 +func (a *ApiMethod) ReviewImage(c *gin.Context) { + var requestData photoKey //声明荣誉图片字段 + c.ShouldBindJSON(&requestData) //进行Json绑定 + if requestData.Id == "" { + publicmethod.Result(101, requestData, c) + return + } + var photoGalleryByAscriptionId []models.PhotosGallery + where := publicmethod.MapOut[string]() + where["ascriptionid"] = requestData.Id + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.PhotosGallery{}).Where("state = ?", 1) + gormDb.Where(where).Find(&photoGalleryByAscriptionId) + publicmethod.Result(0, photoGalleryByAscriptionId, c) // 将查询结果返回 +} diff --git a/api/version1/honoraryArchives/type.go b/api/version1/honoraryArchives/type.go index e91463c..b67e81e 100644 --- a/api/version1/honoraryArchives/type.go +++ b/api/version1/honoraryArchives/type.go @@ -62,3 +62,10 @@ type eidyCarrierCont struct { publicmethod.PublicId addCarrierCont } + +// 荣誉图片字段 +type photoKey struct { + publicmethod.PublicId + addHonorCont + publicmethod.PagesTurn +} diff --git a/apirouter/entry.go b/apirouter/entry.go index f1bbc6c..f59c655 100644 --- a/apirouter/entry.go +++ b/apirouter/entry.go @@ -3,6 +3,7 @@ package apirouter import ( "key_performance_indicators/apirouter/apishiyan" "key_performance_indicators/apirouter/empower" + mytest "key_performance_indicators/apirouter/myTest" honorsRoute "key_performance_indicators/apirouter/v1/honorsRoute" "key_performance_indicators/apirouter/verifyLogin" // "key_performance_indicators/v1" @@ -14,6 +15,7 @@ type RouterGroup struct { VerifyLogin verifyLogin.ApiRouter ShiyanApi apishiyan.ApiRouter HonorsSouteRouter honorsRoute.ApiRouter + MyTest mytest.TestApi } var RouterGroupEntry = new(RouterGroup) diff --git a/apirouter/myTest/myTest_route.go b/apirouter/myTest/myTest_route.go new file mode 100644 index 0000000..31c6bad --- /dev/null +++ b/apirouter/myTest/myTest_route.go @@ -0,0 +1,18 @@ +package mytest + +import ( + mytest "key_performance_indicators/api/myTest" + + "github.com/gin-gonic/gin" +) + +func (t *TestApi) RouterGroup(route *gin.RouterGroup) { + apiRouter := route.Group("/myTest") + + var methodBinding = mytest.AppApiEntry.Test + { + apiRouter.POST("/myTest", methodBinding.MyTest) + apiRouter.GET("/", methodBinding.Index) + apiRouter.POST("/", methodBinding.Index) + } +} diff --git a/apirouter/myTest/type.go b/apirouter/myTest/type.go new file mode 100644 index 0000000..ee484c0 --- /dev/null +++ b/apirouter/myTest/type.go @@ -0,0 +1,4 @@ +package mytest + +type TestApi struct{} + diff --git a/apirouter/v1/honorsRoute/honors_route.go b/apirouter/v1/honorsRoute/honors_route.go index 8563465..e024864 100644 --- a/apirouter/v1/honorsRoute/honors_route.go +++ b/apirouter/v1/honorsRoute/honors_route.go @@ -24,5 +24,8 @@ func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { apiRouter.POST("addcarrier", methodBinding.AddCarrier) //添加载体类型 apiRouter.POST("eidycarrier", methodBinding.EidyCarrier) //编辑载体类型 apiRouter.POST("eidycarrierstate", methodBinding.EidyCarrierState) //编辑载体类型状态 + + // 查看图片 + apiRouter.POST("reviewimage", methodBinding.ReviewImage) // 查看图片 } } diff --git a/config/configDatabase/database.yaml b/config/configDatabase/database.yaml index f57cc03..5aacf0f 100644 --- a/config/configDatabase/database.yaml +++ b/config/configDatabase/database.yaml @@ -189,4 +189,4 @@ managearchives: password: 'root' #数据库密码 max_idle_conns: 100 #最大空闲数量 max_open_conns: 1500 #最大打开数量 - gorm_log: true #是否开启gorm日志 \ No newline at end of file + gorm_log: true #是否开启gorm日志 diff --git a/initialization/app/run.go b/initialization/app/run.go index d22ac79..0b7cdd7 100644 --- a/initialization/app/run.go +++ b/initialization/app/run.go @@ -20,7 +20,6 @@ func RunItem() { routers := route.InitialRouter() portStr := fmt.Sprintf(":%d", overall.CONSTANT_CONFIG.Appsetup.Port) startUp := InitServer(portStr, routers) - fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) runErr := startUp.ListenAndServe().Error() panic(fmt.Errorf(runErr)) diff --git a/initialization/route/initRoute.go b/initialization/route/initRoute.go index 8cfe284..68e47e4 100644 --- a/initialization/route/initRoute.go +++ b/initialization/route/initRoute.go @@ -25,6 +25,7 @@ func InitialRouter() *gin.Engine { c.JSON(0, "通讯成功!") }) //实验路由 + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi { shiyanApi.RouterGroup(appLoadRouterGroup) @@ -39,6 +40,12 @@ func InitialRouter() *gin.Engine { { loginVerifyApi.RouterGroup(appLoadRouterGroup) } + + // 自定义测试 + mytestapi := apirouter.RouterGroupEntry.MyTest + { + mytestapi.RouterGroup(appLoadRouterGroup) + } } //验证身份接口 diff --git a/key_performance_indicators.code-workspace b/key_performance_indicators.code-workspace new file mode 100644 index 0000000..ef9f5d2 --- /dev/null +++ b/key_performance_indicators.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file diff --git a/models/photos_gallery.go b/models/photos_gallery.go index 224cdba..09d280c 100644 --- a/models/photos_gallery.go +++ b/models/photos_gallery.go @@ -6,7 +6,7 @@ import ( ) //图片库 -type PhotosGallery struct { +type PhotosGallery struct { Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` @@ -14,7 +14,7 @@ type PhotosGallery struct { FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` - AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属拿个数据表"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属哪个数据表"` State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` }