From 0dada72cf8f9de27ae109fcfc978098460352cb7 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Wed, 27 Jul 2022 15:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=A3=E8=AA=89=E6=A8=A1=E5=9D=97=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- api/base/entry.go | 9 + api/base/loginVerify/login.go | 187 ++++++ api/base/loginVerify/type.go | 38 ++ api/base/loginVerify/verifyCode.go | 27 + api/empower/authorize/empower.go | 147 +++++ api/empower/authorize/type.go | 39 +- api/empower/entry.go | 6 +- api/shiyan/entry.go | 9 + api/shiyan/maptostruct/maptostr.go | 28 + api/shiyan/maptostruct/type.go | 26 + api/version1/entry.go | 9 + api/version1/honoraryArchives/carriertype.go | 158 +++++ api/version1/honoraryArchives/honors.go | 334 +++++++++++ api/version1/honoraryArchives/type.go | 64 ++ apirouter/apishiyan/entry.go | 5 + apirouter/apishiyan/maptostruct.go | 20 + apirouter/empower/apirouter.go | 20 + apirouter/empower/type.go | 5 + apirouter/entry.go | 19 + apirouter/v1/honorsRoute/honors_route.go | 28 + apirouter/v1/honorsRoute/type.go | 4 + apirouter/verifyLogin/route.go | 21 + apirouter/verifyLogin/type.go | 5 + config/configApp/appConfig.yaml | 14 +- config/configApp/server.go | 18 +- config/configDatabase/database.go | 1 + config/configDatabase/database.yaml | 14 + go.mod | 7 +- go.sum | 593 +++++++++++++++++++ identification/interceptor/authentication.go | 167 ++++++ identification/interceptor/identity.go | 127 ++++ identification/interceptor/type.go | 8 + initialization/databaseinit/mysql.go | 7 + initialization/route/initRoute.go | 37 +- middleware/cross_domain.go | 26 + middleware/grocerystore/redis.go | 380 ++++++++++++ middleware/snowflake/snowflake.go | 38 ++ middleware/snowflake/type.go | 21 + models/administrative_organization.go | 57 ++ models/administrative_organization_type.go | 38 ++ models/carrier_type.go | 42 ++ models/double_worker.go | 42 ++ models/duties.go | 41 ++ models/duties_class_leve.go | 37 ++ models/emergency_contact.go | 46 ++ models/empoweruser.go | 46 ++ models/family_members.go | 46 ++ models/honorary_archives.go | 49 ++ models/inside_work_history.go | 48 ++ models/inside_work_view.go | 39 ++ models/job_class.go | 38 ++ models/kingdee_log.go | 36 ++ models/man_cont.go | 76 +++ models/menu_operation.go | 12 + models/myuser.go | 90 +++ models/org_cont_type.go | 34 ++ models/personarchives.go | 61 ++ models/personnel.go | 54 ++ models/personnel_change_record.go | 58 ++ models/personnel_content.go | 67 +++ models/personnel_education.go | 48 ++ models/photos_gallery.go | 47 ++ models/position.go | 52 ++ models/position_level.go | 22 + models/post_duties_job.go | 44 ++ models/step_role_group.go | 36 ++ models/system_nenu.go | 47 ++ models/system_role.go | 39 ++ models/system_user.go | 40 ++ models/system_user_attribute.go | 33 ++ models/teamgroup.go | 36 ++ models/wechatUsers.go | 34 ++ models/work_history.go | 51 ++ overall/appConfig.go | 28 +- overall/publicmethod/errorCode.go | 15 + overall/publicmethod/formatOutput.go | 66 +++ overall/publicmethod/log.go | 71 +++ overall/publicmethod/technique.go | 488 +++++++++++++++ overall/publicmethod/type.go | 46 ++ 80 files changed, 4944 insertions(+), 26 deletions(-) create mode 100644 api/base/entry.go create mode 100644 api/base/loginVerify/login.go create mode 100644 api/base/loginVerify/type.go create mode 100644 api/base/loginVerify/verifyCode.go create mode 100644 api/empower/authorize/empower.go create mode 100644 api/shiyan/entry.go create mode 100644 api/shiyan/maptostruct/maptostr.go create mode 100644 api/shiyan/maptostruct/type.go create mode 100644 api/version1/entry.go create mode 100644 api/version1/honoraryArchives/carriertype.go create mode 100644 api/version1/honoraryArchives/honors.go create mode 100644 api/version1/honoraryArchives/type.go create mode 100644 apirouter/apishiyan/entry.go create mode 100644 apirouter/apishiyan/maptostruct.go create mode 100644 apirouter/empower/apirouter.go create mode 100644 apirouter/empower/type.go create mode 100644 apirouter/entry.go create mode 100644 apirouter/v1/honorsRoute/honors_route.go create mode 100644 apirouter/v1/honorsRoute/type.go create mode 100644 apirouter/verifyLogin/route.go create mode 100644 apirouter/verifyLogin/type.go create mode 100644 identification/interceptor/authentication.go create mode 100644 identification/interceptor/identity.go create mode 100644 identification/interceptor/type.go create mode 100644 middleware/cross_domain.go create mode 100644 middleware/grocerystore/redis.go create mode 100644 middleware/snowflake/snowflake.go create mode 100644 middleware/snowflake/type.go create mode 100644 models/administrative_organization.go create mode 100644 models/administrative_organization_type.go create mode 100644 models/carrier_type.go create mode 100644 models/double_worker.go create mode 100644 models/duties.go create mode 100644 models/duties_class_leve.go create mode 100644 models/emergency_contact.go create mode 100644 models/empoweruser.go create mode 100644 models/family_members.go create mode 100644 models/honorary_archives.go create mode 100644 models/inside_work_history.go create mode 100644 models/inside_work_view.go create mode 100644 models/job_class.go create mode 100644 models/kingdee_log.go create mode 100644 models/man_cont.go create mode 100644 models/menu_operation.go create mode 100644 models/myuser.go create mode 100644 models/org_cont_type.go create mode 100644 models/personarchives.go create mode 100644 models/personnel.go create mode 100644 models/personnel_change_record.go create mode 100644 models/personnel_content.go create mode 100644 models/personnel_education.go create mode 100644 models/photos_gallery.go create mode 100644 models/position.go create mode 100644 models/position_level.go create mode 100644 models/post_duties_job.go create mode 100644 models/step_role_group.go create mode 100644 models/system_nenu.go create mode 100644 models/system_role.go create mode 100644 models/system_user.go create mode 100644 models/system_user_attribute.go create mode 100644 models/teamgroup.go create mode 100644 models/wechatUsers.go create mode 100644 models/work_history.go create mode 100644 overall/publicmethod/errorCode.go create mode 100644 overall/publicmethod/formatOutput.go create mode 100644 overall/publicmethod/log.go create mode 100644 overall/publicmethod/technique.go create mode 100644 overall/publicmethod/type.go diff --git a/README.md b/README.md index 6242aa6..17e180e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ |—— api └── version1 └── empower -|—— router +|—— apirouter |—— initialization └── database └── nosql @@ -28,7 +28,7 @@ | `api` | api相关业务 | api业务实现 | | `--version1` | 业务版本文件夹 | 版本界定 | | `--empower` |OAuth 2.0 授权 |授权Token| -| `router` | 路由器 | 业务路由设定 | +| `apirouter` | 路由器 | 业务路由设定 | | `initialization` | 初始化相关业务 | 系统初始化方面的实现 | | `--database` | 数据库业务 | 数据库业务初始化实现 | | `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) | diff --git a/api/base/entry.go b/api/base/entry.go new file mode 100644 index 0000000..e6b282a --- /dev/null +++ b/api/base/entry.go @@ -0,0 +1,9 @@ +package base + +import "key_performance_indicators/api/base/loginVerify" + +type ApiEntry struct { + LoginVerify loginVerify.ApiMethod +} + +var AppApiEntry = new(ApiEntry) diff --git a/api/base/loginVerify/login.go b/api/base/loginVerify/login.go new file mode 100644 index 0000000..beb16d3 --- /dev/null +++ b/api/base/loginVerify/login.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/api/base/loginVerify/type.go b/api/base/loginVerify/type.go new file mode 100644 index 0000000..01e534b --- /dev/null +++ b/api/base/loginVerify/type.go @@ -0,0 +1,38 @@ +package loginVerify + +import ( + "key_performance_indicators/models" + "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 SysCaptchaResponse struct { + CaptchaId string `json:"captchaid"` + PicPath string `json:"picPath"` +} + +//登录相关 +type Login struct { + Username string `json:"username"` // 用户名 + Password string `json:"password"` // 密码 + Captcha string `json:"captcha"` // 验证码 + CaptchaId string `json:"captchaid"` // 验证码ID + OpenId string `json:"openid"` //企业微信ID +} + +//原知行学院管理员表 +type OldSchollAdmin struct { + models.SystemUser + models.SystemUserAttribute +} diff --git a/api/base/loginVerify/verifyCode.go b/api/base/loginVerify/verifyCode.go new file mode 100644 index 0000000..d35e2af --- /dev/null +++ b/api/base/loginVerify/verifyCode.go @@ -0,0 +1,27 @@ +package loginVerify + +import ( + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" + "github.com/mojocn/base64Captcha" +) + +var store = base64Captcha.DefaultMemStore + +func (a *ApiMethod) Captcha(c *gin.Context) { + // 字符,公式,验证码配置 + // 生成默认数字的driver + driver := base64Captcha.NewDriverDigit(overall.CONSTANT_CONFIG.Captcha.ImgHeight, overall.CONSTANT_CONFIG.Captcha.ImgWidth, overall.CONSTANT_CONFIG.Captcha.KeyLong, 0.7, 80) + //coder := base64Captcha.NewCaptcha(driver, store.UseWithCtx(c)) // v8下使用redis + coder := base64Captcha.NewCaptcha(driver, store) + if id, b64s, err := coder.Generate(); err != nil { + publicmethod.Result(1, err, c, "验证码获取失败") + } else { + publicmethod.Result(0, SysCaptchaResponse{ + CaptchaId: id, + PicPath: b64s, + }, c) + } +} diff --git a/api/empower/authorize/empower.go b/api/empower/authorize/empower.go new file mode 100644 index 0000000..18b4026 --- /dev/null +++ b/api/empower/authorize/empower.go @@ -0,0 +1,147 @@ +package authorize + +import ( + "fmt" + "key_performance_indicators/overall" + "strconv" + + "github.com/gin-gonic/gin" + + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/models" + "key_performance_indicators/overall/publicmethod" +) + +//授权 +func (e *EmpowerApi) GainToken(c *gin.Context) { + ContentType := c.Request.Header.Get("Content-Type") + Origin := c.Request.Header.Get("Origin") + userAgent := c.Request.Header.Get("User-Agent") + + var requestData gainAuthorize + err := c.ShouldBindJSON(&requestData) + if err != nil { + publicmethod.Result(100, err, c) + return + } + + if ContentType == "" || userAgent == "" || Origin == "" { + publicmethod.Result(100, err, c) + return + } + + if requestData.UserNumber == "" || requestData.Password == "" { + publicmethod.Result(101, err, c) + return + } + //密码加密 + var passwordMd5 publicmethod.Md5Encryption + passwordMd5.Md5EncryptionInit(requestData.Password) + passwordMd5Str := passwordMd5.Md5EncryptionAlgorithm() + var empowerUser models.EmpowerUser + userErr := empowerUser.GetCont(map[string]interface{}{"userkey": requestData.UserNumber, "password": passwordMd5Str}, "verification_code") + if userErr != nil { + publicmethod.Result(2000, passwordMd5Str, c) + return + } + //获取随机数 + randCode := strconv.FormatInt(publicmethod.TableNumber(), 10) + // randCode := strconv.FormatInt(16557925694780, 10) + //头文件加密 + //ContentType + var ContentTypeMd5 publicmethod.Md5Encryption + ContentTypeMd5.Md5EncryptionInit(ContentType) + if empowerUser.VerificationCode != "" { + ContentTypeMd5.AppKey = empowerUser.VerificationCode + } + + fmt.Printf("ContentTypeMd5Str ----->%v\n", ContentTypeMd5) + + ContentTypeMd5Str := ContentTypeMd5.Md5EncryptionAlgorithm() + //Origin + var OriginMd5 publicmethod.Md5Encryption + OriginMd5.Md5EncryptionInit(Origin) + if empowerUser.VerificationCode != "" { + OriginMd5.AppKey = empowerUser.VerificationCode + } + + originMd5Str := OriginMd5.Md5EncryptionAlgorithm() + //userAgent + var userAgentMd5 publicmethod.Md5Encryption + userAgentMd5.Md5EncryptionInit(userAgent) + if empowerUser.VerificationCode != "" { + userAgentMd5.AppKey = empowerUser.VerificationCode + } + userAgentMd5Str := userAgentMd5.Md5EncryptionAlgorithm() + + //随机数加密 + var randomNumberMd5 publicmethod.Md5Encryption + randomNumberMd5.Md5EncryptionInit(randCode) + if empowerUser.VerificationCode != "" { + randomNumberMd5.AppKey = empowerUser.VerificationCode + } + numberMd5 := randomNumberMd5.Md5EncryptionAlgorithm() + + //用户名加密 + var userKeyMd5 publicmethod.Md5Encryption + userKeyMd5.Md5EncryptionInit(requestData.UserNumber) + if empowerUser.VerificationCode != "" { + userKeyMd5.AppKey = empowerUser.VerificationCode + } + userKeyMd5Str := userKeyMd5.Md5EncryptionAlgorithm() + + clearCodeToken := fmt.Sprintf("%v-%v-%v-%v-%v-%v", ContentTypeMd5Str, originMd5Str, userAgentMd5Str, numberMd5, userKeyMd5Str, passwordMd5Str) + + fmt.Printf("redisKey---->ContentTypeMd5Str:%v-originMd5Str:%v-userAgentMd5Str:%v-numberMd5:%v-userKeyMd5Str:%v-passwordMd5Str:%v\n", ContentTypeMd5Str, originMd5Str, userAgentMd5Str, numberMd5, userKeyMd5Str, passwordMd5Str) + //token 加密 + var tokenMd5 publicmethod.Md5Encryption + tokenMd5.Md5EncryptionInit(clearCodeToken) + if empowerUser.VerificationCode != "" { + tokenMd5.AppKey = empowerUser.VerificationCode + } + fmt.Printf("tokenMd5Appk ----->%v\n", tokenMd5) + tokenMd5Str := tokenMd5.Md5EncryptionAlgorithm() + + //设定redis Key名称 + redisKey := fmt.Sprintf("Authentication:ApiAuthent_%v", tokenMd5Str) + + saveTokenRedis := publicmethod.MapOut[string]() + saveTokenRedis["number"] = randCode + saveTokenRedis["userkey"] = requestData.UserNumber + saveTokenRedis["password"] = requestData.Password + //将验证信息写入Redis + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS3) + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisKey, saveTokenRedis) + //输出验证 + // clearTokenStr := fmt.Sprintf("%v-%v", tokenMd5Str, numberMd5) + // var clearTokenMd5 publicmethod.Md5Encryption + // clearTokenMd5.Md5EncryptionInit(clearTokenStr) + // clearTokenMd5Str := clearTokenMd5.Md5EncryptionAlgorithm() + var sendToken SendToken + sendToken.Number = randCode + sendToken.Token = tokenMd5Str + publicmethod.Result(0, sendToken, c) +} + +//加密验证 +func (e *EmpowerApi) Encryption(c *gin.Context) { + var requestData EncryptionData + err := c.ShouldBindJSON(&requestData) + if err != nil { + publicmethod.Result(100, err, c) + return + } + var ContentTypeMd5 publicmethod.Md5Encryption + ContentTypeMd5.Md5EncryptionInit(requestData.Number) + ContentTypeMd5.AppKey = requestData.AppKey + ContentTypeMd5Str, dfg := ContentTypeMd5.Md5EncryptionAlgorithmFj() + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "MD5加密验证" + // outputCont["userErr"] = userErr + outputCont["md5"] = ContentTypeMd5Str + outputCont["number"] = requestData.Number + outputCont["appkey"] = requestData.AppKey + outputCont["step"] = dfg + publicmethod.Result(0, outputCont, c) +} diff --git a/api/empower/authorize/type.go b/api/empower/authorize/type.go index e17067c..400c74e 100644 --- a/api/empower/authorize/type.go +++ b/api/empower/authorize/type.go @@ -1,10 +1,41 @@ package authorize -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + + "key_performance_indicators/overall/publicmethod" +) type EmpowerApi struct{} //入口 -func (e *EmpowerApi) Index(c *gin.Context){ - -} \ No newline at end of file +func (e *EmpowerApi) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["entry"] = "授权入口" + publicmethod.Result(0, outputCont, c) +} + +//授权 +type gainAuthorize struct { + UserNumber string `json:"username"` + Password string `json:"password"` +} + +//输出Token +type SendToken struct { + Token string `json:"token"` + Number string `json:"number"` +} + +//保存Redis Token +type SaveToken struct { + Number string `json:"number"` //随机数 + UserKey string `json:"userkey"` //用户名 + PassWord string `json:"password"` //密码 +} + +//加密参数 +type EncryptionData struct { + Number string `json:"number"` + AppKey string `json:"appkey"` +} diff --git a/api/empower/entry.go b/api/empower/entry.go index e692876..7f70d33 100644 --- a/api/empower/entry.go +++ b/api/empower/entry.go @@ -1,5 +1,9 @@ package empower -type ApiEntry struct{} +import "key_performance_indicators/api/empower/authorize" + +type ApiEntry struct { + EmpowerApi authorize.EmpowerApi //授权 +} var AppApiEntry = new(ApiEntry) diff --git a/api/shiyan/entry.go b/api/shiyan/entry.go new file mode 100644 index 0000000..25d88e6 --- /dev/null +++ b/api/shiyan/entry.go @@ -0,0 +1,9 @@ +package shiyan + +import "key_performance_indicators/api/shiyan/maptostruct" + +type ApiEntry struct { + MapToStructApi maptostruct.ApiMethod +} + +var AppApiEntry = new(ApiEntry) diff --git a/api/shiyan/maptostruct/maptostr.go b/api/shiyan/maptostruct/maptostr.go new file mode 100644 index 0000000..707516d --- /dev/null +++ b/api/shiyan/maptostruct/maptostr.go @@ -0,0 +1,28 @@ +package maptostruct + +import ( + "fmt" + "key_performance_indicators/overall/publicmethod" + + "github.com/gin-gonic/gin" +) + +//map 装 struct 实验 +func (a *ApiMethod) MapToStructShiyan(c *gin.Context) { + mapShiyan := map[string]string{ + "name": "秦东", + "age": "1", + "time": "456313", + "time1": "45631321654654", + "time2": "4.5631321654654", + "time3": "45.631321654654", + } + var shiyanVal shiyanType + err := publicmethod.MapToStruct(mapShiyan, &shiyanVal, "json") + if err != nil { + publicmethod.Result(1, err.Error(), c) + return + } + fmt.Printf("shiyanType---->%v\n", shiyanVal) + publicmethod.Result(0, shiyanVal, c) +} diff --git a/api/shiyan/maptostruct/type.go b/api/shiyan/maptostruct/type.go new file mode 100644 index 0000000..7125f34 --- /dev/null +++ b/api/shiyan/maptostruct/type.go @@ -0,0 +1,26 @@ +package maptostruct + +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 shiyanType struct { + Name string `json:"name"` + Age int `json:"age"` + Time int32 `json:"time"` + Time1 int64 `json:"time1"` + Time2 float32 `json:"time2"` + Time3 float64 `json:"time3"` +} diff --git a/api/version1/entry.go b/api/version1/entry.go new file mode 100644 index 0000000..c13609d --- /dev/null +++ b/api/version1/entry.go @@ -0,0 +1,9 @@ +package version1 + +import "key_performance_indicators/api/version1/honoraryArchives" + +type ApiEntry struct { + HonorsApi honoraryArchives.ApiMethod +} + +var AppApiEntry = new(ApiEntry) diff --git a/api/version1/honoraryArchives/carriertype.go b/api/version1/honoraryArchives/carriertype.go new file mode 100644 index 0000000..b77da1d --- /dev/null +++ b/api/version1/honoraryArchives/carriertype.go @@ -0,0 +1,158 @@ +package honoraryArchives + +import ( + "key_performance_indicators/models" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + "time" + + "github.com/gin-gonic/gin" +) + +//档案载体 + +//列表 +func (a *ApiMethod) CarrierList(c *gin.Context) { + var requestData carrierListKey + errs := c.ShouldBindJSON(&requestData) + if errs != nil { + publicmethod.Result(100, errs, c) + return + } + var carrierList []models.CarrierType + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&models.CarrierType{}).Where("`state` BETWEEN ? AND ?", 1, 2) + if requestData.Name != "" { + gormDb = gormDb.Where("`name` LIKE ?", "%"+requestData.Name+"%") + } + 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(&carrierList).Error + if err != nil { + publicmethod.Result(105, err, c) + return + } + publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(carrierList)), carrierList, c) +} + +//添加载体类型 +func (a *ApiMethod) AddCarrier(c *gin.Context) { + var requestData addCarrierCont + err := c.ShouldBindJSON(&requestData) + if err != nil { + publicmethod.Result(100, err, c) + return + } + if requestData.Name == "" { + publicmethod.Result(101, err, c) + return + } + var carrierCont models.CarrierType + juadgeErr := carrierCont.GetCont(map[string]interface{}{"`name`": requestData.Name}, "`id`") + if juadgeErr == nil { + if carrierCont.Id != 0 { + publicmethod.Result(103, carrierCont, c) + } + } + carrierCont.Name = requestData.Name + carrierCont.State = 1 + carrierCont.Time = time.Now().Unix() + addErr := overall.CONSTANT_DB_MANAGE_ARCHIVES.Create(&carrierCont).Error + if addErr != nil { + publicmethod.Result(104, addErr, c) + } else { + publicmethod.Result(0, addErr, c) + } +} + +//编辑荣誉类型 +func (a *ApiMethod) EidyCarrier(c *gin.Context) { + var requestData eidyCarrierCont + err := c.ShouldBindJSON(&requestData) + if err != nil { + publicmethod.Result(100, err, c) + return + } + if requestData.Id == "" { + publicmethod.Result(101, err, c) + return + } + if requestData.Name == "" { + publicmethod.Result(101, err, c) + return + } + var carrierCont models.CarrierType + conErr := carrierCont.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`name`") + if conErr != nil { + publicmethod.Result(107, conErr, c) + return + } + if requestData.Name != carrierCont.Name { + var oldCarrierCont models.CarrierType + conErrOld := oldCarrierCont.GetCont(map[string]interface{}{"`name`": requestData.Name}, "`id`") + if conErrOld == nil { + publicmethod.Result(103, err, c) + return + } + } else { + publicmethod.Result(0, err, c) + return + } + saveData := publicmethod.MapOut[string]() + saveData["name"] = requestData.Name + eidtErr := carrierCont.EiteCont(map[string]interface{}{"`id`": requestData.Id}, saveData) + if eidtErr != nil { + publicmethod.Result(106, err, c) + return + } + publicmethod.Result(0, err, c) +} + +//编辑荣誉类型状态 +func (a *ApiMethod) EidyCarrierState(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.CarrierType + 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/api/version1/honoraryArchives/honors.go b/api/version1/honoraryArchives/honors.go new file mode 100644 index 0000000..1e46c3a --- /dev/null +++ b/api/version1/honoraryArchives/honors.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/api/version1/honoraryArchives/type.go b/api/version1/honoraryArchives/type.go new file mode 100644 index 0000000..e91463c --- /dev/null +++ b/api/version1/honoraryArchives/type.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/apirouter/apishiyan/entry.go b/apirouter/apishiyan/entry.go new file mode 100644 index 0000000..ad09277 --- /dev/null +++ b/apirouter/apishiyan/entry.go @@ -0,0 +1,5 @@ +package apishiyan + +//Api实验 + +type ApiRouter struct{} diff --git a/apirouter/apishiyan/maptostruct.go b/apirouter/apishiyan/maptostruct.go new file mode 100644 index 0000000..9ce27ba --- /dev/null +++ b/apirouter/apishiyan/maptostruct.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/apirouter/empower/apirouter.go b/apirouter/empower/apirouter.go new file mode 100644 index 0000000..90cb6c6 --- /dev/null +++ b/apirouter/empower/apirouter.go @@ -0,0 +1,20 @@ +package empower + +import ( + "key_performance_indicators/api/empower" + + "github.com/gin-gonic/gin" +) + +//OAuth 2.0 授权 + +func (e *EmpowerApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("empower") + var methodBinding = empower.AppApiEntry.EmpowerApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("givemetoken", methodBinding.GainToken) //获取令牌 + apiRouter.POST("encryption", methodBinding.Encryption) //加密验证 + } +} diff --git a/apirouter/empower/type.go b/apirouter/empower/type.go new file mode 100644 index 0000000..ec94927 --- /dev/null +++ b/apirouter/empower/type.go @@ -0,0 +1,5 @@ +package empower + +//OAuth 2.0 授权 + +type EmpowerApiRouter struct{} diff --git a/apirouter/entry.go b/apirouter/entry.go new file mode 100644 index 0000000..f1bbc6c --- /dev/null +++ b/apirouter/entry.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/apirouter/v1/honorsRoute/honors_route.go b/apirouter/v1/honorsRoute/honors_route.go new file mode 100644 index 0000000..8563465 --- /dev/null +++ b/apirouter/v1/honorsRoute/honors_route.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/apirouter/v1/honorsRoute/type.go b/apirouter/v1/honorsRoute/type.go new file mode 100644 index 0000000..ba2c3ae --- /dev/null +++ b/apirouter/v1/honorsRoute/type.go @@ -0,0 +1,4 @@ +package honorsRoute + +//荣誉墙 +type ApiRouter struct{} diff --git a/apirouter/verifyLogin/route.go b/apirouter/verifyLogin/route.go new file mode 100644 index 0000000..118d47d --- /dev/null +++ b/apirouter/verifyLogin/route.go @@ -0,0 +1,21 @@ +package verifyLogin + +import ( + "key_performance_indicators/api/base" + + "github.com/gin-gonic/gin" +) + +//OAuth 2.0 授权 + +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("base") + var methodBinding = base.AppApiEntry.LoginVerify + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + apiRouter.POST("captcha", methodBinding.Captcha) //获取验证码 + apiRouter.POST("login", methodBinding.ScanCodeLogin) //登录 + apiRouter.POST("signout", methodBinding.SignOut) //退出登录 + } +} diff --git a/apirouter/verifyLogin/type.go b/apirouter/verifyLogin/type.go new file mode 100644 index 0000000..f67f79a --- /dev/null +++ b/apirouter/verifyLogin/type.go @@ -0,0 +1,5 @@ +package verifyLogin + +//登录合验证码 + +type ApiRouter struct{} diff --git a/config/configApp/appConfig.yaml b/config/configApp/appConfig.yaml index fda4158..7eda376 100644 --- a/config/configApp/appConfig.yaml +++ b/config/configApp/appConfig.yaml @@ -4,8 +4,18 @@ appsetup: port: 6666 #服务端口 readtime: 3600 #请求的读取操作在超时前的最大持续时间 writetime : 3600 #回复的写入操作在超时前的最大持续时间 - appkey: 'HengXinGaoKeAppKey' #应用程序密钥 + appkey: 'heng_xin_gao_ke_AppKey' #应用程序密钥 password: '123456789' #系统默认密码 prefix: 'HXJT' #系统字段前缀 logconfig: - path: 'log' #日志保存地址 \ No newline at end of file + 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/config/configApp/server.go b/config/configApp/server.go index e44778e..d5513f0 100644 --- a/config/configApp/server.go +++ b/config/configApp/server.go @@ -2,8 +2,10 @@ package configApp //服务基础配置 type Server struct { - Appsetup appsetup `mapstructure:"appsetup" json:"appsetup" yaml:"appsetup"` - Logsetup logsetup `mapstructure:"logconfig" json:"logconfig" yaml:"logconfig"` + Appsetup appsetup `mapstructure:"appsetup" json:"appsetup" yaml:"appsetup"` + Logsetup logsetup `mapstructure:"logconfig" json:"logconfig" yaml:"logconfig"` + Captcha captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` + RedisPrefixStr redisPrefixStr `mapstructure:"redisprefix" json:"redisprefix" yaml:"redisprefix"` } //服务配置详情 @@ -20,3 +22,15 @@ type appsetup struct { type logsetup struct { Path string `mapstructure:"path" json:"path" yaml:"path"` } + +//验证码相关 +type captcha struct { + KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"` // 验证码长度 + ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"` // 验证码宽度 + ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 验证码高度 +} + +type redisPrefixStr struct { + PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // redis键前缀 + Alias string `mapstructure:"alias" json:"alias" yaml:"alias"` // redis键前缀 +} diff --git a/config/configDatabase/database.go b/config/configDatabase/database.go index 16866e7..03e714f 100644 --- a/config/configDatabase/database.go +++ b/config/configDatabase/database.go @@ -23,6 +23,7 @@ type MysqlSetUp struct { 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 { diff --git a/config/configDatabase/database.yaml b/config/configDatabase/database.yaml index 6276208..f57cc03 100644 --- a/config/configDatabase/database.yaml +++ b/config/configDatabase/database.yaml @@ -175,4 +175,18 @@ wechatCallBackLogDate: 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/go.mod b/go.mod index d772f4b..0d5caef 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,13 @@ 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 @@ -20,6 +24,7 @@ require ( 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 @@ -27,7 +32,6 @@ require ( 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/mitchellh/mapstructure v1.5.0 // 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 @@ -39,6 +43,7 @@ require ( 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 diff --git a/go.sum b/go.sum index f939f4a..f1d8dd0 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,7 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -36,9 +37,40 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= +github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/casbin/casbin/v2 v2.37.4/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= +github.com/casbin/casbin/v2 v2.51.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= +github.com/casbin/gorm-adapter/v3 v3.7.3/go.mod h1:7mwHmC2phiw6N4gDWlzi+c4DUX7zaVmQC/hINsRgBDg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -48,43 +80,119 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 h1:SO0hu+Lqk8ZsKmk7iUgRW5sA5Dapm5vGqUthx0Gh/kM= +github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13/go.mod h1:6XkcinjHeTsfYUk3IseBHy+0f8JP1lwsxHP+UzrxYEw= +github.com/flipped-aurora/ws v1.0.2/go.mod h1:RdyM2Fnvxx7f7A6WSmU1aAhDrQIAVW7LS/0LsAUE5mE= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yHzKvwhsiSIWmbAYM3Dr9AEEbER2dVayfBkg= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/glebarez/go-sqlite v1.16.0/go.mod h1:i8/JtqoqzBAFkrUTxbQFkQ05odCOds3j7NlDaXjqiPY= +github.com/glebarez/sqlite v1.4.3/go.mod h1:FcJlwP9scnxlQ5zxyl0+bn/qFjYcqG4eRvKYhs39QAQ= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.14/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA= +github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-redis/redis/v8 v8.11.0/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -110,6 +218,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -120,9 +229,13 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -138,76 +251,274 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gookit/color v1.3.1/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.11.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.10.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.15.0/go.mod h1:D/zyOyXiaM1TmVWnOM18p0xdDtdakRBa0RsVGI3U3bw= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= +github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/mojocn/base64Captcha v1.3.1/go.mod h1:wAQCKEc5bDujxKRmbT6/vTnTt5CjStQ8bRfPWUuz/iY= +github.com/mojocn/base64Captcha v1.3.5 h1:Qeilr7Ta6eDtG4S+tQuZ5+hO+QHbiGAJdi4PfoagaA0= +github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G6I7NcP2WwcmY= +github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= +github.com/mozillazg/go-pinyin v0.19.0 h1:p+J8/kjJ558KPvVGYLvqBhxf8jbZA2exSLCs2uUVN8c= +github.com/mozillazg/go-pinyin v0.19.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/qiniu/api.v7/v7 v7.4.1/go.mod h1:VE5oC5rkE1xul0u1S2N0b2Uxq9/6hZzhyqjgK25XDcM= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= +github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil/v3 v3.22.5/go.mod h1:so9G9VzeHt/hsd0YwqprnjHnfARAUktauykSbr+y2gA= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/songzhibin97/gkit v1.1.1/go.mod h1:V4E7H6DQuxX17xpLOqyH1j51GQctKBIIV3i2r5xkE5s= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -216,28 +527,76 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= +github.com/swaggo/gin-swagger v1.3.0/go.mod h1:oy1BRA6WvgtCp848lhxce7BnWH4C8Bxa0m5SkWx+cS0= +github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= +github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo= +github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= +github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/unrolled/secure v1.0.7/go.mod h1:uGc1OcRF8gCVBA+ANksKmvM85Hka6SZtQIbrKc3sHS4= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.4.1/go.mod h1:rSu0C3papjzxQA3sdK8cU544TebhrPUoTOaGPIh0Q1A= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/otel v1.0.0-RC2/go.mod h1:w1thVQ7qbAy8MHb0IFj8a5Q2QU0l2ksf8u/CN8m3NOM= +go.opentelemetry.io/otel/sdk v1.0.0-RC2/go.mod h1:fgwHyiDn4e5k40TD9VX243rOxXR+jzsWBZYA2P5jpEw= +go.opentelemetry.io/otel/trace v1.0.0-RC2/go.mod h1:JPQ+z6nNw9mqEGT8o3eoPTdnNI+Aj5JcxEsVGREIAy4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -252,7 +611,10 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -274,8 +636,15 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -283,9 +652,12 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -296,15 +668,25 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -326,19 +708,38 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -354,17 +755,29 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -372,27 +785,38 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -400,6 +824,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -420,11 +845,17 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -518,27 +949,54 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/mysql v1.0.3/go.mod h1:twGxftLBlFgNVNakL7F+P/x9oYqoymG3YYT8cAfI9oI= +gorm.io/driver/mysql v1.3.3/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= gorm.io/driver/mysql v1.3.5 h1:iWBTVW/8Ij5AG4e0G/zqzaJblYkBI1VIL1LG2HUGsvY= gorm.io/driver/mysql v1.3.5/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c= +gorm.io/driver/postgres v1.3.4/go.mod h1:y0vEuInFKJtijuSGu9e5bs5hzzSzPK+LancpKpvbRBw= +gorm.io/driver/sqlserver v1.3.2/go.mod h1:w25Vrx2BG+CJNUu/xKbFhaKlGxT/nzRkhWCCoptX8tQ= +gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= +gorm.io/gorm v1.20.11/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.8 h1:h8sGJ+biDgBA1AD1Ha9gFCx7h8npU7AsLdlkX0n2TpE= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/plugin/dbresolver v1.1.0/go.mod h1:tpImigFAEejCALOttyhWqsy4vfa2Uh/vAUVnL5IRF7Y= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -546,6 +1004,141 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.34.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.4/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.5/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.7/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.8/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.10/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.15/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.16/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.17/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.20/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.22/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.24/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.35.25/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.35.26/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= +modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= +modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= +modernc.org/ccgo/v3 v3.11.1/go.mod h1:lWHxfsn13L3f7hgGsGlU28D9eUOf6y3ZYHKoPaKU0ag= +modernc.org/ccgo/v3 v3.11.3/go.mod h1:0oHunRBMBiXOKdaglfMlRPBALQqsfrCKXgw9okQ3GEw= +modernc.org/ccgo/v3 v3.12.4/go.mod h1:Bk+m6m2tsooJchP/Yk5ji56cClmN6R1cqc9o/YtbgBQ= +modernc.org/ccgo/v3 v3.12.6/go.mod h1:0Ji3ruvpFPpz+yu+1m0wk68pdr/LENABhTrDkMDWH6c= +modernc.org/ccgo/v3 v3.12.8/go.mod h1:Hq9keM4ZfjCDuDXxaHptpv9N24JhgBZmUG5q60iLgUo= +modernc.org/ccgo/v3 v3.12.11/go.mod h1:0jVcmyDwDKDGWbcrzQ+xwJjbhZruHtouiBEvDfoIsdg= +modernc.org/ccgo/v3 v3.12.14/go.mod h1:GhTu1k0YCpJSuWwtRAEHAol5W7g1/RRfS4/9hc9vF5I= +modernc.org/ccgo/v3 v3.12.18/go.mod h1:jvg/xVdWWmZACSgOiAhpWpwHWylbJaSzayCqNOJKIhs= +modernc.org/ccgo/v3 v3.12.20/go.mod h1:aKEdssiu7gVgSy/jjMastnv/q6wWGRbszbheXgWRHc8= +modernc.org/ccgo/v3 v3.12.21/go.mod h1:ydgg2tEprnyMn159ZO/N4pLBqpL7NOkJ88GT5zNU2dE= +modernc.org/ccgo/v3 v3.12.22/go.mod h1:nyDVFMmMWhMsgQw+5JH6B6o4MnZ+UQNw1pp52XYFPRk= +modernc.org/ccgo/v3 v3.12.25/go.mod h1:UaLyWI26TwyIT4+ZFNjkyTbsPsY3plAEB6E7L/vZV3w= +modernc.org/ccgo/v3 v3.12.29/go.mod h1:FXVjG7YLf9FetsS2OOYcwNhcdOLGt8S9bQ48+OP75cE= +modernc.org/ccgo/v3 v3.12.36/go.mod h1:uP3/Fiezp/Ga8onfvMLpREq+KUjUmYMxXPO8tETHtA8= +modernc.org/ccgo/v3 v3.12.38/go.mod h1:93O0G7baRST1vNj4wnZ49b1kLxt0xCW5Hsa2qRaZPqc= +modernc.org/ccgo/v3 v3.12.43/go.mod h1:k+DqGXd3o7W+inNujK15S5ZYuPoWYLpF5PYougCmthU= +modernc.org/ccgo/v3 v3.12.46/go.mod h1:UZe6EvMSqOxaJ4sznY7b23/k13R8XNlyWsO5bAmSgOE= +modernc.org/ccgo/v3 v3.12.47/go.mod h1:m8d6p0zNps187fhBwzY/ii6gxfjob1VxWb919Nk1HUk= +modernc.org/ccgo/v3 v3.12.50/go.mod h1:bu9YIwtg+HXQxBhsRDE+cJjQRuINuT9PUK4orOco/JI= +modernc.org/ccgo/v3 v3.12.51/go.mod h1:gaIIlx4YpmGO2bLye04/yeblmvWEmE4BBBls4aJXFiE= +modernc.org/ccgo/v3 v3.12.53/go.mod h1:8xWGGTFkdFEWBEsUmi+DBjwu/WLy3SSOrqEmKUjMeEg= +modernc.org/ccgo/v3 v3.12.54/go.mod h1:yANKFTm9llTFVX1FqNKHE0aMcQb1fuPJx6p8AcUx+74= +modernc.org/ccgo/v3 v3.12.55/go.mod h1:rsXiIyJi9psOwiBkplOaHye5L4MOOaCjHg1Fxkj7IeU= +modernc.org/ccgo/v3 v3.12.56/go.mod h1:ljeFks3faDseCkr60JMpeDb2GSO3TKAmrzm7q9YOcMU= +modernc.org/ccgo/v3 v3.12.57/go.mod h1:hNSF4DNVgBl8wYHpMvPqQWDQx8luqxDnNGCMM4NFNMc= +modernc.org/ccgo/v3 v3.12.60/go.mod h1:k/Nn0zdO1xHVWjPYVshDeWKqbRWIfif5dtsIOCUVMqM= +modernc.org/ccgo/v3 v3.12.66/go.mod h1:jUuxlCFZTUZLMV08s7B1ekHX5+LIAurKTTaugUr/EhQ= +modernc.org/ccgo/v3 v3.12.67/go.mod h1:Bll3KwKvGROizP2Xj17GEGOTrlvB1XcVaBrC90ORO84= +modernc.org/ccgo/v3 v3.12.73/go.mod h1:hngkB+nUUqzOf3iqsM48Gf1FZhY599qzVg1iX+BT3cQ= +modernc.org/ccgo/v3 v3.12.81/go.mod h1:p2A1duHoBBg1mFtYvnhAnQyI6vL0uw5PGYLSIgF6rYY= +modernc.org/ccgo/v3 v3.12.84/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w= +modernc.org/ccgo/v3 v3.12.86/go.mod h1:dN7S26DLTgVSni1PVA3KxxHTcykyDurf3OgUzNqTSrU= +modernc.org/ccgo/v3 v3.12.90/go.mod h1:obhSc3CdivCRpYZmrvO88TXlW0NvoSVvdh/ccRjJYko= +modernc.org/ccgo/v3 v3.12.92/go.mod h1:5yDdN7ti9KWPi5bRVWPl8UNhpEAtCjuEE7ayQnzzqHA= +modernc.org/ccgo/v3 v3.13.1/go.mod h1:aBYVOUfIlcSnrsRVU8VRS35y2DIfpgkmVkYZ0tpIXi4= +modernc.org/ccgo/v3 v3.15.9/go.mod h1:md59wBwDT2LznX/OTCPoVS6KIsdRgY8xqQwBV+hkTH0= +modernc.org/ccgo/v3 v3.15.10/go.mod h1:wQKxoFn0ynxMuCLfFD09c8XPUCc8obfchoVR9Cn0fI8= +modernc.org/ccgo/v3 v3.15.12/go.mod h1:VFePOWoCd8uDGRJpq/zfJ29D0EVzMSyID8LCMWYbX6I= +modernc.org/ccgo/v3 v3.15.14/go.mod h1:144Sz2iBCKogb9OKwsu7hQEub3EVgOlyI8wMUPGKUXQ= +modernc.org/ccgo/v3 v3.15.15/go.mod h1:z5qltXjU4PJl0pE5nhYQCvA9DhPHiWsl5GWl89+NSYE= +modernc.org/ccgo/v3 v3.15.16/go.mod h1:XbKRMeMWMdq712Tr5ECgATYMrzJ+g9zAZEj2ktzBe24= +modernc.org/ccgo/v3 v3.15.17/go.mod h1:bofnFkpRFf5gLY+mBZIyTW6FEcp26xi2lgOFk2Rlvs0= +modernc.org/ccgo/v3 v3.15.18/go.mod h1:/2lv3WjHyanEr2sAPdGKRC38n6f0werut9BRXUjjX+A= +modernc.org/ccgo/v3 v3.15.19/go.mod h1:TDJj+DxR26pkDteH2E5WQDj/xlmtsX7JdzkJkaZhOVU= +modernc.org/ccgo/v3 v3.16.2/go.mod h1:w55kPTAqvRMAYS3Lwij6qhqIuBEYS3Z8QtDkjD8cnik= +modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= +modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= +modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= +modernc.org/libc v1.11.2/go.mod h1:ioIyrl3ETkugDO3SGZ+6EOKvlP3zSOycUETe4XM4n8M= +modernc.org/libc v1.11.5/go.mod h1:k3HDCP95A6U111Q5TmG3nAyUcp3kR5YFZTeDS9v8vSU= +modernc.org/libc v1.11.6/go.mod h1:ddqmzR6p5i4jIGK1d/EiSw97LBcE3dK24QEwCFvgNgE= +modernc.org/libc v1.11.11/go.mod h1:lXEp9QOOk4qAYOtL3BmMve99S5Owz7Qyowzvg6LiZso= +modernc.org/libc v1.11.13/go.mod h1:ZYawJWlXIzXy2Pzghaf7YfM8OKacP3eZQI81PDLFdY8= +modernc.org/libc v1.11.16/go.mod h1:+DJquzYi+DMRUtWI1YNxrlQO6TcA5+dRRiq8HWBWRC8= +modernc.org/libc v1.11.19/go.mod h1:e0dgEame6mkydy19KKaVPBeEnyJB4LGNb0bBH1EtQ3I= +modernc.org/libc v1.11.24/go.mod h1:FOSzE0UwookyT1TtCJrRkvsOrX2k38HoInhw+cSCUGk= +modernc.org/libc v1.11.26/go.mod h1:SFjnYi9OSd2W7f4ct622o/PAYqk7KHv6GS8NZULIjKY= +modernc.org/libc v1.11.27/go.mod h1:zmWm6kcFXt/jpzeCgfvUNswM0qke8qVwxqZrnddlDiE= +modernc.org/libc v1.11.28/go.mod h1:Ii4V0fTFcbq3qrv3CNn+OGHAvzqMBvC7dBNyC4vHZlg= +modernc.org/libc v1.11.31/go.mod h1:FpBncUkEAtopRNJj8aRo29qUiyx5AvAlAxzlx9GNaVM= +modernc.org/libc v1.11.34/go.mod h1:+Tzc4hnb1iaX/SKAutJmfzES6awxfU1BPvrrJO0pYLg= +modernc.org/libc v1.11.37/go.mod h1:dCQebOwoO1046yTrfUE5nX1f3YpGZQKNcITUYWlrAWo= +modernc.org/libc v1.11.39/go.mod h1:mV8lJMo2S5A31uD0k1cMu7vrJbSA3J3waQJxpV4iqx8= +modernc.org/libc v1.11.42/go.mod h1:yzrLDU+sSjLE+D4bIhS7q1L5UwXDOw99PLSX0BlZvSQ= +modernc.org/libc v1.11.44/go.mod h1:KFq33jsma7F5WXiYelU8quMJasCCTnHK0mkri4yPHgA= +modernc.org/libc v1.11.45/go.mod h1:Y192orvfVQQYFzCNsn+Xt0Hxt4DiO4USpLNXBlXg/tM= +modernc.org/libc v1.11.47/go.mod h1:tPkE4PzCTW27E6AIKIR5IwHAQKCAtudEIeAV1/SiyBg= +modernc.org/libc v1.11.49/go.mod h1:9JrJuK5WTtoTWIFQ7QjX2Mb/bagYdZdscI3xrvHbXjE= +modernc.org/libc v1.11.51/go.mod h1:R9I8u9TS+meaWLdbfQhq2kFknTW0O3aw3kEMqDDxMaM= +modernc.org/libc v1.11.53/go.mod h1:5ip5vWYPAoMulkQ5XlSJTy12Sz5U6blOQiYasilVPsU= +modernc.org/libc v1.11.54/go.mod h1:S/FVnskbzVUrjfBqlGFIPA5m7UwB3n9fojHhCNfSsnw= +modernc.org/libc v1.11.55/go.mod h1:j2A5YBRm6HjNkoSs/fzZrSxCuwWqcMYTDPLNx0URn3M= +modernc.org/libc v1.11.56/go.mod h1:pakHkg5JdMLt2OgRadpPOTnyRXm/uzu+Yyg/LSLdi18= +modernc.org/libc v1.11.58/go.mod h1:ns94Rxv0OWyoQrDqMFfWwka2BcaF6/61CqJRK9LP7S8= +modernc.org/libc v1.11.71/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= +modernc.org/libc v1.11.75/go.mod h1:dGRVugT6edz361wmD9gk6ax1AbDSe0x5vji0dGJiPT0= +modernc.org/libc v1.11.82/go.mod h1:NF+Ek1BOl2jeC7lw3a7Jj5PWyHPwWD4aq3wVKxqV1fI= +modernc.org/libc v1.11.86/go.mod h1:ePuYgoQLmvxdNT06RpGnaDKJmDNEkV7ZPKI2jnsvZoE= +modernc.org/libc v1.11.87/go.mod h1:Qvd5iXTeLhI5PS0XSyqMY99282y+3euapQFxM7jYnpY= +modernc.org/libc v1.11.88/go.mod h1:h3oIVe8dxmTcchcFuCcJ4nAWaoiwzKCdv82MM0oiIdQ= +modernc.org/libc v1.11.98/go.mod h1:ynK5sbjsU77AP+nn61+k+wxUGRx9rOFcIqWYYMaDZ4c= +modernc.org/libc v1.11.101/go.mod h1:wLLYgEiY2D17NbBOEp+mIJJJBGSiy7fLL4ZrGGZ+8jI= +modernc.org/libc v1.12.0/go.mod h1:2MH3DaF/gCU8i/UBiVE1VFRos4o523M7zipmwH8SIgQ= +modernc.org/libc v1.14.1/go.mod h1:npFeGWjmZTjFeWALQLrvklVmAxv4m80jnG3+xI8FdJk= +modernc.org/libc v1.14.2/go.mod h1:MX1GBLnRLNdvmK9azU9LCxZ5lMyhrbEMK8rG3X/Fe34= +modernc.org/libc v1.14.3/go.mod h1:GPIvQVOVPizzlqyRX3l756/3ppsAgg1QgPxjr5Q4agQ= +modernc.org/libc v1.14.6/go.mod h1:2PJHINagVxO4QW/5OQdRrvMYo+bm5ClpUFfyXCYl9ak= +modernc.org/libc v1.14.7/go.mod h1:f8xfWXW8LW41qb4X5+huVQo5dcfPlq7Cbny2TDheMv0= +modernc.org/libc v1.14.8/go.mod h1:9+JCLb1MWSY23smyOpIPbd5ED+rSS/ieiDWUpdyO3mo= +modernc.org/libc v1.14.10/go.mod h1:y1MtIWhwpJFpLYm6grAThtuXJKEsY6xkdZmXbRngIdo= +modernc.org/libc v1.14.11/go.mod h1:l5/Mz/GrZwOqzwRHA3abgSCnSeJzzTl+Ify0bAwKbAw= +modernc.org/libc v1.14.12/go.mod h1:fJdoe23MHu2ruPQkFPPqCpToDi5cckzsbmkI6Ez0LqQ= +modernc.org/libc v1.15.0/go.mod h1:H1OKCu+NYa9+uQG8WsP7DndMBP61I4PWH8ivWhbdoWQ= +modernc.org/libc v1.15.1/go.mod h1:CoZ2riUhSNTAP4bADwpxkLCyJK9SbbMvle0YRzkRT/I= +modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= +modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= +modernc.org/memory v1.0.6/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.0.7/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.16.0/go.mod h1:Jwe13ItpESZ+78K5WS6+AjXsUg+JvirsjN3iIDO4C8k= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/tcl v1.11.2/go.mod h1:BRzgpajcGdS2qTxniOx9c/dcxjlbA7p12eJNmiriQYo= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.3.2/go.mod h1:PEU2oK2OEA1CfzDTd+8E908qEXhC9s0MfyKp5LZsd+k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/identification/interceptor/authentication.go b/identification/interceptor/authentication.go new file mode 100644 index 0000000..e70810a --- /dev/null +++ b/identification/interceptor/authentication.go @@ -0,0 +1,167 @@ +package interceptor + +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" + "github.com/mitchellh/mapstructure" +) + +//身份验证器 +func IdentificationToken() gin.HandlerFunc { + return func(c *gin.Context) { + userToken := c.Request.Header.Get("token") + randomNumber := c.Request.Header.Get("number") + ContentType := c.Request.Header.Get("Content-Type") + Origin := c.Request.Header.Get("Origin") + userAgent := c.Request.Header.Get("User-Agent") + + if ContentType == "" || userToken == "" || userAgent == "" || randomNumber == "" { + iii := publicmethod.MapOut[string]() + iii["ContentType"] = ContentType + iii["userToken"] = userToken + iii["userAgent"] = userAgent + iii["Origin"] = Origin + iii["randomNumber"] = randomNumber + publicmethod.Result(2001, "请输入关键信息数据!", c) + c.Abort() + return + } + //设定redis Key名称 + redisKey := fmt.Sprintf("Authentication:ApiAuthent_%v", userToken) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS3) + tokenInfo, isTrue := redisClient.HashGetAll(redisKey) + if isTrue != true { + iii := publicmethod.MapOut[string]() + iii["ContentType"] = ContentType + iii["userToken"] = userToken + iii["userAgent"] = userAgent + iii["Origin"] = Origin + iii["randomNumber"] = randomNumber + iii["redisKey"] = redisKey + iii["isTrue"] = isTrue + publicmethod.Result(2002, "您的指令不正确!或已经超时!请重新获取指令!", c) + c.Abort() + return + } + var validator ValidatorToken + identityErr := mapstructure.Decode(tokenInfo, &validator) + if identityErr != nil { + publicmethod.Result(2003, "对不起!身份验证失败!", c) + c.Abort() + return + } + + //密码加密 + var passWordMd5 publicmethod.Md5Encryption + passWordMd5.Md5EncryptionInit(validator.PassWord) + passWordMd5Str := passWordMd5.Md5EncryptionAlgorithm() + + var empowerUser models.EmpowerUser + userErr := empowerUser.GetCont(map[string]interface{}{"userkey": validator.UserKey, "password": passWordMd5Str}, "verification_code") + if userErr != nil { + publicmethod.Result(2000, userErr, c) + return + } + + //头文件加密 + //ContentType + var ContentTypeMd5 publicmethod.Md5Encryption + ContentTypeMd5.Md5EncryptionInit(ContentType) + if empowerUser.VerificationCode != "" { + ContentTypeMd5.AppKey = empowerUser.VerificationCode + } + + fmt.Printf("ContentTypeMd5Str ----->%v\n", ContentTypeMd5) + + ContentTypeMd5Str := ContentTypeMd5.Md5EncryptionAlgorithm() + //Origin + var OriginMd5 publicmethod.Md5Encryption + OriginMd5.Md5EncryptionInit(Origin) + if empowerUser.VerificationCode != "" { + OriginMd5.AppKey = empowerUser.VerificationCode + } + originMd5Str := OriginMd5.Md5EncryptionAlgorithm() + //userAgent + var userAgentMd5 publicmethod.Md5Encryption + userAgentMd5.Md5EncryptionInit(userAgent) + if empowerUser.VerificationCode != "" { + userAgentMd5.AppKey = empowerUser.VerificationCode + } + + userAgentMd5Str := userAgentMd5.Md5EncryptionAlgorithm() + + //随机数加密 + var randomNumberMd5 publicmethod.Md5Encryption + randomNumberMd5.Md5EncryptionInit(validator.Number) + if empowerUser.VerificationCode != "" { + randomNumberMd5.AppKey = empowerUser.VerificationCode + } + + numberMd5 := randomNumberMd5.Md5EncryptionAlgorithm() + + //用户名加密 + var userKeyMd5 publicmethod.Md5Encryption + userKeyMd5.Md5EncryptionInit(validator.UserKey) + if empowerUser.VerificationCode != "" { + userKeyMd5.AppKey = empowerUser.VerificationCode + } + + userKeyMd5Str := userKeyMd5.Md5EncryptionAlgorithm() + + clearCodeToken := fmt.Sprintf("%v-%v-%v-%v-%v-%v", ContentTypeMd5Str, originMd5Str, userAgentMd5Str, numberMd5, userKeyMd5Str, passWordMd5Str) + + fmt.Printf("redisKey---->ContentTypeMd5Str:%v-originMd5Str:%v-userAgentMd5Str:%v-numberMd5:%v-userKeyMd5Str:%v-passwordMd5Str:%v\n", ContentTypeMd5Str, originMd5Str, userAgentMd5Str, numberMd5, userKeyMd5Str, passWordMd5Str) + + //token 加密 + var tokenMd5 publicmethod.Md5Encryption + tokenMd5.Md5EncryptionInit(clearCodeToken) + if empowerUser.VerificationCode != "" { + tokenMd5.AppKey = empowerUser.VerificationCode + } + fmt.Printf("tokenMd5Appk ----->%v\n", tokenMd5) + tokenMd5Str := tokenMd5.Md5EncryptionAlgorithm() + + clearTokenStr := fmt.Sprintf("%v-%v", tokenMd5Str, numberMd5) + var clearTokenMd5 publicmethod.Md5Encryption + clearTokenMd5.Md5EncryptionInit(clearTokenStr) + if empowerUser.VerificationCode != "" { + clearTokenMd5.AppKey = empowerUser.VerificationCode + } + clearTokenMd5Str := clearTokenMd5.Md5EncryptionAlgorithm() + + //提交Token转化 + submitTokenStr := fmt.Sprintf("%v-%v", userToken, randomNumber) + + var submitTokenMd5 publicmethod.Md5Encryption + submitTokenMd5.Md5EncryptionInit(submitTokenStr) + if empowerUser.VerificationCode != "" { + submitTokenMd5.AppKey = empowerUser.VerificationCode + } + submitTokenMd5Str := submitTokenMd5.Md5EncryptionAlgorithm() + + if submitTokenMd5Str != clearTokenMd5Str { + sss := publicmethod.MapOut[string]() + sss["numberMd5"] = numberMd5 + sss["submitTokenMd5Str"] = submitTokenMd5Str + sss["clearTokenMd5Str"] = clearTokenMd5Str + sss["tokenMd5Str"] = tokenMd5Str + sss["clearCodeToken"] = clearCodeToken + sss["submitTokenStr"] = submitTokenStr + sss["clearTokenStr"] = clearTokenStr + sss["userToken"] = userToken + + // tokenMd5Str, numberMd5 + // publicmethod.Result(2004, "对不起!非法令牌!不可访问系统", c) + publicmethod.Result(2004, sss, c, "对不起!非法令牌!不可访问系统") + c.Abort() + return + } + c.Set("token", validator) + c.Next() + } +} diff --git a/identification/interceptor/identity.go b/identification/interceptor/identity.go new file mode 100644 index 0000000..d2d88f1 --- /dev/null +++ b/identification/interceptor/identity.go @@ -0,0 +1,127 @@ +package interceptor + +import ( + "fmt" + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/overall" + "key_performance_indicators/overall/publicmethod" + + "github.com/flipped-aurora/gin-vue-admin/server/model/common/response" + "github.com/gin-gonic/gin" +) + +//验证用户是否登录 +func AuthenticateUser() gin.HandlerFunc { + return func(c *gin.Context) { + userKey := c.Request.Header.Get("user-key") + userToken := c.Request.Header.Get("user-token") + userAgent := c.Request.Header.Get("User-Agent") + + if userKey == "" || userToken == "" || userAgent == "" { + response.FailWithDetailed(gin.H{"reload": false, "code": 300}, "未登录或非法访问", c) + c.Abort() + return + } + + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + userRedisToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + response.FailWithDetailed(gin.H{"reload": false, "code": 301}, "未登录或非法访问", c) + c.Abort() + return + } + if userToken != userRedisToken["usertoken"] { + response.FailWithDetailed(gin.H{"reload": false, "code": 302}, "令牌不正确!非法访问!", c) + c.Abort() + return + } + myCont, myErr := publicmethod.GetUserRedisCont(userRedisToken["usernumber"]) + if myErr != nil { + response.FailWithDetailed(gin.H{"reload": false, "code": 303, "data": myErr}, "登录超时!请重新登录", c) + c.Abort() + return + } + // fmt.Printf("myCont---------------->%v\n", myCont) + c.Set(overall.MyContJwt, myCont) + writeRedisData := publicmethod.MapOut[string]() + for i, v := range userRedisToken { + writeRedisData[i] = v + } + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + myContRedis := publicmethod.MapOut[string]() + myContRedis["id"] = myCont.Id + myContRedis["number"] = myCont.Number //员工工号 + myContRedis["name"] = myCont.Name //姓名 + myContRedis["icon"] = myCont.Icon //头像 + myContRedis["hire_class"] = myCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) + myContRedis["emp_type"] = myCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + myContRedis["company"] = myCont.Company //入职公司 + myContRedis["maindeparment"] = myCont.MainDeparment //主部门 + myContRedis["sun_main_department"] = myCont.SunMainDeparment //二级主部门 + myContRedis["deparment"] = myCont.Deparment //部门 + myContRedis["admin_org"] = myCont.AdminOrg //所属行政组织 + myContRedis["teamid"] = myCont.TeamId //班组 + myContRedis["position"] = myCont.Position //职位 + myContRedis["job_class"] = myCont.JobClass //职务分类 + myContRedis["job_id"] = myCont.JobId //职务 + myContRedis["job_leve"] = myCont.JobLeve //职务等级 + myContRedis["wechat"] = myCont.Wechat //微信UserId + myContRedis["work_wechat"] = myCont.WorkWechat //企业微信UserId + myContRedis["state"] = myCont.State //状态(1:启用;2:禁用;3:删除) + myContRedis["key"] = myCont.Key //key + myContRedis["is_admin"] = myCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管 + myContRedis["password"] = myCont.Password //密码 + myContRedis["role"] = myCont.Role //角色 + myContRedis["idcardno"] = myCont.Idcardno //身份证号 + myContRedis["passportno"] = myCont.Passportno //护照号码 + myContRedis["globalroaming"] = myCont.Globalroaming //国际区号 + myContRedis["mobilephone"] = myCont.Mobilephone //手机号码 + myContRedis["email"] = myCont.Email //电子邮件 + myContRedis["gender"] = myCont.Gender //性别(1:男性;2:女性;3:中性) + myContRedis["birthday"] = myCont.Birthday //birthday + myContRedis["myfolk"] = myCont.Myfolk //民族 + myContRedis["nativeplace"] = myCont.Nativeplace //籍贯 + myContRedis["idcardstartdate"] = myCont.Idcardstartdate //身份证有效期开始 + myContRedis["idcardenddate"] = myCont.Idcardenddate //身份证有效期结束 + myContRedis["idcardaddress"] = myCont.Idcardaddress //身份证地址 + myContRedis["idcardIssued"] = myCont.IdcardIssued //身份证签发机关 + myContRedis["health"] = myCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废) + myContRedis["maritalstatus"] = myCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异) + myContRedis["internaltelephone"] = myCont.Internaltelephone //内线电话 + myContRedis["currentresidence"] = myCont.Currentresidence //现居住地址 + myContRedis["constellationing"] = myCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座) + myContRedis["isdoubleworker"] = myCont.Isdoubleworker //是否双职工(1:是;2:否) + myContRedis["isveterans"] = myCont.Isveterans //是否为退役军人(1:是;2:否) + myContRedis["veteransnumber"] = myCont.Veteransnumber //退役证编号 + myContRedis["jobstartdate"] = myCont.Jobstartdate //参加工作日期 + myContRedis["entrydate"] = myCont.Entrydate //入职日期 + myContRedis["probationperiod"] = myCont.Probationperiod //试用期 + myContRedis["planformaldate"] = myCont.Planformaldate //预计转正日期 + myContRedis["political_outlook"] = myCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员) + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, myCont.Number) + redisClient.HashMsetAdd(redisMyContKey, myContRedis) + c.Next() + } +} + +//验证用户是否具备权限 +func VerifyUrl() gin.HandlerFunc { + return func(c *gin.Context) { + systemClass := c.Request.Header.Get("system-class") + context, exi := publicmethod.LoginMyCont(c) + if exi != nil { + response.FailWithDetailed(gin.H{"reload": false, "code": 303, "data": exi}, exi.Error(), c) + c.Abort() + return + } + // 获取请求的PATH + obj := c.Request.URL.Path + // 获取请求方法 + act := c.Request.Method + + fmt.Printf("obj------>%v-----------act------->%v---systemClass------------>%v------------------context-------->%v\n", obj, act, systemClass, context.Role) + c.Next() + } +} diff --git a/identification/interceptor/type.go b/identification/interceptor/type.go new file mode 100644 index 0000000..f454134 --- /dev/null +++ b/identification/interceptor/type.go @@ -0,0 +1,8 @@ +package interceptor + +//验证器结构Token +type ValidatorToken struct { + Number string `json:"number"` //随机数 + UserKey string `json:"userkey"` //用户名 + PassWord string `json:"password"` //密码 +} diff --git a/initialization/databaseinit/mysql.go b/initialization/databaseinit/mysql.go index 50f6991..ce5c404 100644 --- a/initialization/databaseinit/mysql.go +++ b/initialization/databaseinit/mysql.go @@ -100,4 +100,11 @@ func LoadDatabase() { } else { fmt.Printf("%v数据库开启成功!\n", sqlConfig.WechatCallBackLogDate.Name) } + //管理档案 + overall.CONSTANT_DB_MANAGE_ARCHIVES = sqlConfig.Managearchives.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.Managearchives.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.Managearchives.Name) + } } diff --git a/initialization/route/initRoute.go b/initialization/route/initRoute.go index 5803b34..8cfe284 100644 --- a/initialization/route/initRoute.go +++ b/initialization/route/initRoute.go @@ -1,6 +1,11 @@ package route -import "github.com/gin-gonic/gin" +import ( + "key_performance_indicators/apirouter" + "key_performance_indicators/identification/interceptor" + + "github.com/gin-gonic/gin" +) //初始化主路由 func InitialRouter() *gin.Engine { @@ -19,6 +24,36 @@ func InitialRouter() *gin.Engine { 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/middleware/cross_domain.go b/middleware/cross_domain.go new file mode 100644 index 0000000..f237298 --- /dev/null +++ b/middleware/cross_domain.go @@ -0,0 +1,26 @@ +package middleware + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// 处理跨域请求,支持options访问 +func CrossDomainRequest() gin.HandlerFunc { + return func(c *gin.Context) { + method := c.Request.Method + origin := c.Request.Header.Get("Origin") + c.Header("Access-Control-Allow-Origin", origin) + c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id") + c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS,DELETE,PUT") + c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type") + c.Header("Access-Control-Allow-Credentials", "true") + // 放行所有OPTIONS方法 + if method == "OPTIONS" { + c.AbortWithStatus(http.StatusNoContent) + } + // 处理请求 + c.Next() + } +} diff --git a/middleware/grocerystore/redis.go b/middleware/grocerystore/redis.go new file mode 100644 index 0000000..1df5c4d --- /dev/null +++ b/middleware/grocerystore/redis.go @@ -0,0 +1,380 @@ +package grocerystore + +import ( + "context" + "fmt" + "key_performance_indicators/overall" + "time" + + "github.com/go-redis/redis/v8" +) + +//redis 基础设定 +type RedisStoreType struct { + Expiration time.Duration + PreKey string + Context context.Context + RedisDb *redis.Client +} + +//启动redis +func RunRedis(redisClient *redis.Client) *RedisStoreType { + var redisStoreType RedisStoreType + redisStoreType.Expiration = time.Second * 300 + redisStoreType.PreKey = fmt.Sprintf("%v:", overall.CONSTANT_CONFIG.RedisPrefixStr.PreFix) + redisStoreType.Context = context.Background() + redisStoreType.RedisDb = redisClient + return &redisStoreType +} + +//设置键前缀 +func (r *RedisStoreType) SetRedisPrefix(prefix string) { + r.PreKey = prefix +} + +//设置过期时间 +func (r *RedisStoreType) SetRedisTime(timeDate int64) { + r.Expiration = time.Second * time.Duration(timeDate) +} + +//设置字符串 +func (r *RedisStoreType) Set(key string, value string) bool { + err := r.RedisDb.Set(r.Context, r.PreKey+key, value, r.Expiration).Err() + if err != nil { + return false + } + return true +} + +//获取字符串 +func (r *RedisStoreType) Get(key string) (bool, string) { + err := r.RedisDb.Get(r.Context, r.PreKey+key) + if err.Err() != nil { + return false, "" + } + return true, err.Val() +} + +//删除键 +func (r *RedisStoreType) DelKey(key string) bool { + err := r.RedisDb.Del(r.Context, r.PreKey+key).Err() + if err != nil { + return false + } + return true +} + +//哈希操作 +/* +获取单个哈希键值 +@hashName 集合名称 +@hashKey 哈希键 +callback + errs 状态 + hashVal 获得值 +*/ +func (r *RedisStoreType) HashGet(hashName, hashKey string) (errs bool, hashVal string) { + err := r.RedisDb.HGet(r.Context, r.PreKey+hashName, hashKey) + if err.Err() != nil { + return false, "" + } + return true, err.Val() +} + +/* +为哈希表中的字段赋值 。 单一设置 +@hashName 集合名称 +@hashKey 哈希键 +@hashVal 要添加的值 +*/ +func (r *RedisStoreType) HashSet(hashName, hashKey, hashVal string) bool { + err := r.RedisDb.HSet(r.Context, r.PreKey+hashName, hashKey, hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + // global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + return true +} + +/* +同时将多个 field-value (字段-值)对设置到哈希表中。 +@hashName 集合名称 +@hashVal 要添加的键与值 +*/ +func (r *RedisStoreType) HashMsetAdd(hashName string, hashVal map[string]interface{}) bool { + // rdb := RedisInit() + err := r.RedisDb.HMSet(r.Context, r.PreKey+hashName, hashVal).Err() + // fmt.Printf("错误sss=========》%v=====2====》%v\n", err, hashVal) + // err := rdb.HMSet(ctx, "userfg", hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + + return true +} +func (r *RedisStoreType) HashMsetAddAry(hashName string, hashVal []map[string]interface{}) bool { + // rdb := RedisInit() + err := r.RedisDb.HMSet(r.Context, r.PreKey+hashName, hashVal).Err() + // err := rdb.HMSet(ctx, "userfg", hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + // global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + // fmt.Printf("错误sss=========》%v\n", hashVal) + return true +} + +/* +返回哈希表中,所有的字段和值。 +@hashName 集合名称 +@hashKey 哈希键 +*/ +func (r *RedisStoreType) HashGetAll(hashName string) (map[string]string, bool) { + // rdb := RedisInit() + // fmt.Printf("strKEy:===>%v\n", r.PreKey+hashName) + val, err := r.RedisDb.HGetAll(r.Context, r.PreKey+hashName).Result() + if err != nil { + return val, false + } + if len(val) == 0 { + return val, false + } + return val, true +} + +//Redis 列表(List) + +/** +Linsert 命令用于在列表的元素前或者后插入元素。当指定元素不存在于列表中时,不执行任何操作。 +当列表不存在时,被视为空列表,不执行任何操作。 +如果 key 不是列表类型,返回一个错误。 +@key 列表 +@op 插入状态 (1:在pivot之后;2:在pivot之前) +@pivot 定位值 +@value 要插入值 +*/ +func (r *RedisStoreType) Linsert(key string, op int, pivot, value interface{}) (int64, bool) { + BeforeOrAfter := "BEFORE" + if op != 1 { + BeforeOrAfter = "AFTER" + } + linsert, linsertErr := r.RedisDb.LInsert(r.Context, key, BeforeOrAfter, pivot, value).Result() + if linsertErr != nil { + return 0, false + } + return linsert, true +} + +/** +Lindex 命令用于通过索引获取列表中的元素。你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 +@key 列表 +@index 索引 +*/ +func (r *RedisStoreType) Lindex(key string, index int64) (val string, err error) { + val, err = r.RedisDb.LIndex(r.Context, key, index).Result() + return +} + +/** +Llen 命令用于返回列表的长度。 如果列表 key 不存在,则 key 被解释为一个空列表,返回 0 。 如果 key 不是列表类型,返回一个错误。 +@key 列表 +*/ +func (r *RedisStoreType) Llen(key string) (val int64, err error) { + val, err = r.RedisDb.LLen(r.Context, key).Result() + return +} + +/** +Lpop 命令用于移除并返回列表的第一个元素。 +@key 列表 +*/ +func (r *RedisStoreType) Lpop(key string) (val string, err error) { + val, err = r.RedisDb.LPop(r.Context, key).Result() + return +} + +/** +Lpush 命令将一个或多个值插入到列表头部。 如果 key 不存在,一个空列表会被创建并执行 LPUSH 操作。 当 key 存在但不是列表类型时,返回一个错误。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Lpush(key string, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.LPush(r.Context, key, value).Result() + return +} + +/** +Lpushx 将一个值插入到已存在的列表头部,列表不存在时操作无效。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Lpushx(key, value string) (val int64, err error) { + val, err = r.RedisDb.LPushX(r.Context, key, value).Result() + return +} + +/** +Lrange 返回列表中指定区间内的元素,区间以偏移量 START 和 END 指定。 其中 0 表示列表的第一个元素, 1 表示列表的第二个元素,以此类推。 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 +@key 列表 +@start 起始值 +@stop 结束值 +*/ +func (r *RedisStoreType) Lrange(key string, start, stop int64) (val []string, err error) { + val, err = r.RedisDb.LRange(r.Context, key, start, stop).Result() + return +} + +/** +Lrem 根据参数 COUNT 的值,移除列表中与参数 VALUE 相等的元素。 +COUNT 的值可以是以下几种: + count > 0 : 从表头开始向表尾搜索,移除与 VALUE 相等的元素,数量为 COUNT 。 + count < 0 : 从表尾开始向表头搜索,移除与 VALUE 相等的元素,数量为 COUNT 的绝对值。 + count = 0 : 移除表中所有与 VALUE 相等的值。 +@start = COUNT +@key 列表 +*/ +func (r *RedisStoreType) Lrem(key string, start int64, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.LRem(r.Context, key, start, value).Result() + return +} + +/** +Redis Lset 通过索引来设置元素的值。 + +当索引参数超出范围,或对一个空列表进行 LSET 时,返回一个错误。 +@key 列表 +@indexes 索引值 +*/ +func (r *RedisStoreType) Lset(key string, indexes int64, value ...interface{}) (val string, err error) { + val, err = r.RedisDb.LSet(r.Context, key, indexes, value).Result() + return +} + +/** +Ltrim 对一个列表进行修剪(trim),就是说,让列表只保留指定区间内的元素,不在指定区间之内的元素都将被删除。 + +下标 0 表示列表的第一个元素,以 1 表示列表的第二个元素,以此类推。 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 +@key 列表 +@start 起始值 +@stop 结束值 +*/ +func (r *RedisStoreType) Ltrim(key string, start, stop int64) (val string, err error) { + val, err = r.RedisDb.LTrim(r.Context, key, start, stop).Result() + return +} + +/** +Rpop 命令用于移除列表的最后一个元素,返回值为移除的元素。 +@key 列表 +*/ +func (r *RedisStoreType) Rpop(key string) (val string, err error) { + val, err = r.RedisDb.RPop(r.Context, key).Result() + return +} + +/** +Rpoplpush 命令用于移除列表的最后一个元素,并将该元素添加到另一个列表并返回。 +@sourceKey 源列表 +@newKey 目标列表 +*/ +func (r *RedisStoreType) Rpoplpush(sourceKey, newKey string) (val string, err error) { + val, err = r.RedisDb.RPopLPush(r.Context, sourceKey, newKey).Result() + return +} + +/** +Rpush 命令用于将一个或多个值插入到列表的尾部(最右边)。 +如果列表不存在,一个空列表会被创建并执行 RPUSH 操作。 当列表存在但不是列表类型时,返回一个错误。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Rpush(key string, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.RPush(r.Context, key, value).Result() + return +} + +/** +Rpushx 命令用于将一个值插入到已存在的列表尾部(最右边)。如果列表不存在,操作无效。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Rpushx(key string, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.RPushX(r.Context, key, value).Result() + return +} + +/** +Blpop 命令移出并获取列表的第一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。 +@key 列表 +*/ +func (r *RedisStoreType) Blpop(key string) (val []string, err error) { + val, err = r.RedisDb.BLPop(r.Context, r.Expiration, key).Result() + return +} + +/** +Brpop 命令移出并获取列表的最后一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。 +@key 列表 +*/ +func (r *RedisStoreType) Brpop(key string) (val []string, err error) { + val, err = r.RedisDb.BRPop(r.Context, r.Expiration, key).Result() + return +} + +/** +Brpoplpush 命令从列表中取出最后一个元素,并插入到另外一个列表的头部; 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。 +@source 源列表 +@destination 目标列表 +*/ +func (r *RedisStoreType) Brpoplpush(source, destination string) (val string, err error) { + val, err = r.RedisDb.BRPopLPush(r.Context, source, destination, r.Expiration).Result() + return +} + +/* +Redis 键(key) +Redis 键命令用于管理 redis 的键。 +*/ + +/* +Redis SCAN 命令 +Redis Scan 命令用于迭代数据库中的数据库键。 + +SCAN 命令是一个基于游标的迭代器,每次被调用之后, 都会向用户返回一个新的游标, 用户在下次迭代时需要使用这个新游标作为 SCAN 命令的游标参数, 以此来延续之前的迭代过程。 + +SCAN 返回一个包含两个元素的数组, 第一个元素是用于进行下一次迭代的新游标, 而第二个元素则是一个数组, 这个数组中包含了所有被迭代的元素。如果新游标返回 0 表示迭代已结束。 + +相关命令: + + SSCAN 命令用于迭代集合键中的元素。 + HSCAN 命令用于迭代哈希键中的键值对。 + ZSCAN 命令用于迭代有序集合中的元素(包括元素成员和元素分值)。 +*/ + +func (r *RedisStoreType) Scan(cursor uint64, match string, count int64) (keys []string, cursores uint64, err error) { + keys, cursores, err = r.RedisDb.Scan(r.Context, cursor, match, count).Result() + return +} + +/* +*Keys 命令用于查找所有符合给定模式 pattern 的 key 。。 + */ +func (r *RedisStoreType) Keys(key string) (val []string, err error) { + val, err = r.RedisDb.Keys(r.Context, key).Result() + return +} diff --git a/middleware/snowflake/snowflake.go b/middleware/snowflake/snowflake.go new file mode 100644 index 0000000..18ac34b --- /dev/null +++ b/middleware/snowflake/snowflake.go @@ -0,0 +1,38 @@ +package snowflake + +import ( + "errors" + "time" +) + +//雪花算法 +func NewWorker(workerId int64) (*Worker, error) { + if workerId < 0 || workerId > workerMax { + return nil, errors.New("工作机器的ID超出范围!") + } + // 生成一个新节点 + return &Worker{ + timestamp: 0, + workerId: workerId, + number: 0, + }, nil +} + +func (w *Worker) GetId() int64 { + w.mu.Lock() + defer w.mu.Unlock() + now := time.Now().UnixNano() / 1e6 + if w.timestamp == now { + w.number++ + if w.number > numberMax { + for now <= w.timestamp { + now = time.Now().UnixNano() / 1e6 + } + } + } else { + w.number = 0 + w.timestamp = now + } + ID := int64((now-startTime)< 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//根据条件获取总数 +func (cont *AdministrativeOrganization) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} + +//读取全部信息 +func (cont *AdministrativeOrganization) ContMap(whereMap interface{}) (countAry []AdministrativeOrganization) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Find(&countAry) + return +} diff --git a/models/administrative_organization_type.go b/models/administrative_organization_type.go new file mode 100644 index 0000000..c0851f5 --- /dev/null +++ b/models/administrative_organization_type.go @@ -0,0 +1,38 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//行政组织类型 +type AdministrativeOrganizationType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:类型名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` +} + +func (AdministrativeOrganizationType *AdministrativeOrganizationType) TableName() string { + return "administrative_organization_type" +} + +//编辑职务分类内容 +func (cont *AdministrativeOrganizationType) EiteCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取详细内容 +func (cont *AdministrativeOrganizationType) GetCont(whereMap map[string]interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/carrier_type.go b/models/carrier_type.go new file mode 100644 index 0000000..bccec69 --- /dev/null +++ b/models/carrier_type.go @@ -0,0 +1,42 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//载体类型 +type CarrierType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:荣誉名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (CarrierType *CarrierType) TableName() string { + return "carrier_type" +} + +//编辑载体类型内容 +func (cont *CarrierType) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取载体类型内容 +func (cont *CarrierType) 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 *CarrierType) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/double_worker.go b/models/double_worker.go new file mode 100644 index 0000000..4f15268 --- /dev/null +++ b/models/double_worker.go @@ -0,0 +1,42 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//双职工 +type DoubleWorker struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Company string `json:"company" gorm:"column:company;type:varchar(255) unsigned;default:'';not null;comment:所在公司"` + Department string `json:"department" gorm:"column:department;type:varchar(255) unsigned;default:'';not null;comment:所在部门"` + Position string `json:"position" gorm:"column:position;type:varchar(255) unsigned;default:'';not null;comment:所在岗位"` + Tel string `json:"tel" gorm:"column:tel;type:varchar(255) unsigned;default:'';not null;comment:联系方式"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (DoubleWorker *DoubleWorker) TableName() string { + return "double_worker" +} + +//编辑双职工内容 +func (DoubleWorker *DoubleWorker) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&DoubleWorker).Where(whereMap).Updates(saveData).Error + return +} + +//获取双职工内容 +func (cont *DoubleWorker) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/duties.go b/models/duties.go new file mode 100644 index 0000000..8735bcb --- /dev/null +++ b/models/duties.go @@ -0,0 +1,41 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//职务 +type Duties struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` + JobType int64 `json:"jobtype" gorm:"column:job_type;type:bigint(20) unsigned;default:0;not null;comment:归属职务类型"` + Weight int64 `json:"weight" gorm:"column:weight;type:bigint(20) unsigned;default:1;not null;comment:权重"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:编码"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + KingdeeNum string `json:"kingdeenum" gorm:"column:kingdeenum;type:varchar(255) unsigned;default:'';comment:金蝶对照编码"` +} + +func (Duties *Duties) TableName() string { + return "duties" +} + +//编辑职务分类内容 +func (Duties *Duties) EiteCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&Duties).Where(whereMap).Updates(saveData).Error + return +} + +//获取详细内容 +func (cont *Duties) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/duties_class_leve.go b/models/duties_class_leve.go new file mode 100644 index 0000000..1f04e17 --- /dev/null +++ b/models/duties_class_leve.go @@ -0,0 +1,37 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//职务信息及类别、等级视图 +type DutiesClassLeve struct { + Id int64 `json:"id" gorm:"primaryKey;column:d_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:d_name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` + Weight int64 `json:"weight" gorm:"column:d_weight;type:bigint(20) unsigned;default:1;not null;comment:权重"` + Number string `json:"number" gorm:"column:d_num;type:varchar(50) unsigned;default:'';not null;comment:编码"` + State int `json:"state" gorm:"column:d_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + KingdeeId string `json:"kingdeeid" gorm:"column:d_king;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + ClassId int64 `json:"classid" gorm:"column:c_id;type:bigint(20) unsigned;not null;comment:Id;index"` //职务分类Id + ClassName string `json:"classname" gorm:"column:c_name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` + // LeveId int64 `json:"leveid" gorm:"column:l_id;type:bigint(20) unsigned;not null;comment:Id;index"` //职务等级Id + // LeveNumber string `json:"levenumber" gorm:"column:l_num;type:varchar(50) unsigned;default:'';not null;comment:等级编号"` + // LeveName string `json:"levename" gorm:"column:l_name;type:varchar(255) unsigned;default:'';not null;comment:等级名称"` +} + +func (DutiesClassLeve *DutiesClassLeve) TableName() string { + return "duties_class_leve" +} + +//获取详细内容 +func (cont *DutiesClassLeve) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/emergency_contact.go b/models/emergency_contact.go new file mode 100644 index 0000000..fed3dc1 --- /dev/null +++ b/models/emergency_contact.go @@ -0,0 +1,46 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//紧急联系人 +type EmergencyContact struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"primaryKey;column:number;type:varchar(30) unsigned;not null;comment:员工工号;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:紧急联系人姓名"` + Relationship string `json:"relationship" gorm:"column:relationship;type:varchar(255) unsigned;default:'';not null;comment:与紧急联系人关系"` + Tel string `json:"tel" gorm:"column:tel;type:varchar(255) unsigned;default:'';not null;comment:紧急联系人电话"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (EmergencyContact *EmergencyContact) TableName() string { + return "emergency_contact" +} + +//编辑职务分类内容 +func (EmergencyContact *EmergencyContact) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&EmergencyContact).Where(whereMap).Updates(saveData).Error + return +} + +//获取行政组织内容 +func (cont *EmergencyContact) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.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 *EmergencyContact) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/empoweruser.go b/models/empoweruser.go new file mode 100644 index 0000000..c513d89 --- /dev/null +++ b/models/empoweruser.go @@ -0,0 +1,46 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//授权账户 +type EmpowerUser struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + UserKey string `json:"userkey" gorm:"column:userkey;type:varchar(255) unsigned;not null;comment:账户"` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Name string `json:"name" gorm:"column:name;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:删除)` + Time int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + VerificationCode string `json:"verificationcode" gorm:"column:verification_code;type:mediumtext unsigned;comment:身份识别码"` +} + +func (Position *EmpowerUser) TableName() string { + return "empoweruser" +} + +//编辑职务分类内容 +func (cont *EmpowerUser) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取行政组织内容 +func (cont *EmpowerUser) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.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 *EmpowerUser) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/family_members.go b/models/family_members.go new file mode 100644 index 0000000..b42e9a8 --- /dev/null +++ b/models/family_members.go @@ -0,0 +1,46 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//员工家属 +type FamilyMembers struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Relationship string `json:"relationship" gorm:"column:relation;type:varchar(255) unsigned;default:'';not null;comment:亲属关系"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Company string `json:"company" gorm:"column:company;type:varchar(255) unsigned;default:'';not null;comment:所在公司"` + Deparment string `json:"deparment" gorm:"column:deparment;type:varchar(255) unsigned;default:'';not null;comment:所在部门"` + Postnme string `json:"postnme" gorm:"column:postnme;type:varchar(255) unsigned;default:'';not null;comment:所在岗位"` + Tel string `json:"tel" gorm:"column:tel;type:varchar(255) unsigned;default:'';not null;comment:紧急联系人电话"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:int(3) unsigned;default:1;not null;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + + PoliticalOutlookCn string `json:"politicaloutlookcn" gorm:"column:political_outlook_cn;type:varchar(30) unsigned;not null;comment:政治面貌汉字说明"` +} + +func (FamilyMembers *FamilyMembers) TableName() string { + return "family_members" +} + +//编辑员工家属内容 +func (FamilyMembers *FamilyMembers) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&FamilyMembers).Where(whereMap).Updates(saveData).Error + return +} + +//获取员工家属内容 +func (cont *FamilyMembers) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/honorary_archives.go b/models/honorary_archives.go new file mode 100644 index 0000000..7072e06 --- /dev/null +++ b/models/honorary_archives.go @@ -0,0 +1,49 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//荣誉档案 +type HonoraryArchives struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:荣誉名称"` + IssuingUnit string `json:"issuingunit" gorm:"column:issuing_unit;type:varchar(255) unsigned;default:'';not null;comment:发放单位"` + Carrier int64 `json:"carrier" gorm:"column:carrier;type:bigint(20) unsigned;default:0;not null;comment:载体"` + AwardTime int64 `json:"awardtime" gorm:"column:award_time;type:bigint(20) ;default:0;not null;comment:获奖时间"` + TermOfValidity int64 `json:"termvalidity" gorm:"column:term_of_validity;type:bigint(20) unsigned;default:0;not null;comment:有效期限"` + Contet string `json:"contet" gorm:"column:contet;type:mediumtext unsigned;comment:备注"` + Organization int64 `json:"organization" gorm:"column:organization;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + Userid int64 `json:"userid" gorm:"column:userid;type:bigint(20) unsigned;default:0;not null;comment:归属人员"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (HonoraryArchives *HonoraryArchives) TableName() string { + return "honorary_archives" +} + +//编辑荣誉档案内容 +func (cont *HonoraryArchives) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取荣誉档案内容 +func (cont *HonoraryArchives) 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 *HonoraryArchives) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/inside_work_history.go b/models/inside_work_history.go new file mode 100644 index 0000000..0690ca6 --- /dev/null +++ b/models/inside_work_history.go @@ -0,0 +1,48 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//集团内部工作经历 +type InsideWorkHistory struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:员工识别符"` + Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:集团"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:公司"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部室"` + WorkShop int64 `json:"workshop" gorm:"column:workshop;type:bigint(20) unsigned;default:0;not null;comment:二级部门或车间"` + WorkshopSection int64 `json:"workshopsection" gorm:"column:workshop_section;type:bigint(20) unsigned;default:0;not null;comment:工段"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + GradePositions int64 `json:"gradepositions" gorm:"column:grade_positions;type:bigint(20) unsigned;default:0;not null;comment:职等"` + StartTime int64 `json:"starttime" gorm:"column:start_time;type:bigint(20) unsigned;default:0;not null;comment:开始日期"` + EndTime int64 `json:"endtime" gorm:"column:end_time;type:bigint(20) unsigned;default:0;not null;comment:结束日期"` + Team int64 `json:"team" gorm:"column:team;type:int(1) unsigned;default:1;not null;comment:班组(1:长白;2:甲;3:乙;4:丙;5:丁)"` + ChangeType int `json:"changetype" gorm:"column:change_type;type:int(1) unsigned;default:1;not null;comment:变动类型(1:预入职;2:雇佣入职;3:转正;4:晋升;5:降级;6:职等调整;7:调动调入;8:跨公司调动调入;9:借调;10:平调;11:兼职;12:预离职;13:离职;14:退休;15:返聘;16:员工初始化;)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AssignType int `json:"assigntype" gorm:"column:assign_type;type:int(1) unsigned;default:1;not null;comment:1、主职;2:兼职"` +} + +func (InsideWorkHistory *InsideWorkHistory) TableName() string { + return "inside_work_history" +} + +//编辑集团内部工作经历内容 +func (cont *InsideWorkHistory) EditCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取详细内容 +func (cont *InsideWorkHistory) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/inside_work_view.go b/models/inside_work_view.go new file mode 100644 index 0000000..7d4ef32 --- /dev/null +++ b/models/inside_work_view.go @@ -0,0 +1,39 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +type InsideWorkView struct { + InsideWorkHistory + GroupNumber string `json:"groupnumber" gorm:"column:g_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + GroupName string `json:"groupname" gorm:"column:g_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + CompanyNumber string `json:"companynumber" gorm:"column:c_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + CompanyName string `json:"companyname" gorm:"column:c_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + DepartmentNumber string `json:"departmentnumber" gorm:"column:d_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + DepartmentName string `json:"departmentname" gorm:"column:d_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + WorkShopNumber string `json:"workshopnumber" gorm:"column:ws_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + WorkShopName string `json:"workshopname" gorm:"column:ws_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + SectionNumber string `json:"sectionnumber" gorm:"column:w_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + SectionName string `json:"sectionnasectionme" gorm:"column:w_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + PostJobNumber string `json:"postjobnumber" gorm:"column:p_number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"` + PostJobName string `json:"postjobname" gorm:"column:p_name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + TeamName string `json:"teamname" gorm:"column:r_name;type:varchar(255) unsigned;default:'';not null;comment:班组名称"` +} + +func (InsideWorkView *InsideWorkView) TableName() string { + return "inside_work_view" +} + +//获取详细内容 +func (cont *InsideWorkView) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/job_class.go b/models/job_class.go new file mode 100644 index 0000000..d107378 --- /dev/null +++ b/models/job_class.go @@ -0,0 +1,38 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//职务分类 +type JobClass struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + KingdeeNum string `json:"kingdeenum" gorm:"column:kingdeenum;type:varchar(255) unsigned;default:'';comment:金蝶对照编码"` +} + +func (JobClass *JobClass) TableName() string { + return "job_class" +} + +//编辑职务分类内容 +func (JobClass *JobClass) EiteJobClassCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&JobClass).Where(whereMap).Updates(saveData).Error + return +} + +//获取详细内容 +func (cont *JobClass) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/kingdee_log.go b/models/kingdee_log.go new file mode 100644 index 0000000..3e4a813 --- /dev/null +++ b/models/kingdee_log.go @@ -0,0 +1,36 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//金蝶对照记录 +type KingdeeLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(255) unsigned;default:'';not null;comment:工号"` + Cont string `json:"cont" gorm:"column:cont;type:longtext unsigned;default:'';not null;comment:内容"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (KingdeeLog *KingdeeLog) TableName() string { + return "kingdee_log" +} + +//编辑职务分类内容 +func (KingdeeLog *KingdeeLog) EidtCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&KingdeeLog).Where(whereMap).Updates(saveData).Error + return +} + +//获取详细内容 +func (cont *KingdeeLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/man_cont.go b/models/man_cont.go new file mode 100644 index 0000000..d79c804 --- /dev/null +++ b/models/man_cont.go @@ -0,0 +1,76 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +type ManCont struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_department;type:bigint(20) unsigned;default:0;not null;comment:二级主部门"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + Idcardno string `json:"idcardno" gorm:"column:idcardno;type:varchar(50) unsigned;default:'';not null;comment:身份证号"` + Passportno string `json:"passportno" gorm:"column:passportno;type:varchar(50) unsigned;default:'';not null;comment:护照号码"` + Globalroaming string `json:"globalroaming" gorm:"column:globalroaming;type:varchar(50) unsigned;default:'';not null;comment:国际区号"` + Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` + Email string `json:"email" gorm:"column:email;type:varchar(255) unsigned;default:'';not null;comment:电子邮件"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` + Birthday int64 `json:"birthday" gorm:"column:birthday;type:bigint(20) unsigned;default:0;not null;comment:birthday"` + Myfolk string `json:"myfolk" gorm:"column:myfolk;type:varchar(50) unsigned;default:'';not null;comment:民族"` + Nativeplace string `json:"nativeplace" gorm:"column:nativeplace;type:varchar(255) unsigned;default:'';not null;comment:籍贯"` + Idcardstartdate int64 `json:"idcardstartdate" gorm:"column:idcardstartdate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期开始"` + Idcardenddate int64 `json:"idcardenddate" gorm:"column:idcardenddate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期结束"` + Idcardaddress string `json:"idcardaddress" gorm:"column:idcardaddress;type:varchar(255) unsigned;default:'';not null;comment:身份证地址"` + IdcardIssued string `json:"idcardIssued" gorm:"column:idcardIssued;type:varchar(255) unsigned;default:'';not null;comment:身份证签发机关"` + Health int `json:"health" gorm:"column:health;type:tinyint(1) unsigned;default:1;not null;comment:健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` + Maritalstatus int `json:"maritalstatus" gorm:"column:maritalstatus;type:tinyint(1) unsigned;default:1;not null;comment:婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` + Internaltelephone string `json:"internaltelephone" gorm:"column:internaltelephone;type:varchar(255) unsigned;default:'';not null;comment:内线电话"` + Currentresidence string `json:"currentresidence" gorm:"column:currentresidence;type:varchar(255) unsigned;default:'';not null;comment:现居住地址"` + Constellation int `json:"constellationing" gorm:"column:constellationing;type:tinyint(3) unsigned;comment:星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` + Isdoubleworker int `json:"isdoubleworker" gorm:"column:isdoubleworker;type:tinyint(1) unsigned;default:1;comment:是否双职工(1:是;2:否)"` + Isveterans int `json:"isveterans" gorm:"column:isveterans;type:tinyint(1) unsigned;default:1;comment:是否为退役军人(1:是;2:否)"` + Veteransnumber string `json:"veteransnumber" gorm:"column:veteransnumber;type:varchar(255) unsigned;default:'';comment:退役证编号"` + Jobstartdate int64 `json:"jobstartdate" gorm:"column:jobstartdate;type:bigint(20) unsigned;default:0;comment:参加工作日期"` + Entrydate int64 `json:"entrydate" gorm:"column:entrydate;type:bigint(20) unsigned;default:0;comment:入职日期"` + Probationperiod int `json:"probationperiod" gorm:"column:probationperiod;type:int(5) unsigned;default:0;comment:试用期"` + Planformaldate int64 `json:"planformaldate" gorm:"column:planformaldate;type:bigint(20) unsigned;default:0;comment:预计转正日期"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:tinyint(3) unsigned;default:1;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` +} + +func (ManCont *ManCont) TableName() string { + return "man_cont" +} + +//获取职务分类内容 +func (cont *ManCont) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/menu_operation.go b/models/menu_operation.go new file mode 100644 index 0000000..369eadb --- /dev/null +++ b/models/menu_operation.go @@ -0,0 +1,12 @@ +package models + +//菜单功能 +type MenuOperation struct { + OperId int64 `json:"operId" gorm:"primaryKey;column:oper_id;type:bigint(20) unsigned;not null;comment:功能ID"` + MenuId int64 `json:"menuId" gorm:"column:menu_id;type:bigint(20) unsigned;not null;default:0;comment:菜单id"` + OperTitle string `json:"operTitle" gorm:"column:oper_title;type:varchar(255);not null;comment:操作名称"` +} + +func (MenuOperation *MenuOperation) TableName() string { + return "menu_operation" +} diff --git a/models/myuser.go b/models/myuser.go new file mode 100644 index 0000000..97d83a4 --- /dev/null +++ b/models/myuser.go @@ -0,0 +1,90 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//个人信息主表 +type WorkMan struct { + Id int64 `json:"id" gorm:"column:wm_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"` + Number string `json:"number" gorm:"column:wm_number;type:varchar(10);not null;comment:员工编号"` + Password string `json:"pwd" gorm:"column:wm_pwd;type:varchar(50);not null;comment:密码"` + DepartmentId int64 `json:"departmentid" gorm:"column:wm_bf_id;type:bigint(20) unsigned;default:0;not null;comment:分厂"` + WorkshopId int64 `json:"workshopid" gorm:"column:wm_ws_id;type:bigint(20) unsigned;default:0;not null;comment:工段"` + PostId int64 `json:"postid" gorm:"column:wm_pt_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + Key int64 `json:"key" gorm:"column:wm_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` + State int `json:"state" gorm:"column:wm_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + HireSet int `json:"hireset" gorm:"column:wm_hire_set;type:tinyint(1) unsigned;default:1;not null;comment:雇佣状态(1:在职;2:离职)"` + Time int64 `json:"time" gorm:"column:wm_time;type:bigint(20) unsigned;default:0;not null;comment:添加事件"` + EiteTime int64 `json:"eitetime" gorm:"column:wm_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改事件"` + UserId int64 `json:"userid" gorm:"column:wm_user_id;type:bigint(50) unsigned;default:0;not null;comment:录入人"` + QuitTime int64 `json:"quitime" gorm:"column:wm_quit_time;type:bigint(20) unsigned;default:0;not null"` + Group int64 `json:"group" gorm:"column:wm_group;type:bigint(20) unsigned;default:0;not null;comment:集团公司"` + Soptcheck int `json:"soptcheck" gorm:"column:wm_soptcheck;type:tinyint(1) unsigned;default:1;not null"` + Tema int64 `json:"tema" gorm:"column:wm_tema;type:bigint(20) unsigned;default:0;not null;comment:班组"` + IsOne int `json:"isone" gorm:"column:wm_one;type:tinyint(1) unsigned;default:1;not null;comment:第一次登陆"` + WorkWechatId string `json:"workwechatid" gorm:"column:qywx_key;type:varchar(255);not null;comment:企业微信KEY"` + WechatId string `json:"wechatid" gorm:"column:wx_key;type:varchar(255);not null;comment:微信KEY"` +} + +func (WorkMan *WorkMan) TableName() string { + return "worker_man" +} + +//获取职务分类内容 +func (cont *WorkMan) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_Master.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//个人信息附表 +type WorkManAttribute struct { + KeyAttr int64 `json:"key" gorm:"column:wmd_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别符"` + Name string `json:"name" gorm:"column:wmd_name;type:varchar(50);not null;comment:姓名"` + Gender int `json:"gender" gorm:"column:wmd_gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男;2:女)"` + Age int `json:"age" gorm:"column:wmd_age;type:tinyint(3) unsigned;default:1;not null;comment:年龄"` + Tel string `json:"tel" gorm:"column:wmd_tel;type:varchar(25);not null;comment:联系方式"` + Category int `json:"category" gorm:"column:wmd_category;type:tinyint(1) unsigned;default:1;not null;comment:人员类别(1:正式工;2:合同工;3:实习生)"` + CertificatesType int `json:"certificatesType" gorm:"column:wmd_certificates_type;type:tinyint(1) unsigned;default:1;not null;comment:证件类型(1:身份证;2:驾驶证;3:军人证;4:护照;5:居住证)"` + CertificatesNum string `json:"certificatesNum" gorm:"column:wmd_certificates_number;type:varbinary(50);comment:证件编号"` + Birthday int64 `json:"birthday" gorm:"column:wmd_birthday;type:bigint(20) unsigned;default:0;not null;comment:出生日期"` + EntryTime int64 `json:"entryTime" gorm:"column:wmd_entry_time;type:bigint(20) unsigned;default:0;not null;comment:入职日期"` + QuitTimeAttr int64 `json:"quitTime" gorm:"column:wmd_quit_time;type:bigint(20) unsigned;default:0;not null;comment:离职日期"` + EiteTimeAttr int64 `json:"eiteTime" gorm:"column:wmd_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + Addrest string `json:"addrest" gorm:"column:wmd_addrest;type:varchar(255);comment:家庭住址"` + Icon string `json:"icon" gorm:"column:wmd_icon;type:varchar(255);comment:照片"` + NickName string `json:"nickName" gorm:"column:wmd_nickname;type:varchar(255);comment:昵称"` +} + +func (WorkManAttribute *WorkManAttribute) TableName() string { + return "worker_man_data" +} + +//个人详细信息 +type PersonalDetails struct { + WorkMan + WorkManAttribute +} + +//Redis身份识别 +type RedisUserInfo struct { + Id string `json:"id"` + Number string `json:"number"` + DepartmentId string `json:"departmentid"` + WorkshopId string `json:"workshopid"` + PostId string `json:"postid"` + Key string `json:"key"` + Group string `json:"group"` + Tema string `json:"tema"` + WorkWechatId string `json:"workwechatid"` + WechatId string `json:"wechatid"` + Name string `json:"name"` + NickName string `json:"nickname"` +} diff --git a/models/org_cont_type.go b/models/org_cont_type.go new file mode 100644 index 0000000..dd6d561 --- /dev/null +++ b/models/org_cont_type.go @@ -0,0 +1,34 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//职务信息及类别、等级视图 +type OrgContType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + TypeName string `json:"typename" gorm:"column:typename;type:varchar(255) unsigned;default:'';not null;comment:类型名称"` + Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"` + IsPower int `json:"ispower" gorm:"column:ispower;type:int(1) unsigned;default:2;not null;comment:是否为实权部门"` +} + +func (OrgContType *OrgContType) TableName() string { + return "org_cont_type" +} + +//获取详细内容 +func (cont *OrgContType) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/personarchives.go b/models/personarchives.go new file mode 100644 index 0000000..cc80f2f --- /dev/null +++ b/models/personarchives.go @@ -0,0 +1,61 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//员工档案(主) +type PersonArchives struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + + EmpTypeName string `json:"emptypename" gorm:"column:emp_type_name;type:varchar(255) unsigned;default:'';not null;comment:用工关系中文"` + HireClassName string `json:"hireclassname" gorm:"column:hire_class_name;type:varchar(255) unsigned;default:'';not null;comment:雇佣类型中文"` + + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_deparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` +} + +func (PersonArchives *PersonArchives) TableName() string { + return "person_archives" +} + +//编辑员工档案 +func (PersonArchives *PersonArchives) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonArchives).Where(whereMap).Updates(saveData).Error + return +} + +//获取员工档案 +func (cont *PersonArchives) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/personnel.go b/models/personnel.go new file mode 100644 index 0000000..f1ce272 --- /dev/null +++ b/models/personnel.go @@ -0,0 +1,54 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//员工档案(主) +type Personnel struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + PositionLevel int64 `json:"positionleveles" gorm:"column:positionleveles;type:bigint(20) unsigned;default:0;not null;comment:职位"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + PositionGrade int64 `json:"positiongrade" gorm:"column:position_grade;type:bigint(20) unsigned;default:0;not null;comment:入职职等"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + Password string `json:"password" gorm:"column:password;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:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` +} + +func (Personnel *Personnel) TableName() string { + return "personnel" +} + +//编辑员工档案 +func (Personnel *Personnel) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&Personnel).Where(whereMap).Updates(saveData).Error + return +} + +//获取员工档案 +func (cont *Personnel) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/personnel_change_record.go b/models/personnel_change_record.go new file mode 100644 index 0000000..9ec46f9 --- /dev/null +++ b/models/personnel_change_record.go @@ -0,0 +1,58 @@ +package models + +import "key_performance_indicators/overall" + +//人员变动记录 +type PersonnelChangeRecord struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Type int `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:1;comment:变动类型(1:雇佣入职;2:再入职;3:职位分配;4:转正;5:停薪留职;6:退休;7:辞退;8:离职)"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:变动原因"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:职位"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;comment:职务"` + JobLevel int64 `json:"joblevel" gorm:"column:job_level;type:bigint(20) unsigned;default:'';comment:职务等级"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:0;comment:职务分类"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;comment:入职公司"` + MainDepartment int64 `json:"maindepartment" gorm:"column:main_department;type:bigint(20) unsigned;default:0;comment:主部门"` + Department string `json:"department" gorm:"column:department;type:varchar(255) unsigned;default:0;comment:入职分厂"` + Adminorg int64 `json:"adminorg" gorm:"column:adminorg;type:bigint(20) unsigned;default:0;comment:入职行政组织"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (PersonnelChangeRecord *PersonnelChangeRecord) TableName() string { + return "personnel_change_record" +} + +//编辑职务分类内容 +func (PersonnelChangeRecord *PersonnelChangeRecord) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonnelChangeRecord).Where(whereMap).Updates(saveData).Error + return +} + +type ManTransferLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Type int `json:"classtype" gorm:"column:classtype;type:tinyint(1) unsigned;default:1;comment:变动类型(1:雇佣入职;2:再入职;3:职位分配;4:转正;5:停薪留职;6:退休;7:辞退;8:离职)"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:变动原因"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:职位"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;comment:职务"` + JobLevel int64 `json:"joblevel" gorm:"column:job_level;type:bigint(20) unsigned;default:'';comment:职务等级"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:0;comment:职务分类"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;comment:入职公司"` + MainDepartment int64 `json:"maindepartment" gorm:"column:main_department;type:bigint(20) unsigned;default:0;comment:主部门"` + Department string `json:"department" gorm:"column:department;type:varchar(255) unsigned;default:0;comment:入职分厂"` + Adminorg int64 `json:"adminorg" gorm:"column:adminorg;type:bigint(20) unsigned;default:0;comment:入职行政组织"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (ManTransferLog *ManTransferLog) TableName() string { + return "man_transfer_log" +} + +//编辑职务分类内容 +func (ManTransferLog *ManTransferLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&ManTransferLog).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/personnel_content.go b/models/personnel_content.go new file mode 100644 index 0000000..afed964 --- /dev/null +++ b/models/personnel_content.go @@ -0,0 +1,67 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//员工附属信息 + +type PersonnelContent struct { + Number string `json:"number" gorm:"primaryKey;column:number;type:varchar(30) unsigned;not null;comment:员工工号;index"` + Idcardno string `json:"idcardno" gorm:"column:idcardno;type:varchar(50) unsigned;default:'';not null;comment:身份证号"` + Passportno string `json:"passportno" gorm:"column:passportno;type:varchar(50) unsigned;default:'';not null;comment:护照号码"` + Globalroaming string `json:"globalroaming" gorm:"column:globalroaming;type:varchar(50) unsigned;default:'';not null;comment:国际区号"` + Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` + Email string `json:"email" gorm:"column:email;type:varchar(255) unsigned;default:'';not null;comment:电子邮件"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` + Birthday int64 `json:"birthday" gorm:"column:birthday;type:bigint(20) unsigned;default:0;not null;comment:birthday"` + Myfolk string `json:"myfolk" gorm:"column:myfolk;type:varchar(50) unsigned;default:'';not null;comment:民族"` + Nativeplace string `json:"nativeplace" gorm:"column:nativeplace;type:varchar(255) unsigned;default:'';not null;comment:籍贯"` + Idcardstartdate int64 `json:"idcardstartdate" gorm:"column:idcardstartdate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期开始"` + Idcardenddate int64 `json:"idcardenddate" gorm:"column:idcardenddate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期结束"` + Idcardaddress string `json:"idcardaddress" gorm:"column:idcardaddress;type:varchar(255) unsigned;default:'';not null;comment:身份证地址"` + IdcardIssued string `json:"idcardIssued" gorm:"column:idcardIssued;type:varchar(255) unsigned;default:'';not null;comment:身份证签发机关"` + Health int `json:"health" gorm:"column:health;type:tinyint(1) unsigned;default:1;not null;comment:健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` + Maritalstatus int `json:"maritalstatus" gorm:"column:maritalstatus;type:tinyint(1) unsigned;default:1;not null;comment:婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` + Internaltelephone string `json:"internaltelephone" gorm:"column:internaltelephone;type:varchar(255) unsigned;default:'';not null;comment:内线电话"` + Currentresidence string `json:"currentresidence" gorm:"column:currentresidence;type:varchar(255) unsigned;default:'';not null;comment:现居住地址"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Constellation int `json:"constellationing" gorm:"column:constellationing;type:tinyint(3) unsigned;comment:星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` + Isdoubleworker int `json:"isdoubleworker" gorm:"column:isdoubleworker;type:tinyint(1) unsigned;default:1;comment:是否双职工(1:是;2:否)"` + Isveterans int `json:"isveterans" gorm:"column:isveterans;type:tinyint(1) unsigned;default:1;comment:是否为退役军人(1:是;2:否)"` + Veteransnumber string `json:"veteransnumber" gorm:"column:veteransnumber;type:varchar(255) unsigned;default:'';comment:退役证编号"` + Jobstartdate int64 `json:"jobstartdate" gorm:"column:jobstartdate;type:bigint(20) unsigned;default:0;comment:参加工作日期"` + Entrydate int64 `json:"entrydate" gorm:"column:entrydate;type:bigint(20) unsigned;default:0;comment:入职日期"` + Probationperiod int `json:"probationperiod" gorm:"column:probationperiod;type:int(5) unsigned;default:0;comment:试用期"` + Planformaldate int64 `json:"planformaldate" gorm:"column:planformaldate;type:bigint(20) unsigned;default:0;comment:预计转正日期"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:tinyint(3) unsigned;default:1;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + + MaritalstatusCn string `json:"maritalstatuscn" gorm:"column:maritalstatus_cn;type:varchar(50) unsigned;default:'';not null;comment:婚姻状况汉字说明"` + ConstellationingCn string `json:"constellationingcn" gorm:"column:constellationing_cn;type:varchar(50) unsigned;default:'';not null;comment:星座汉字说明"` + PoliticalOutlookCn string `json:"politicaloutlookcn" gorm:"column:political_outlook_cn;type:varchar(50) unsigned;default:'';not null;comment:政治面貌汉字说明"` + HealthCn string `json:"healthcn" gorm:"column:health_cn;type:varchar(50) unsigned;default:'';not null;comment:健康状况中文说明"` +} + +func (PersonnelContent *PersonnelContent) TableName() string { + return "personnel_content" +} + +//编辑职务分类内容 +func (PersonnelContent *PersonnelContent) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonnelContent).Where(whereMap).Updates(saveData).Error + return +} + +//获取职务分类内容 +func (cont *PersonnelContent) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/personnel_education.go b/models/personnel_education.go new file mode 100644 index 0000000..7ef997e --- /dev/null +++ b/models/personnel_education.go @@ -0,0 +1,48 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//教育经历 + +type PersonnelEducation struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;comment:员工工号"` + Education int `json:"education" gorm:"column:education;type:int(5) unsigned;default:1;comment:学历(1:初中及以下;2:中专;3:高中;4:中技;5:高技;6:函数专科;7:大学专科;8:函数本科;9:大学本科;10:硕士研究生;11:博士研究生;12:专家、教授)"` + GraduationSchool string `json:"graduationschool" gorm:"column:graduation_school;type:varchar(255) unsigned;default:'';comment:毕业学校"` + Subject string `json:"subject" gorm:"column:subject;type:varchar(255) unsigned;default:'';comment:专业"` + AdmissionTime int64 `json:"admissiontime" gorm:"column:admission_time;type:bigint(20) unsigned;default:0;comment:入学时间"` + GraduationTime int64 `json:"graduationtime" gorm:"column:graduation_time;type:bigint(20) unsigned;default:0;comment:毕业时间"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` + Level int `json:"level" gorm:"column:level;type:tinyint(1) unsigned;default:1;comment:学历类型(1:普通;2:第一学历;3:最高学历)"` + AcademicDegree int `json:"academicdegree" gorm:"column:academic_degree;type:tinyint(2) unsigned;default:1;comment:学位(1:无;2:学士;3:硕士;4:博士)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + + AcademicDegreeCn string `json:"academicdegreecn" gorm:"column:academic_degree_cn;type:varchar(30) unsigned;comment:学位中文说明"` + EducationCn string `json:"educationcn" gorm:"column:education_cn;type:varchar(30) unsigned;comment:学历中文说明"` +} + +func (PersonnelEducation *PersonnelEducation) TableName() string { + return "personnel_education" +} + +//编辑教育经历内容 +func (PersonnelEducation *PersonnelEducation) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonnelEducation).Where(whereMap).Updates(saveData).Error + return +} + +//获取教育经历内容 +func (cont *PersonnelEducation) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/photos_gallery.go b/models/photos_gallery.go new file mode 100644 index 0000000..224cdba --- /dev/null +++ b/models/photos_gallery.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/models/position.go b/models/position.go new file mode 100644 index 0000000..ce3b549 --- /dev/null +++ b/models/position.go @@ -0,0 +1,52 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//职位(岗位) +type Position struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + Duties int64 `json:"duties" gorm:"column:duties;type:bigint(20) unsigned;default:0;not null;comment:职务"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AdministrativeOrganization int64 `json:"administrativeorganization" gorm:"column:administrative_organization;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部门"` + MenuPermit string `json:"menupermit" gorm:"column:menu_permit;type:longtext;comment:菜单许可证"` + ButtonPermit string `json:"buttonpermit" gorm:"column:button_permit;type:longtext;comment:按钮许可"` + School int64 `json:"school" gorm:"column:school;type:bigint(20) unsigned;default:0;not null;comment:部门"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` +} + +func (Position *Position) TableName() string { + return "position" +} + +//编辑职务分类内容 +func (cont *Position) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取行政组织内容 +func (cont *Position) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.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 *Position) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/position_level.go b/models/position_level.go new file mode 100644 index 0000000..c691108 --- /dev/null +++ b/models/position_level.go @@ -0,0 +1,22 @@ +package models + +import "key_performance_indicators/overall" + +//职位等级 +type PositionLevel struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:等级编号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:等级名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + PositionId int64 `json:"positionid" gorm:"column:positionid;type:bigint(20) unsigned;default:0;not null;comment:归属哪个职务"` +} + +func (PositionLevel *PositionLevel) TableName() string { + return "position_level" +} + +//编辑职务分类内容 +func (PositionLevel *PositionLevel) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PositionLevel).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/post_duties_job.go b/models/post_duties_job.go new file mode 100644 index 0000000..be7d677 --- /dev/null +++ b/models/post_duties_job.go @@ -0,0 +1,44 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//职务与岗位视图 + +type PostDutiesJob struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + PersonInCharge int `json:"personincharge" gorm:"column:perincha;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + Duties int64 `json:"duties" gorm:"column:duties;type:bigint(20) unsigned;default:0;not null;comment:职务"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AdministrativeOrganization int64 `json:"administrativeorganization" gorm:"column:adm_org;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部门"` + MenuPermit string `json:"menupermit" gorm:"column:menu_permit;type:longtext;comment:菜单许可证"` + ButtonPermit string `json:"buttonpermit" gorm:"column:button_permit;type:longtext;comment:按钮许可"` + School int64 `json:"school" gorm:"column:school;type:bigint(20) unsigned;default:0;not null;comment:部门"` + DutiesName string `json:"dutiesname" gorm:"column:duties_name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` + DutiesNumber string `json:"dutiesnumber" gorm:"column:duties_number;type:varchar(50) unsigned;default:'';not null;comment:编码"` + Weight int64 `json:"weight" gorm:"column:weight;type:bigint(20) unsigned;default:1;not null;comment:权重"` + JobType int64 `json:"jobtype" gorm:"column:job_type;type:bigint(20) unsigned;default:0;not null;comment:归属职务类型"` + JobName string `json:"jobname" gorm:"column:job_name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` +} + +func (PostDutiesJob *PostDutiesJob) TableName() string { + return "post_duties_job" +} + +//获取详细内容 +func (cont *PostDutiesJob) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/step_role_group.go b/models/step_role_group.go new file mode 100644 index 0000000..7196554 --- /dev/null +++ b/models/step_role_group.go @@ -0,0 +1,36 @@ +package models + +import "key_performance_indicators/overall" + +//角色组(审批流程使用) +type RoleGroup struct { + Id int64 `json:"id" gorm:"primaryKey;column:srg_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:srg_name;type:text;comment:角色名称"` + Group int64 `json:"group" gorm:"column:srg_group;type:bigint(20) unsigned;default:0;not null;comment:角色归属"` + Addtime int64 `json:"addtime" gorm:"column:srg_time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + State int `json:"state" gorm:"column:srg_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Contentes string `json:"content" gorm:"column:srg_extatry;type:mediumtext;comment:操作组"` + Type int `json:"type" gorm:"column:srg_type;type:int(1) unsigned;default:1;not null;comment:操作类型(1:部门矩阵;2:个人)"` +} + +func (RoleGroup *RoleGroup) TableName() string { + return "step_role_group" +} + +//获取详情 +func (cont *RoleGroup) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + for _, v := range filed { + gormDb = gormDb.Select(v) + } + } + err := gormDb.First(&cont).Error + return err +} + +//编辑内容 +func (cont *RoleGroup) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/system_nenu.go b/models/system_nenu.go new file mode 100644 index 0000000..04315e7 --- /dev/null +++ b/models/system_nenu.go @@ -0,0 +1,47 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//菜单 +type SystemMenu struct { + Id int64 `json:"id" gorm:"primaryKey;column:m_id;type:bigint(20) unsigned;not null;comment:ID"` + Title string `json:"title" gorm:"column:m_title;type:varchar(255);not null;comment:菜单名称"` + State int `json:"state" gorm:"column:m_steat;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` + ParentId int64 `json:"parentId" gorm:"column:m_parent;type:bigint(30) unsigned;default:0;not null;comment:'父级(顶级:0)"` + ApiUrl string `json:"apiUrl" gorm:"column:m_url;type:varchar(255);not null;comment:地址"` + Time int64 `json:"time" gorm:"column:m_time;type:bigint(30) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eiteTime" gorm:"column:m_eite_time;type:bigint(30) unsigned;default:0;not null;comment:修改时间"` + UserId int64 `json:"userId" gorm:"column:m_user_id;type:bigint(20) unsigned;not null;default:0;comment:写入人"` + Sort int `json:"sort" gorm:"column:m_sort;type:tinyint(3) unsigned;default:0;not null;comment:排序"` +} + +func (SystemMenu *SystemMenu) TableName() string { + return "system_menu" +} + +//菜单管理 +type SystemMenuOperation struct { + SystemMenu + MenuPermit []MenuOperation `json:"menupermit"` +} + +//根据条件获取总数 +func (cont *SystemMenu) CountCont(whereMap map[string]interface{}) (countId int64) { + overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Count(&countId) + return +} + +//获取行政组织内容 +func (cont *SystemMenu) GetCont(whereMap map[string]interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_Master.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/system_role.go b/models/system_role.go new file mode 100644 index 0000000..493e7d0 --- /dev/null +++ b/models/system_role.go @@ -0,0 +1,39 @@ +package models + +import "key_performance_indicators/overall" + +type SystemRole struct { + Id int64 `json:"id" gorm:"column:r_id;type:bigint(20) unsigned;not null;comment:Id"` + Title string `json:"title" gorm:"column:r_title;type:varchar(36);not null;comment:角色名称"` + State int `json:"state" gorm:"column:r_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` + Attribute int64 `json:"attribute" gorm:"column:r_attribute;type:bigint(20) unsigned;default:0;not null;comment:属性"` + Gode int `json:"gode" gorm:"column:r_gode;type:tinyint(1) unsigned;default:1;not null;comment:继承属性(1:系统管理员;2:分厂管理员)"` + Time int64 `json:"time" gorm:"column:r_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + UserId int64 `json:"userId" gorm:"column:r_user_id;type:bigint(50) unsigned;default:0;not null;comment:写入人"` + Jurisdiction string `json:"jurisdiction" gorm:"column:r_jurisdiction;type:text;not null;comment:权限"` + MenuOper string `json:"menuoper" gorm:"column:r_menu_oper;type:text;not null;comment:权限"` + Wand int `json:"wand" gorm:"column:r_wand;type:tinyint(2) unsigned;default:0;not null;comment:权杖"` + Group int64 `json:"group" gorm:"column:r_group;type:bigint(20) unsigned;not null;default:3;comment:归属集团"` +} + +func (SystemRole *SystemRole) TableName() string { + return "system_role" +} + +//获取详情 +func (cont *SystemRole) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + for _, v := range filed { + gormDb = gormDb.Select(v) + } + } + err := gormDb.First(&cont).Error + return err +} + +//编辑内容 +func (cont *SystemRole) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/system_user.go b/models/system_user.go new file mode 100644 index 0000000..deca05b --- /dev/null +++ b/models/system_user.go @@ -0,0 +1,40 @@ +package models + +import "key_performance_indicators/overall" + +//系统用户表 +type SystemUser struct { + Id int64 `json:"id" gorm:"column:u_id;type:bigint(20) unsigned;not null;comment:Id"` + Name string `json:"name" gorm:"column:u_name;type:varchar(36);not null;comment:用户名"` + PassWord string `json:"passWord" gorm:"column:u_password;type:varchar(30);not null;comment:密码"` + Role int64 `json:"role" gorm:"column:u_role;type:bigint(20) unsigned;not null;default:1;comment:用户类型"` + State int `json:"state" gorm:"column:u_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` + Attribute int64 `json:"attribute" gorm:"column:u_attribute;type:bigint(20) unsigned;not null;default:0;comment:账号属性"` + Time int64 `json:"time" gorm:"column:u_time;type:bigint(30) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eiteTime" gorm:"column:u_eite_time;type:bigint(30) unsigned;default:0;not null;comment:修改时间"` + Key int64 `json:"key" gorm:"column:u_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` + Group int64 `json:"group" gorm:"column:u_group;type:bigint(20) unsigned;not null;default:0;comment:集团公司"` + Wand int `json:"wand" gorm:"column:u_wand;type:tinyint(3) unsigned;default:0;not null;comment:权重"` +} + +func (SystemUser *SystemUser) TableName() string { + return "system_user" +} + +//获取详情 +func (cont *SystemUser) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + for _, v := range filed { + gormDb = gormDb.Select(v) + } + } + err := gormDb.First(&cont).Error + return err +} + +//编辑内容 +func (cont *SystemUser) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/system_user_attribute.go b/models/system_user_attribute.go new file mode 100644 index 0000000..969b3c3 --- /dev/null +++ b/models/system_user_attribute.go @@ -0,0 +1,33 @@ +package models + +import "key_performance_indicators/overall" + +//系统管理员属性资料 +type SystemUserAttribute struct { + IdAttr int64 `json:"id" gorm:"column:ua_id;type:bigint(50) unsigned;not null;comment:Id"` + NameAttr string `json:"name" gorm:"column:ua_name;type:varchar(20);not null;comment:姓名"` + Tel string `json:"tel" gorm:"column:ua_tel;type:varchar(30);not null;default:0;comment:电话"` + TimeAttr int64 `json:"time" gorm:"column:ua_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (SystemUserAttribute *SystemUserAttribute) TableName() string { + return "system_user_attribute" +} + +//获取详情 +func (cont *SystemUserAttribute) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + for _, v := range filed { + gormDb = gormDb.Select(v) + } + } + err := gormDb.First(&cont).Error + return err +} + +//编辑内容 +func (cont *SystemUserAttribute) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/teamgroup.go b/models/teamgroup.go new file mode 100644 index 0000000..f05c3b9 --- /dev/null +++ b/models/teamgroup.go @@ -0,0 +1,36 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//班组 +type TeamGroup struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:班组名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (TeamGroup *TeamGroup) TableName() string { + return "teamgroup" +} + +//编辑班组内容 +func (TeamGroup *TeamGroup) EiteTeamGroupCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&TeamGroup).Where(whereMap).Updates(saveData).Error + return +} + +//获取详细内容 +func (cont *TeamGroup) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/wechatUsers.go b/models/wechatUsers.go new file mode 100644 index 0000000..85b6a4a --- /dev/null +++ b/models/wechatUsers.go @@ -0,0 +1,34 @@ +package models + +//企业微信人员架构 +type WechatUsers struct { + Uid int64 `json:"uid" gorm:"column:u_id;type:bigint(20) unsigned;default:0;not null;comment:id"` + Userid string `json:"userid" gorm:"column:userid;type:varchar(255);not null;comment:wechat user id企业微信用户ID"` + Name string `json:"name" gorm:"column:name;type:varchar(100);not null;comment:姓名"` + Department string `json:"department" gorm:"column:department;type:text;comment:归属部门json"` + Position string `json:"position" gorm:"column:position;type:varchar(255);not null;comment:企业微信职务"` + Mobile string `json:"mobile" gorm:"column:mobile;type:varchar(100);not null;comment:企业微信电话"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别。1表示男性,2表示女性"` + Email string `json:"email" gorm:"column:email;type:varchar(255);not null;comment:邮箱"` + Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255);not null;comment:员工头像"` + Status int `json:"status" gorm:"column:status;type:tinyint(1) unsigned;default:1;not null;comment:激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。"` + Extattr string `json:"extattr" gorm:"column:extattr;type:mediumtext;comment:企业微信员工扩展属性"` + MainDepartment int64 `json:"main_department" gorm:"column:main_department;type:int(8) unsigned;default:0;not null;comment:主部门"` + QrCode string `json:"qr_code" gorm:"column:qr_code;type:text;comment:员工个人二维码,扫描可添加为外部联系人(注意返回的是一个url,可在浏览器上打开该url以展示二维码);第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取"` + IsLeaderInDept string `json:"is_leader_in_dept" gorm:"column:is_leader_in_dept;type:text;comment:表示在所在的部门内是否为上级。0-否;1-是。是一个列表,数量必须与department一致。第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取"` + ThumbAvatar string `json:"thumb_avatar" gorm:"column:thumb_avatar;type:varchar(255);not null;comment:头像缩略图url"` + UserNumber string `json:"user_number" gorm:"column:user_number;type:varchar(8);not null;comment:工号"` + SysBf int64 `json:"sys_bf" gorm:"column:sys_bf;type:int(20) unsigned;default:0;not null;comment:系统分厂"` + SysWs int64 `json:"sys_ws" gorm:"column:sys_ws;type:int(20) unsigned;default:0;not null;comment:系统工段"` + SysPs int64 `json:"sys_ps" gorm:"column:sys_ps;type:int(20) unsigned;default:0;not null;comment:系统职务"` + WmTema int64 `json:"wm_tema" gorm:"column:wm_tema;type:int(20) unsigned;default:0;not null;comment:系统班组"` + IsAdmin int `json:"is_admin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:管理员1、否;2:是"` + IsRole int64 `json:"is_role" gorm:"column:is_role;type:int(20) unsigned;default:0;not null;comment:角色"` + Pwd string `json:"pwd" gorm:"column:pwd;type:varchar(255);not null;comment:密码"` + Time int64 `json:"time" gorm:"column:time;type:int(20) unsigned;default:0;not null;comment:写入时间"` +} + +func (WechatUsers *WechatUsers) TableName() string { + // return "wechatusers_es" + return "wechatusers" +} diff --git a/models/work_history.go b/models/work_history.go new file mode 100644 index 0000000..159451e --- /dev/null +++ b/models/work_history.go @@ -0,0 +1,51 @@ +package models + +import ( + "key_performance_indicators/overall" + "strings" +) + +//工作履历 +type WorkHistory struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:工号"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:身份识别"` + Company string `json:"company" gorm:"column:company;type:varchar(255) unsigned;default:'';comment:公司"` + Deparment string `json:"deparment" gorm:"column:deparment;type:varchar(255) unsigned;default:'';comment:部门"` + Job string `json:"job" gorm:"column:job;type:varchar(255) unsigned;default:'';comment:职务"` + EntryTime int64 `json:"entrytime" gorm:"column:entry_time;type:bigint(20) unsigned;default:0;not null;comment:入职时间"` + Leavedate int64 `json:"leavedate" gorm:"column:leavedate;type:bigint(20) unsigned;default:0;not null;comment:离职日期"` + Witness string `json:"witness" gorm:"column:witness;type:varchar(255) unsigned;default:'';comment:证明人"` + WitnessTel string `json:"witnesstel" gorm:"column:witness_tel;type:varchar(255) unsigned;default:'';comment:证明人电话"` + Remarks string `json:"remarks" gorm:"column:remarks;type:text unsigned;default:'';comment:备注"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (WorkHistory *WorkHistory) TableName() string { + return "work_history" +} + +//编辑职务分类内容 +func (cont *WorkHistory) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +//获取行政组织内容 +func (cont *WorkHistory) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.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 *WorkHistory) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/overall/appConfig.go b/overall/appConfig.go index e9ebabb..45f0b68 100644 --- a/overall/appConfig.go +++ b/overall/appConfig.go @@ -15,6 +15,7 @@ var ( EmployeeStatusIng = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) EmployeeStatusOld = []int{11, 12, 13, 14} //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) DockingKingdeeUrl = "http://36.134.44.40:18888" + MyContJwt = "mycontjwt" ) //全局配置 @@ -22,19 +23,20 @@ var ( //服务常量 CONSTANT_CONFIG configApp.Server // - CONSTANT_DB_Master *gorm.DB //主数据库 - CONSTANT_DB_Wechat *gorm.DB //微信数据库 - CONSTANT_DB_HR *gorm.DB //HR数据库 - CONSTANT_DB_FILE_BOOK *gorm.DB //文档属性数据库 - CONSTANT_DB_ERROR_SUBJECT *gorm.DB //错题库 - CONSTANT_DB_MY_TEST *gorm.DB //自我测验 - CONSTANT_DB_IMAGES_TEST *gorm.DB //图文信息数据库 - CONSTANT_DB_SCORING *gorm.DB //计分明细数据库 - CONSTANT_DB_QA *gorm.DB //趣味问答 - CONSTANT_DB_BILLBOARD *gorm.DB //风云榜统计数据库 - CONSTANT_DB_HEALTH *gorm.DB //健康上报数据库 - CONSTANT_DB_KPI *gorm.DB //绩效考核数据库 - CONSTANT_DB_WECHAT_LOG *gorm.DB //企业微信回调记录 + CONSTANT_DB_Master *gorm.DB //主数据库 + CONSTANT_DB_Wechat *gorm.DB //微信数据库 + CONSTANT_DB_HR *gorm.DB //HR数据库 + CONSTANT_DB_FILE_BOOK *gorm.DB //文档属性数据库 + CONSTANT_DB_ERROR_SUBJECT *gorm.DB //错题库 + CONSTANT_DB_MY_TEST *gorm.DB //自我测验 + CONSTANT_DB_IMAGES_TEST *gorm.DB //图文信息数据库 + CONSTANT_DB_SCORING *gorm.DB //计分明细数据库 + CONSTANT_DB_QA *gorm.DB //趣味问答 + CONSTANT_DB_BILLBOARD *gorm.DB //风云榜统计数据库 + CONSTANT_DB_HEALTH *gorm.DB //健康上报数据库 + CONSTANT_DB_KPI *gorm.DB //绩效考核数据库 + CONSTANT_DB_WECHAT_LOG *gorm.DB //企业微信回调记录 + CONSTANT_DB_MANAGE_ARCHIVES *gorm.DB //管理档案 //Redis CONSTANT_REDIS0 *redis.Client CONSTANT_REDIS1 *redis.Client diff --git a/overall/publicmethod/errorCode.go b/overall/publicmethod/errorCode.go new file mode 100644 index 0000000..c5efcf4 --- /dev/null +++ b/overall/publicmethod/errorCode.go @@ -0,0 +1,15 @@ +package publicmethod + +var ErrorCodeMsg = map[int]string{ + 0: "成功", + 1: "", + 100: "提交的数据格式错误!", + 101: "提交的数据不能为空!", + 103: "该数据已经存在!请不要重复添加", + 104: "数据写入失败!", + 105: "数据查询失败!", + 106: "编辑失败!", + 107: "未能查询到数据!", + 108: "删除失败", + 2000: "账户或密码错误!", +} diff --git a/overall/publicmethod/formatOutput.go b/overall/publicmethod/formatOutput.go new file mode 100644 index 0000000..2018f13 --- /dev/null +++ b/overall/publicmethod/formatOutput.go @@ -0,0 +1,66 @@ +package publicmethod + +import ( + "encoding/json" + "errors" + "fmt" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "net/http" + + "github.com/gin-gonic/gin" +) + +//格式化输出 +func Result(code int, data interface{}, c *gin.Context, msgAry ...string) { + var msg string + if _, isTrue := ErrorCodeMsg[code]; isTrue { + msg = ErrorCodeMsg[code] + } + if len(msgAry) > 0 { + for _, v := range msgAry { + msg = fmt.Sprintf("%v。%v", msg, v) + } + } + c.JSON(http.StatusOK, Reply{code, msg, data}) //输出json格式数据 +} + +//列表输出标准格式 +/* +@total 总数 +@count 当前页总数 +@page 页数 +@pageSize 每页显示数量 +@data 返回数据 +*/ +func ResultList(code, page, pageSize int, total, count int64, data interface{}, c *gin.Context) (printMap map[string]interface{}) { + outMap := MapOut[string]() + outMap["count"] = count + outMap["total"] = total + outMap["page"] = page + outMap["pageSize"] = pageSize + outMap["list"] = data + printMap = outMap + Result(code, outMap, c) + return +} + +//登录信息转换 +func LoginMyCont(c *gin.Context) (myCont models.ManCont, err error) { + context, exi := c.Get(overall.MyContJwt) + if exi != true { + err = errors.New("对不起!你没有该功能的操作权限!1") + return + } + jsonCont, jsonErr := json.Marshal(context) + if jsonErr != nil { + err = jsonErr + return + } + jsonUnErr := json.Unmarshal(jsonCont, &myCont) + if jsonUnErr != nil { + err = jsonUnErr + return + } + return +} diff --git a/overall/publicmethod/log.go b/overall/publicmethod/log.go new file mode 100644 index 0000000..a621da2 --- /dev/null +++ b/overall/publicmethod/log.go @@ -0,0 +1,71 @@ +package publicmethod + +import ( + "fmt" + "key_performance_indicators/overall" + "log" + "os" + "time" +) + +//日志相关操作 +//判断文件夹是否存在,不存在得话就创建 +/* +@path 日志文件夹 +*/ +func PathExists(path string) bool { + _, err := os.Stat(path) + // fmt.Printf("path----->%v\n", err) + if err == nil { + return true + } + if os.IsNotExist(err) { + mkdirErr := os.Mkdir(path, os.ModePerm) + if mkdirErr == nil { + return true + } else { + return false + } + } + return true +} + +//写日志 +func WriteLog(class string, errmsg ...any) { + // var ErrorLog *log.Logger + fileName := fmt.Sprintf("./%v/%v", overall.CONSTANT_CONFIG.Logsetup.Path, UnixTimeToDay(time.Now().Unix(), 21)) + // fmt.Printf("fileName--->%v\n", fileName) + if PathExists(fileName) != true { + return + } + logFilePath := fmt.Sprintf("%v/%v.log", fileName, UnixTimeToDay(time.Now().Unix(), 20)) + file, err := os.OpenFile(logFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0766) + if err != nil { + log.Fatalln("Failed to open error log file: ", err) + } + // fmt.Printf("logFilePath--->%v\n", logFilePath) + errLevel := "[Trace] " + switch class { + case "i": + errLevel = "[Info] " + case "w": + errLevel = "[Warning] " + case "e": + errLevel = "[Error] " + case "write": + errLevel = "[Write] " + case "add": + errLevel = "[Add] " + case "edit": + errLevel = "[Edit] " + case "del": + errLevel = "[Delete] " + default: + errLevel = "[Trace] " + } + + loger := log.New(file, errLevel, log.Ldate|log.Ltime) + loger.SetFlags(log.Ldate | log.Ltime) + loger.Println(errmsg) + return +} diff --git a/overall/publicmethod/technique.go b/overall/publicmethod/technique.go new file mode 100644 index 0000000..97336e5 --- /dev/null +++ b/overall/publicmethod/technique.go @@ -0,0 +1,488 @@ +package publicmethod + +import ( + "bytes" + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/hex" + "errors" + "fmt" + "key_performance_indicators/middleware/grocerystore" + "key_performance_indicators/models" + "key_performance_indicators/overall" + "math" + "math/big" + "reflect" + "strconv" + "time" + + "github.com/mozillazg/go-pinyin" + "gorm.io/gorm" +) + +//全局函数处理 +//编号,纯数字 +func TableNumber(class ...string) (number int64) { + result, _ := rand.Int(rand.Reader, big.NewInt(8999)) + numberTeam := result.Int64() + 1000 + numberStr := fmt.Sprintf("%v%v", time.Now().Unix(), numberTeam) + if len(class) > 0 { + resultLong, _ := rand.Int(rand.Reader, big.NewInt(8999999)) + numberTeamLong := resultLong.Int64() + 1000000 + numberStr = fmt.Sprintf("%v%v", time.Now().Unix(), numberTeamLong) + } + number, _ = strconv.ParseInt(numberStr, 10, 64) + return +} + +//初始化map(泛型) +func MapOut[T GenericityVariable]() (data map[T]interface{}) { + data = make(map[T]interface{}) //必可不少,分配内存 + return data +} + +//时间搓转换成日期 +/* +@timestamp 待转换的时间戳 +@timeType 转换类型 +*/ +func UnixTimeToDay(timeStamp int64, timeType int) (dateStr string) { + timeTemplate := "2006-01-02 15:04:05" //常规类型 + switch timeType { + case 1: + timeTemplate = "2006/01/02 15:04:05" + case 2: + timeTemplate = "2006/01/02 15:04" + case 3: + timeTemplate = "2006/01/02 15" + case 4: + timeTemplate = "2006/01/02" + case 5: + timeTemplate = "15:04:05" + case 6: + timeTemplate = "15:04" + case 7: + timeTemplate = "15" + case 8: + timeTemplate = "04:05" + case 9: + timeTemplate = "04" + case 10: + timeTemplate = "05" + case 11: + timeTemplate = "2006-01-02 15:04:05" + case 12: + timeTemplate = "2006-01-02 15:04" + case 13: + timeTemplate = "2006-01-02 15" + case 14: + timeTemplate = "2006-01-02" + case 15: + timeTemplate = "2006-01" //年月 + case 16: + timeTemplate = "2006" //年 + case 17: + timeTemplate = "01" //月 + case 18: + timeTemplate = "02" //日 + case 19: //季度 + dayMonth := time.Unix(timeStamp, 0).Format("01") + datMonthFloat, datMonthFloatErr := strconv.ParseFloat(dayMonth, 10) + if datMonthFloatErr == nil { + dateStr = strconv.FormatFloat(math.Ceil(datMonthFloat/3), 'f', -1, 64) + } + dateStr = "1" + case 20: + timeTemplate = "20060102" + case 21: + timeTemplate = "200601" + default: + timeTemplate = "2006-01-02 15:04:05" //常规类型 + } + dateStr = time.Unix(timeStamp, 0).Format(timeTemplate) + return +} + +/* +日期转时间戳 +*/ +func DateToTimeStamp(dataStr string) (timeStamp int64, isTrue bool) { + isTrue = false + tmp := "2006-01-02 15:04:05" + res, err := time.ParseInLocation(tmp, dataStr, time.Local) + timeStamp = res.Unix() + if err == nil { + isTrue = true + } + return +} + +//数据库查询翻页 +func LimitPage(page, pageSize int) (offSet int) { + if page < 1 { + page = 1 + } + offSet = pageSize * (page - 1) + if offSet < 0 { + offSet = 0 + } + return +} + +//中文首字母大写 +func ChineseFirstWordCapitalize(wordStr string) (firstWord string) { + pinYinSub := pinyin.NewArgs() + rows := pinyin.Pinyin(wordStr, pinYinSub) + for i := 0; i < len(rows); i++ { + if len(rows[i]) != 0 { + str := rows[i][0] + pi := str[0:1] + firstWord += string(bytes.ToUpper([]byte(pi))) + } + } + return +} + +// ZeroFillByStr +// @Description: 字符串补零 +// @param str :需要操作的字符串 +// @param resultLen 结果字符串的长度 +// @param reverse true 为前置补零,false 为后置补零 +// @return string +// +func ZeroFillByStr(str string, resultLen int, reverse bool) string { + if len(str) > resultLen || resultLen <= 0 { + return str + } + if reverse { + return fmt.Sprintf("%0*s", resultLen, str) //不足前置补零 + } + result := str + for i := 0; i < resultLen-len(str); i++ { + result += "0" + } + return result +} + +/* +*加密算法 + */ +type Md5Encryption struct { + Code string `json:"code"` + AppKey string `json:"appKey"` +} + +func (m *Md5Encryption) Md5EncryptionAlgorithm() (md5Val string) { + if m.AppKey == "" { + m.Md5EncryptionInit(m.Code) + } + // fmt.Printf("Code ====> %v\n", m.Code) + // fmt.Printf("AppKey ====> %v\n", m.AppKey) + + mdNew := md5.New() + mdNew.Write([]byte(m.AppKey)) + keyMd5 := fmt.Sprintf("%x", mdNew.Sum(nil)) + + // fmt.Printf("Step1:--AppKey-加密->%v\n", keyMd5) + + codeNewMd1 := md5.New() + codeNewMd1.Write([]byte(m.Code)) + codeMd1 := fmt.Sprintf("%x", codeNewMd1.Sum(nil)) + + // fmt.Printf("Step2:--CodeString-加密->%v\n", codeMd1) + + yiCeng := codeMd1 + keyMd5 + + // fmt.Printf("Step3:--CodeString+AppKey-->%v\n", yiCeng) + + yiCengNew := md5.New() + yiCengNew.Write([]byte(yiCeng)) + yiCengMd5 := fmt.Sprintf("%x", yiCengNew.Sum(nil)) + + // fmt.Printf("Step4:--one-加密->%v\n", yiCengMd5) + + erCeng := yiCengMd5 + m.AppKey + + // fmt.Printf("Step5:--one + AppKey->%v\n", erCeng) + + // fmt.Printf("AppKey ===2=> %v\n", m.AppKey) + + erCengNew := md5.New() + erCengNew.Write([]byte(erCeng)) + md5Val = fmt.Sprintf("%x", erCengNew.Sum(nil)) + + // fmt.Printf("Step6:--therr--加密-->%v\n", md5Val) + + // md5Val = codeMd1 + return +} + +func (m *Md5Encryption) Md5EncryptionAlgorithmFj() (md5Val string, outlog []string) { + if m.AppKey == "" { + m.Md5EncryptionInit(m.Code) + } + // fmt.Printf("Code ====> %v\n", m.Code) + // fmt.Printf("AppKey ====> %v\n", m.AppKey) + + outlog = append(outlog, fmt.Sprintf("Code ====> %v", m.Code)) + outlog = append(outlog, fmt.Sprintf("AppKey ====> %v", m.AppKey)) + + mdNew := md5.New() + mdNew.Write([]byte(m.AppKey)) + keyMd5 := fmt.Sprintf("%x", mdNew.Sum(nil)) + + // fmt.Printf("Step1:--AppKey-加密->%v\n", keyMd5) + outlog = append(outlog, fmt.Sprintf("Step1:--AppKey-加密->%v", keyMd5)) + + codeNewMd1 := md5.New() + codeNewMd1.Write([]byte(m.Code)) + codeMd1 := fmt.Sprintf("%x", codeNewMd1.Sum(nil)) + + // fmt.Printf("Step2:--CodeString-加密->%v\n", codeMd1) + outlog = append(outlog, fmt.Sprintf("Step2:--CodeString-加密->%v", codeMd1)) + + yiCeng := codeMd1 + keyMd5 + + // fmt.Printf("Step3:--CodeString+AppKey-->%v\n", yiCeng) + outlog = append(outlog, fmt.Sprintf("Step3:--CodeString+AppKey-->%v", yiCeng)) + + yiCengNew := md5.New() + yiCengNew.Write([]byte(yiCeng)) + yiCengMd5 := fmt.Sprintf("%x", yiCengNew.Sum(nil)) + + // fmt.Printf("Step4:--one-加密->%v\n", yiCengMd5) + outlog = append(outlog, fmt.Sprintf("Step4:--one-加密->%v", yiCengMd5)) + + erCeng := yiCengMd5 + m.AppKey + + // fmt.Printf("Step5:--one + AppKey->%v\n", erCeng) + outlog = append(outlog, fmt.Sprintf("Step5:--one + AppKey->%v", erCeng)) + + // fmt.Printf("AppKey ===2=> %v\n", m.AppKey) + + erCengNew := md5.New() + erCengNew.Write([]byte(erCeng)) + md5Val = fmt.Sprintf("%x", erCengNew.Sum(nil)) + + // fmt.Printf("Step6:--therr--加密-->%v\n", md5Val) + outlog = append(outlog, fmt.Sprintf("Step6:--therr--加密-->%v", md5Val)) + + // md5Val = codeMd1 + return +} + +//初始化程序 +func (m *Md5Encryption) Md5EncryptionInit(code string) { + m.AppKey = overall.CONSTANT_CONFIG.Appsetup.AppKey + m.Code = code +} + +//sha1算法 +func Sha1Encryption(str string) string { + sha1 := sha1.New() + sha1.Write([]byte(str)) + return hex.EncodeToString(sha1.Sum(nil)) +} + +//计算当前时间N个月后的时间 +/* +@timeStamp 当前时间戳 +@futureTime 正数多少时间后,负数多少时间前 +*/ +func GetFutureMonthTime(timeStamp int64, futureTime, class int) (dateStr int64) { + timeUnix := time.Unix(timeStamp, 0) + addDate := timeUnix.AddDate(0, 0, futureTime) + switch class { + case 2: + addDate = timeUnix.AddDate(0, futureTime, 0) + case 3: + addDate = timeUnix.AddDate(futureTime, 0, 0) + default: + addDate = timeUnix.AddDate(0, 0, futureTime) + } + + dateStr = addDate.Unix() + return +} + +//判断字符串是否在切片中 泛型 +func IsInTrue[T GenericityVariable](key T, keyAry []T) (isTrue bool) { + isTrue = false + for _, v := range keyAry { + if v == key { + return true + } + } + return +} + +//获取两个切片得差集 +func DifferenceSet[T GenericityVariable](one, two []T) []T { + var three []T + temp := map[T]struct{}{} + for _, val := range two { + if _, ok := temp[val]; !ok { + temp[val] = struct{}{} + } + } + for _, val := range one { + if _, ok := temp[val]; !ok { + three = append(three, val) + } + } + return three +} + +//判断类型转换成 +/* +字符转int +*/ +func StringToInt(val interface{}) (int, error) { + switch val.(type) { + case string: + return strconv.Atoi(val.(string)) + case int: + return val.(int), nil + default: + return 0, nil + } + return 0, nil +} + +/* +字符转int64 +*/ +func StringToInt64(val interface{}) (int64, error) { + switch val.(type) { + case string: + return strconv.ParseInt(val.(string), 10, 64) + case int: + return int64(val.(int)), nil + case int64: + return val.(int64), nil + default: + return 0, nil + } + return 0, nil +} + +//获取人员TokenRedis 信息 +func GetUserRedisToken(number string) (manCont models.ManCont, err error) { + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, number) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + useMap, isTrue := redisClient.HashGetAll(redisMyContKey) + if isTrue == false { + err.Error() + return + } + // fmt.Printf("%v\n", useMap) + err = MapToStruct(useMap, &manCont, "json") + return +} + +//获取人员Redis信息 +func GetUserRedisCont(number string) (manCont models.ManCont, err error) { + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, number) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + useMap, isTrue := redisClient.HashGetAll(redisMyContKey) + if isTrue == false { + err.Error() + return + } + // fmt.Printf("%v\n", useMap) + // var manInfo models.ManCont + err = MapToStruct(useMap, &manCont, "json") + // manCont = manInfo + return +} + +//获取人员Redis信息返回指针 +func GetUserRedisContPointer(number string) (manCont models.ManCont, err error) { + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, number) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + useMap, isTrue := redisClient.HashGetAll(redisMyContKey) + if isTrue == false { + err.Error() + return + } + // fmt.Printf("%v\n", useMap) + // var manInfo models.ManCont + err = MapToStruct(useMap, &manCont, "json") + // manCont = manInfo + return +} + +/* +map[string]string 转 struct +*/ +func MapToStruct(mapString map[string]string, structInterface interface{}, tag string) (err error) { + strType := reflect.TypeOf(structInterface) + strValue := reflect.ValueOf(structInterface) + switch strType.Kind() { + case reflect.Ptr: + if strType.Elem().Kind() != reflect.Struct { + // fmt.Printf("1-->%v\n", strType.Elem().Kind().String()) + return errors.New("需要*struct类型,却传入*" + strType.Elem().Kind().String() + "类型") + } + default: + // fmt.Printf("2-->%v\n", strType.Kind().String()) + return errors.New("需要*struct类型,却传入" + strType.Kind().String() + "类型") + } + // fmt.Printf("strType--->%v---strValue---->%v\n", strType, strValue) + strTypeElem := strType.Elem() + strValueElem := strValue.Elem() + strTypeNum := strTypeElem.NumField() + // fmt.Printf("strTypeElem--->%v---strValueElem---->%v---------strTypeNum--------->%v\n", strTypeElem, strValueElem, strTypeNum) + for i := 0; i < strTypeNum; i++ { + fieldName := strTypeElem.Field(i).Name + if tag != "" { + fieldName = strTypeElem.Field(i).Tag.Get(tag) + } + value, ok := mapString[fieldName] + if !ok { + continue + } + // fmt.Printf("name--->%v---tag---->%v----value---->%v----ok---->%v\n", fieldName, tag, value, ok) + if strValueElem.Field(i).CanSet() { + // fmt.Printf("Type--->%v---value---->%v\n", strValueElem.Field(i).Type(), reflect.TypeOf(value)) + valType := fmt.Sprintf("%v", strValueElem.Field(i).Type()) + switch valType { + case "int": + valueInt, _ := strconv.Atoi(value) + strValueElem.Field(i).Set(reflect.ValueOf(valueInt)) + case "int32": + valueInt32, _ := strconv.ParseInt(value, 10, 32) + strValueElem.Field(i).Set(reflect.ValueOf(int32(valueInt32))) + case "int64": + valueInt64, _ := strconv.ParseInt(value, 10, 64) + strValueElem.Field(i).Set(reflect.ValueOf(valueInt64)) + case "float32": + valuefloat32, _ := strconv.ParseFloat(value, 32) + strValueElem.Field(i).Set(reflect.ValueOf(float32(valuefloat32))) + case "float64": + valuefloat64, _ := strconv.ParseFloat(value, 64) + strValueElem.Field(i).Set(reflect.ValueOf(valuefloat64)) + case "string": + strValueElem.Field(i).Set(reflect.ValueOf(value)) + default: + + } + } else { + continue + } + } + return +} + +//翻页设置 +func PageTurningSettings(gormDb *gorm.DB, page, pageSize int) *gorm.DB { + if page < 0 { + page = 1 + } + if pageSize < 0 { + pageSize = 10 + } + gormDb = gormDb.Limit(pageSize).Offset(LimitPage(page, pageSize)) + return gormDb +} diff --git a/overall/publicmethod/type.go b/overall/publicmethod/type.go new file mode 100644 index 0000000..962375a --- /dev/null +++ b/overall/publicmethod/type.go @@ -0,0 +1,46 @@ +package publicmethod + +//泛型基础变量类型 +type GenericityVariable interface { + int | int8 | int16 | int32 | int64 | float32 | float64 | string +} + +//格式化输出 +type Reply struct { + Code int `json:"code"` + Msg string `json:"msg"` + Data interface{} `json:"data"` +} + +//翻页信息 +type PagesTurn struct { + Page int `json:"page"` + PageSize int `json:"pagesize"` +} + +//通用ID结构体 +type PublicId struct { + Id string `json:"id"` +} + +//通用编辑状态结构体 +type PublicState struct { + PublicId + State int `json:"state"` + IsTrue int `json:"istrue"` //1:强制删除;非1:软删除 +} + +//通用图片结构体列表 +type PubilcImageList struct { + Id string `json:"id"` + Url string `json:"url"` //图片地址 + Name string `json:"name"` //文档名称 + FileSize string `json:"filesize"` //文档大小 +} + +//通用图片结构体内容 +type PubilcImageCont struct { + PubilcImageList + Imgpath string `json:"imgpath"` //物理地址 + AscriptionId string `json:"ascriptionid"` //归属 +}