by Robin at 20240615

This commit is contained in:
Leufolium 2024-06-15 13:41:03 +08:00
parent f73dd1cff7
commit 400cda2cc3
22 changed files with 437 additions and 8 deletions

View File

@ -247,3 +247,9 @@ const (
IsCreatingPaidText_No = 0 //否
IsCreatingPaidText_Yes = 1 //是
)
const (
HygAgreeState_Fail = "-1" // 签约失败
HygAgreeState_Waiting = "1" // 待生成电子签
HygAgreeState_Success = "2" // 签约成功
)

View File

@ -211,6 +211,9 @@ var ErrCodeMsgMap = map[ErrCode]string{
ErrCodeDailyStatementZoneInfoSrvFail: "空间相关每日报表服务错误",
ErrCodeDailyStatementZoneInfoNotExist: "空间相关每日报表不存在",
ErrCodeWorkerIdSrvFail: "用户职业者id映射表服务错误",
ErrCodeWorkerIdNotExist: "用户职业者id映射表不存在",
}
const (
@ -505,6 +508,11 @@ const (
ErrCodeDailyStatementZoneInfoSrvFail ErrCode = -40001 // 空间相关每日报表服务错误
ErrCodeDailyStatementZoneInfoNotExist ErrCode = -40002 // 空间相关每日报表不存在
// WorkerId: 41xxx
ErrCodeWorkerIdSrvOk ErrCode = ErrCodeOk
ErrCodeWorkerIdSrvFail ErrCode = -41001 // 用户职业者id映射表服务错误
ErrCodeWorkerIdNotExist ErrCode = -41002 // 用户职业者id映射表不存在
// Media: 60xxx
ErrCodeMediaSrvOk ErrCode = ErrCodeOk
ErrCodeMediaSrvFail ErrCode = -60001 // 媒体服务错误

View File

@ -0,0 +1,6 @@
package proto
type HvyogoCallbackReq struct {
CooperatorId string `json:"cooperatorId"` // 商户对接唯一标识,手机号
BusinessBody string `json:"businessBody" jcrypto:"hyg_aes"` // AES加密后的字符串
}

View File

@ -0,0 +1,8 @@
package proto
type HvyogoVO struct {
WorkerId string `json:"workerId"` // 职业者id
AgreeState string `json:"agreeState"` // 签约状态
AgreeDesc string `json:"agreeDesc"` // 签约状态描述
WorkerMobile string `json:"workerMobile"` // 自由职业者手机号
}

View File

@ -0,0 +1,65 @@
package proto
import (
"service/api/base"
"service/dbstruct"
)
// op 创建
type OpCreateReq struct {
base.BaseRequest
*dbstruct.WorkerId
}
type OpCreateData struct {
}
type OpCreateResp struct {
base.BaseResponse
Data *OpCreateData `json:"data"`
}
// op 删除
type OpDeleteReq struct {
base.BaseRequest
Id int64 `json:"id"`
}
type OpDeleteData struct {
}
type OpDeleteResp struct {
base.BaseResponse
Data *OpDeleteData `json:"data"`
}
// op 更新
type OpUpdateReq struct {
base.BaseRequest
*dbstruct.WorkerId
}
type OpUpdateData struct {
}
type OpUpdateResp struct {
base.BaseResponse
Data *OpUpdateData `json:"data"`
}
// op 列表
type OpListByMidReq struct {
base.BaseRequest
Mid int64 `json:"mid"`
}
type OpListByMidData struct {
WorkerId *dbstruct.WorkerId `json:"worker_id"`
Offset int `json:"offset"`
More int `json:"more"`
}
type OpListByMidResp struct {
base.BaseResponse
Data *OpListByMidData `json:"data"`
}

View File

@ -0,0 +1,27 @@
package controller
import (
"service/api/errcode"
"service/api/message/response"
hvyogoproto "service/api/proto/hvyogo/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func HvyogoCallback(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*hvyogoproto.HvyogoCallbackReq)
// 存入数据
ec := service.DefaultService.SaveHvyogoCallback(ctx, req)
if ec != errcode.ErrCodeWorkerIdSrvOk {
logger.Error("SaveHvyogoCallback fail, req: %v, ec: %v", util.ToJson(req), ec)
response.ReplyErrCodeMsg(ctx, ec)
return
}
response.ReplyOk(ctx, nil)
}

View File

@ -31,6 +31,7 @@ import (
daily_statement_zone_info_proto "service/api/proto/daily_statement_zone_info/proto"
feedbackproto "service/api/proto/feedback/proto"
footprintproto "service/api/proto/footprint/proto"
hvyogoproto "service/api/proto/hvyogo/proto"
loginproto "service/api/proto/login/proto"
momentproto "service/api/proto/moment/proto"
moment_audit_taskproto "service/api/proto/moment_audit_task/proto"
@ -306,6 +307,9 @@ func Init(r *gin.Engine) {
opVasPayGroup.POST("zone_refund_list", middleware.JSONParamValidator(zoneproto.OpZoneRefundListParam{}), OpZoneRefundList)
opVasPayGroup.POST("manual_unlock_wechat", middleware.JSONParamValidator(zoneproto.OpManualUnlockWechatParam{}), OpManualUnlockWechat)
extEsbGroup := r.Group("/ext/hvyogo")
extEsbGroup.POST("agree_callback", middleware.FORMParamValidator(hvyogoproto.HvyogoCallbackReq{}), middleware.RequestDecryptor(), HvyogoCallback)
// 验证码
opVeriCodeGroup := r.Group("/op/veri_code", PrepareOp())
opVeriCodeGroup.POST("send", middleware.JSONParamValidator(vericodeproto.OpSendReq{}), middleware.RequestDecryptor(), OpSendVeriCode)

View File

@ -42,6 +42,7 @@ import (
userwxaddcheckproto "service/api/proto/userwxaddcheck/proto"
vericodeproto "service/api/proto/vericode/proto"
video_moderation_task_proto "service/api/proto/video_moderation_task/proto"
workeridproto "service/api/proto/worker_id/proto"
zoneproto "service/api/proto/zone/proto"
zone_collaborator_proto "service/api/proto/zone_collaborator/proto"
zone_third_partner_proto "service/api/proto/zone_third_partner/proto"
@ -213,6 +214,9 @@ const (
DBStreamerScore = "streamer_score"
COLStreamerScore = "streamer_score"
DBWorkerId = "worker_id"
COLWorkerId = "worker_id"
)
// 商品表
@ -539,6 +543,11 @@ func (m *Mongo) getColStreamerScore() *qmgo.Collection {
return m.clientMix.Database(DBStreamerScore).Collection(COLStreamerScore)
}
// 用户职业者id映射表表
func (m *Mongo) getColWorkerId() *qmgo.Collection {
return m.clientMix.Database(DBWorkerId).Collection(COLWorkerId)
}
// 商品相关
func (m *Mongo) CreateProduct(ctx *gin.Context, product *dbstruct.Product) error {
col := m.getColProduct()
@ -5217,3 +5226,47 @@ func (m *Mongo) SetStreamerScore(ctx *gin.Context, list []*dbstruct.StreamerScor
}
return err
}
// 用户职业者id映射表相关
func (m *Mongo) CreateWorkerId(ctx *gin.Context, worker_id *dbstruct.WorkerId) error {
col := m.getColWorkerId()
_, err := col.InsertOne(ctx, worker_id)
return err
}
func (m *Mongo) UpdateWorkerId(ctx *gin.Context, worker_id *dbstruct.WorkerId) error {
col := m.getColWorkerId()
set := util.EntityToM(worker_id)
set["ut"] = time.Now().Unix()
up := qmgo.M{
"$set": set,
}
err := col.UpdateId(ctx, worker_id.Id, up)
return err
}
func (m *Mongo) DeleteWorkerId(ctx *gin.Context, id int64) error {
col := m.getColWorkerId()
update := qmgo.M{
"$set": qmgo.M{
"del_flag": 1,
},
}
err := col.UpdateId(ctx, id, update)
return err
}
func (m *Mongo) GetWorkerIdByMid(ctx *gin.Context, req *workeridproto.OpListByMidReq) (*dbstruct.WorkerId, error) {
workerId := &dbstruct.WorkerId{}
col := m.getColWorkerId()
query := qmgo.M{
"mid": req.Mid,
"del_flag": 0,
}
err := col.Find(ctx, query).One(workerId)
if err == qmgo.ErrNoSuchDocuments {
err = nil
return nil, err
}
return workerId, err
}

View File

@ -0,0 +1,65 @@
package logic
import (
"service/api/consts"
worker_idproto "service/api/proto/worker_id/proto"
"service/app/mix/dao"
"service/dbstruct"
"service/library/idgenerator"
"service/library/logger"
"time"
"github.com/gin-gonic/gin"
goproto "google.golang.org/protobuf/proto"
)
type WorkerId struct {
store *dao.Store
}
func NewWorkerId(store *dao.Store) (a *WorkerId) {
a = &WorkerId{
store: store,
}
return
}
func (p *WorkerId) OpCreate(ctx *gin.Context, req *worker_idproto.OpCreateReq) error {
req.WorkerId.Id = goproto.Int64(idgenerator.GenWorkerIdId())
req.WorkerId.Ct = goproto.Int64(time.Now().Unix())
req.WorkerId.Ut = goproto.Int64(time.Now().Unix())
req.WorkerId.DelFlag = goproto.Int64(consts.Exist)
err := p.store.CreateWorkerId(ctx, req.WorkerId)
if err != nil {
logger.Error("CreateWorkerId fail, err: %v", err)
return err
}
return nil
}
func (p *WorkerId) OpUpdate(ctx *gin.Context, req *worker_idproto.OpUpdateReq) error {
err := p.store.UpdateWorkerId(ctx, req.WorkerId)
if err != nil {
logger.Error("UpdateWorkerId fail, err: %v", err)
return err
}
return nil
}
func (p *WorkerId) OpDelete(ctx *gin.Context, id int64) error {
err := p.store.DeleteWorkerId(ctx, id)
if err != nil {
logger.Error("DeleteWorkerId fail, err: %v", err)
return err
}
return nil
}
func (p *WorkerId) OpListByMid(ctx *gin.Context, req *worker_idproto.OpListByMidReq) (*dbstruct.WorkerId, error) {
workerId, err := p.store.GetWorkerIdByMid(ctx, req)
if err != nil {
logger.Error("GetWorkerIdList fail, err: %v", err)
return nil, err
}
return workerId, nil
}

View File

@ -2,6 +2,7 @@ package service
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"service/api/base"
@ -21,6 +22,7 @@ import (
daily_statement_zone_info_proto "service/api/proto/daily_statement_zone_info/proto"
feedbackproto "service/api/proto/feedback/proto"
footprintproto "service/api/proto/footprint/proto"
hvyogoproto "service/api/proto/hvyogo/proto"
imageaudittaskproto "service/api/proto/imageaudittask/proto"
loginproto "service/api/proto/login/proto"
mediaproto "service/api/proto/media/proto"
@ -39,6 +41,7 @@ import (
userwxaddcheckproto "service/api/proto/userwxaddcheck/proto"
vasproto "service/api/proto/vas/proto"
vericodeproto "service/api/proto/vericode/proto"
workeridproto "service/api/proto/worker_id/proto"
zoneproto "service/api/proto/zone/proto"
zone_collaborator_proto "service/api/proto/zone_collaborator/proto"
zone_third_partner_proto "service/api/proto/zone_third_partner/proto"
@ -131,6 +134,7 @@ var (
_DefaultStreamerAcct *logic.StreamerAcct
_DefaultContentAuditRTI *logic.ContentAuditRTI
_DefaultStreamerScore *logic.StreamerScore
_DefaultWorkerId *logic.WorkerId
)
type Service struct {
@ -222,6 +226,7 @@ func (s *Service) Init(c any) (err error) {
_DefaultDailyStatementZoneInfo = logic.NewDailyStatementZoneInfo(store)
_DefaultContentAuditRTI = logic.NewContentAuditRTI(store)
_DefaultStreamerScore = logic.NewStreamerScore(store)
_DefaultWorkerId = logic.NewWorkerId(store)
_DefaultVas = logic.NewVas(store, _DefaultStreamer, _DefaultAccount, _DefaultZone, _DefaultZoneThirdPartner, _DefaultZoneCollaborator)
_DefaultStreamerAcct = logic.NewStreamerAcct(store)
@ -4058,3 +4063,98 @@ func (s *Service) OpGetDailyStatementZoneInfoList(ctx *gin.Context, req *daily_s
return
}
// WorkerId
func (s *Service) OpCreateWorkerId(ctx *gin.Context, req *workeridproto.OpCreateReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeWorkerIdSrvOk
err := _DefaultWorkerId.OpCreate(ctx, req)
if err != nil {
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeWorkerIdSrvFail
return
}
return
}
func (s *Service) OpUpdateWorkerId(ctx *gin.Context, req *workeridproto.OpUpdateReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeWorkerIdSrvOk
err := _DefaultWorkerId.OpUpdate(ctx, req)
if err == qmgo.ErrNoSuchDocuments {
ec = errcode.ErrCodeWorkerIdNotExist
err = nil
return
}
if err != nil {
logger.Error("OpUpdate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeWorkerIdSrvFail
return
}
return
}
func (s *Service) OpDeleteWorkerId(ctx *gin.Context, id int64) (ec errcode.ErrCode) {
ec = errcode.ErrCodeWorkerIdSrvOk
err := _DefaultWorkerId.OpDelete(ctx, id)
if err != nil {
logger.Error("OpDelete fail, id: %v, err: %v", id, err)
ec = errcode.ErrCodeWorkerIdSrvFail
return
}
return
}
func (s *Service) OpGetWorkerIdByMid(ctx *gin.Context, req *workeridproto.OpListByMidReq) (workerId *dbstruct.WorkerId, ec errcode.ErrCode) {
ec = errcode.ErrCodeWorkerIdSrvOk
workerId, err := _DefaultWorkerId.OpListByMid(ctx, req)
if err != nil {
logger.Error("OpGetWorkerIdByMid fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeWorkerIdSrvFail
return
}
return
}
func (s *Service) SaveHvyogoCallback(ctx *gin.Context, req *hvyogoproto.HvyogoCallbackReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeWorkerIdSrvOk
// 解析BusinessBody
vo := &hvyogoproto.HvyogoVO{}
if err := json.Unmarshal([]byte(req.BusinessBody), vo); err != nil {
logger.Error("Unmarshal fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeAssertionFail
return
}
if vo.AgreeState != consts.HygAgreeState_Success {
return
}
// 从手机号查找mid
phonehash := mycrypto.CryptoServiceInstance().SHA256.Encrypt([]byte(req.CooperatorId))
list, err := _DefaultAccount.OpListByPhoneHash(ctx, phonehash)
if err != nil {
logger.Error("OpListByPhoneHash fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeAccountSrvFail
return
}
if len(list) == 0 {
logger.Error("No account entity was found, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeAccountNotExist
return
}
// 存入数据
err = _DefaultWorkerId.OpCreate(ctx, &workeridproto.OpCreateReq{
WorkerId: &dbstruct.WorkerId{
Mid: list[0].Mid,
WorkerId: goproto.String(vo.WorkerId),
},
})
if err != nil {
logger.Error("_DefaultWorkerId OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeWorkerIdSrvFail
return
}
return
}

View File

@ -9,10 +9,10 @@ import (
func main() {
genSource := &generator.GenSource{
EntityName: "DailyStatementZoneInfo",
ModuleName: "daily_statement_zone_info",
EntityCNName: "空间相关每日报表",
ErrCodeSeq: "40",
EntityName: "WorkerId",
ModuleName: "worker_id",
EntityCNName: "用户职业者id映射表",
ErrCodeSeq: "41",
}
generator.CreateFileDirectory(genSource)

11
dbstruct/worker_id.go Normal file
View File

@ -0,0 +1,11 @@
package dbstruct
type WorkerId struct {
Id *int64 `json:"id" bson:"_id"` // 慧用工职业者id表id
Mid *int64 `json:"mid" bson:"mid"` // 用户id
WorkerId *string `json:"worker_id" bson:"worker_id"` // 职业者id
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
}

View File

@ -55,6 +55,11 @@ crypto:
private_key: ""
sha256:
salts: "23XSka ZsMTz3 xdnKtT mx229Z aJ3VS7 ett3nV YDEgFB lBm57J 92hgkJ B0u9VF keyNK3 cB16Tm 63r1mX IUs471 ytbW7o ic8Pxw"
hyg_aes:
private_key: "Xbz1145141919810"
hyg_rsa:
private_key: "MIIBOgIBAAJBAMXPIjKV6CMi5O9tIXJWNIfnqXjqOZ1KmRByRAP073DU+gzMLygzEsrztJzbz/K/Julkz6XhheZ8vdz+boAl1HsCAwEAAQJAD5PNRKCLhGDWGIjGjoN9ZYp3zR7c5KcgQKxO8OTUClWHxXWAHSO8WEMDUjYTB9xhTbzyyjfOV7GJf2YFRgQUYQIhANEFkyp7xKLIq284zmvJ+YAqMMqc5Wxkz/0Kv77PERfxAiEA8kRrSX2QcObiQkE2Jxn4VlW8M+bHZMdfabjSkYgKvysCIHGYhweCpjYVut3CUKTR6q/VvhiPNjw3ebW6vsSTQmXxAiBBe4DMQmYyPhXV9q5eb0SSgWX3WV93u/PsLYqsz2qoNQIhAKiqbRvYMzfg+OTBKuuGu3m+QLav4TjYVSSPD8VVf7/z"
alipay:
appid: "2021004115647165"

View File

@ -74,10 +74,12 @@ type WxpayClientConfig struct {
// 账号相关验密配置
type CryptoConfig struct {
*AESConfig `json:"aes" yaml:"aes"` //AES
*RSAConfig `json:"rsa" yaml:"rsa"` //RSA
*TokenConfig `json:"token" yaml:"token"` //token签名
*SHA256Config `json:"sha256" yaml:"sha256"` //SHA256
*AESConfig `json:"aes" yaml:"aes"` // AES
*RSAConfig `json:"rsa" yaml:"rsa"` // RSA
*TokenConfig `json:"token" yaml:"token"` // token签名
*SHA256Config `json:"sha256" yaml:"sha256"` // SHA256
*HygAESConfig `json:"hyg_aes" yml:"hyg_aes"` // 慧用工的AES
*HygRSAConfig `json:"hyg_rsa" yaml:"hyg_rsa"` // 慧用工的RSA
}
// 支付宝客户端配置

View File

@ -15,3 +15,11 @@ type TokenConfig struct {
type SHA256Config struct {
SHA256Salts string `json:"salts" yaml:"salts"` //SHA256 salts
}
type HygAESConfig struct {
HygAESPrivateKey string `json:"private_key" yaml:"private_key"` //AES私钥
}
type HygRSAConfig struct {
HygRSAPrivateKey string `json:"private_key" yaml:"private_key"` //AES私钥
}

View File

@ -53,6 +53,7 @@ const (
NodeZoneSession // node 空间对话表
NodeZoneThirdPartner // node 空间代运营表
NodeDailyStatementZoneInfo // node 空间相关每日报表
NodeWorkerId // node 用户职业者id映射表
)
func GenIdInt64(node int64) (int64, error) {
@ -252,3 +253,9 @@ func GenDailyStatementZoneInfoId() int64 {
id, _ := GenIdInt64(NodeDailyStatementZoneInfo)
return id
}
// worker_id
func GenWorkerIdId() int64 {
id, _ := GenIdInt64(NodeWorkerId)
return id
}

View File

@ -23,6 +23,14 @@ func NewAesCrypto(cryptoConfig *configcenter.CryptoConfig) (aesCrypto *AesCrypto
return
}
func NewAesCryptoFromString(aesPrivateKeyStr string) (aesCrypto *AesCrypto, err error) {
aesCrypto = &AesCrypto{}
//读取私钥
aesCrypto.aesPriKey = []byte(aesPrivateKeyStr)
return
}
func (aesCrypto *AesCrypto) Encrypt(msg []byte) (encryptedBytes []byte, err error) {
//CBC加密
block, err := aes.NewCipher(aesCrypto.aesPriKey) //block

View File

@ -22,6 +22,8 @@ type CryptoService struct {
RSA *RsaCrypto
AES *AesCrypto
SHA256 *Sha256Crypto
HygRSA *RsaCrypto
HygAES *AesCrypto
}
func (cryptoService *CryptoService) Init(cryptoConfig *configcenter.CryptoConfig) (err error) {
@ -39,5 +41,16 @@ func (cryptoService *CryptoService) Init(cryptoConfig *configcenter.CryptoConfig
logger.Error("Init SHA256 Service failed! err:%v", err)
return
}
if cryptoService.HygRSA, err = NewRsaCryptoFromString(cryptoConfig.HygRSAPrivateKey); err != nil {
logger.Error("Init HYG RSA Service failed! err:%v", err)
return
}
if cryptoService.HygAES, err = NewAesCryptoFromString(cryptoConfig.HygAESPrivateKey); err != nil {
logger.Error("Init HYG AES Service failed! err:%v", err)
return
}
return
}

View File

@ -28,6 +28,24 @@ func NewRsaCrypto(cryptoConfig *configcenter.CryptoConfig) (rsaCrypto *RsaCrypto
return
}
func NewRsaCryptoFromString(rsaPrivateKeyStr string) (rsaCrypto *RsaCrypto, err error) {
rsaCrypto = &RsaCrypto{}
//读取私钥
rsaPriKey, err := readRSAPriKeyFromString(rsaPrivateKeyStr)
if err != nil {
logger.Error("read rsa primary key failed!", err)
return
}
//读取公钥
rsaPubKey := &rsaPriKey.PublicKey
rsaCrypto.rsaPriKey = rsaPriKey
rsaCrypto.rsaPubKey = rsaPubKey
return
}
func (rsaCrypto *RsaCrypto) Encrypt(msg []byte) (encryptedBytes []byte, err error) {
//公钥加密
encryptedBytes, err = rsa.EncryptPKCS1v15(rand.Reader, rsaCrypto.rsaPubKey, msg)
@ -68,3 +86,14 @@ func (rsaCrypto *RsaCrypto) readRSAPriKey(cryptoConfig *configcenter.CryptoConfi
}
return
}
func readRSAPriKeyFromString(rsaPrivateKeyStr string) (rsaPriKey *rsa.PrivateKey, err error) {
//读取私钥
rsaPriKeyBytes, _ := base64.StdEncoding.DecodeString(rsaPrivateKeyStr)
rsaPriKey, err = x509.ParsePKCS1PrivateKey(rsaPriKeyBytes)
if err != nil {
logger.Error("Decoding rsa primary key failed, check your config, please!, err: %v", err)
return
}
return
}

View File

@ -18,6 +18,8 @@ func newDecryptTagInterceptor() *DecryptTagInterceptor {
cryptoFuncMap := make(map[string]cryptoFunc)
cryptoFuncMap["aes_cbc"] = mycrypto.CryptoServiceInstance().AES.Decrypt
cryptoFuncMap["rsa"] = mycrypto.CryptoServiceInstance().RSA.Decrypt
cryptoFuncMap["hyg_rsa"] = mycrypto.CryptoServiceInstance().HygRSA.Decrypt
cryptoFuncMap["hyg_aes"] = mycrypto.CryptoServiceInstance().HygAES.Decrypt
cryptoTagInterceptor := newCryptoTagInterceptor()
cryptoTagInterceptor.LoadPrintableCryptoFunc(decryptTagInterceptor.getPrintableCryptoFunc(cryptoFuncMap))

View File

@ -18,6 +18,8 @@ func newEncryptTagInterceptor() *EncryptTagInterceptor {
cryptoFuncMap := make(map[string]cryptoFunc)
cryptoFuncMap["aes_cbc"] = mycrypto.CryptoServiceInstance().AES.Encrypt
cryptoFuncMap["rsa"] = mycrypto.CryptoServiceInstance().RSA.Encrypt
cryptoFuncMap["hyg_rsa"] = mycrypto.CryptoServiceInstance().HygRSA.Encrypt
cryptoFuncMap["hyg_aes"] = mycrypto.CryptoServiceInstance().HygAES.Encrypt
cryptoTagInterceptor := newCryptoTagInterceptor()
cryptoTagInterceptor.LoadPrintableCryptoFunc(encryptTagInterceptor.getPrintableCryptoFunc(cryptoFuncMap))