package workWechat import ( "hr_server/middleware/wxbizjsonmsgcrypt" "hr_server/middleware/wxbizmsgcrypt" "hr_server/overall" ) /* * @ 作者: 秦东 @ 时间: 2024-01-26 08:52:18 @ 功能: 企业微信加解密-json @ 参数 #token 应用Token #encodingAesKey 应用Encodingaeskey @ 返回值 #wxcpt 初始化加解密类 @ 方法原型 # */ func WechatDecryptJson(systemApp string) (wxcpt *wxbizjsonmsgcrypt.WXBizMsgCrypt) { var token string var encodingAesKey string switch systemApp { case "kpi": token = overall.CONSTANT_CONFIG.WechatKpi.Token encodingAesKey = overall.CONSTANT_CONFIG.WechatKpi.Encodingaeskey case "school": token = overall.CONSTANT_CONFIG.WechatSchool.Token encodingAesKey = overall.CONSTANT_CONFIG.WechatSchool.Encodingaeskey case "hr": token = overall.CONSTANT_CONFIG.EmployeeFile.Token encodingAesKey = overall.CONSTANT_CONFIG.EmployeeFile.Encodingaeskey case "txl": token = overall.CONSTANT_CONFIG.AddressBook.Token encodingAesKey = overall.CONSTANT_CONFIG.AddressBook.Encodingaeskey default: token = overall.CONSTANT_CONFIG.WechatSchool.Token encodingAesKey = overall.CONSTANT_CONFIG.WechatSchool.Encodingaeskey } wxcpt = wxbizjsonmsgcrypt.NewWXBizMsgCrypt(token, encodingAesKey, overall.CONSTANT_CONFIG.WechatCompany.CompanyId, wxbizjsonmsgcrypt.JsonType) return } /* * @ 作者: 秦东 @ 时间: 2024-01-26 09:09:14 @ 功能: 企业微信加解密-XML @ 参数 #token 应用Token #encodingAesKey 应用Encodingaeskey @ 返回值 #wxcpt 初始化加解密类 @ 方法原型 # */ func WechatDecryptXml(systemApp string) (wxcpt *wxbizmsgcrypt.WXBizMsgCrypt) { var token string var encodingAesKey string switch systemApp { case "kpi": token = overall.CONSTANT_CONFIG.WechatKpi.Token encodingAesKey = overall.CONSTANT_CONFIG.WechatKpi.Encodingaeskey case "school": token = overall.CONSTANT_CONFIG.WechatSchool.Token encodingAesKey = overall.CONSTANT_CONFIG.WechatSchool.Encodingaeskey case "hr": token = overall.CONSTANT_CONFIG.EmployeeFile.Token encodingAesKey = overall.CONSTANT_CONFIG.EmployeeFile.Encodingaeskey case "txl": token = overall.CONSTANT_CONFIG.AddressBook.Token encodingAesKey = overall.CONSTANT_CONFIG.AddressBook.Encodingaeskey default: token = overall.CONSTANT_CONFIG.WechatSchool.Token encodingAesKey = overall.CONSTANT_CONFIG.WechatSchool.Encodingaeskey } wxcpt = wxbizmsgcrypt.NewWXBizMsgCrypt(token, encodingAesKey, overall.CONSTANT_CONFIG.WechatCompany.CompanyId, wxbizmsgcrypt.XmlType) return }