first commit
This commit is contained in:
87
apps/api/internal/logic/YYSY/yysyf7dblogic.go
Normal file
87
apps/api/internal/logic/YYSY/yysyf7dblogic.go
Normal file
@@ -0,0 +1,87 @@
|
||||
package YYSY
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
)
|
||||
|
||||
type YYSYF7DBLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewYYSYF7DBLogic(ctx context.Context, svcCtx *svc.ServiceContext) *YYSYF7DBLogic {
|
||||
return &YYSYF7DBLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *YYSYF7DBLogic) YYSYF7DB(req *types.Request) (*types.Response, error) {
|
||||
////userId, ok := l.ctx.Value("userId").(int64)
|
||||
////if !ok {
|
||||
//// return &types.Response{}, errors.New("系统错误,请联系管理员")
|
||||
////}
|
||||
//secretKey, ok := l.ctx.Value("secretKey").(string)
|
||||
//if !ok {
|
||||
// return &types.Response{}, errors.New("系统错误,请联系管理员")
|
||||
//}
|
||||
//
|
||||
//// 1、解密
|
||||
//key, err := hex.DecodeString(secretKey)
|
||||
//decryptData, err := crypto.AesDecrypt(req.Data, key)
|
||||
//if err != nil || len(decryptData) == 0 {
|
||||
// return nil, errors.New("参数解密失败")
|
||||
//}
|
||||
//
|
||||
//// 2、校验
|
||||
//var data validator.YYSYf7dbRequest
|
||||
//
|
||||
//if validatorErr := validator.ValidateAndParse(decryptData, &data); validatorErr != nil {
|
||||
// return nil, validatorErr
|
||||
//}
|
||||
//
|
||||
//// 3、西部加密
|
||||
//westConfig := l.svcCtx.Config.WestConfig
|
||||
////name, err := crypto.WestDexEncrypt(data., westConfig.Key)
|
||||
////if err != nil {
|
||||
//// logx.Errorf("西部加密错误:%v", err)
|
||||
//// return nil, errors.New("业务异常")
|
||||
////}
|
||||
//phone, err := crypto.WestDexEncrypt(data.MobileNo, westConfig.Key)
|
||||
//if err != nil {
|
||||
// logx.Errorf("西部加密错误:%v", err)
|
||||
// return nil, errors.New("业务异常")
|
||||
//}
|
||||
//startDate, err := crypto.WestDexEncrypt(data.StartDate, westConfig.Key)
|
||||
//if err != nil {
|
||||
// logx.Errorf("西部加密错误:%v", err)
|
||||
// return nil, errors.New("业务异常")
|
||||
//}
|
||||
//// 4、发送请求到西部
|
||||
//westdexRequest := map[string]interface{}{
|
||||
// "phone": phone,
|
||||
// "startDate": startDate,
|
||||
//}
|
||||
//westResp, err := l.svcCtx.WestDexService.CallAPI("G19BJ02", westdexRequest)
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//
|
||||
//// 5、响应解析
|
||||
////var respData westmodel.G09GX01Response
|
||||
////unmarshalErr := json.Unmarshal(westResp, &respData)
|
||||
////if unmarshalErr != nil {
|
||||
//// return nil, unmarshalErr
|
||||
////}
|
||||
////crypto.AesEncrypt()
|
||||
//return &types.Response{
|
||||
// Data: string(westResp),
|
||||
//}, nil
|
||||
|
||||
return &types.Response{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user