/** * @Author: zou.yingbin * @Create : 2021/3/30 14:51 * @Modify : 2021/3/30 14:51 * @Note : Ermcp定义一些公共的方法或变量 */ package models import ( "encoding/hex" "mtp2_if/utils" ) // IErmcp 通用接口 type IErmcp interface { calc() // 相关计算和数据处理 buildSql() string // 生成sql语句 GetDataEx() (interface{}, error) // 获取数据接口 } // DecryptField 解密字段 func DecryptField(oriStr string) string { key := "0d299ce2d4105282f7471074cb0f9f9d" key2, _ := hex.DecodeString(key) if oriStr == "" { return oriStr } d, _ := hex.DecodeString(oriStr) if dst, err := utils.AESDecrypt(d, key2); err == nil { return string(dst) } return oriStr }