first commit
This commit is contained in:
30
apps/api/internal/logic/FLXG/flxg162alogic.go
Normal file
30
apps/api/internal/logic/FLXG/flxg162alogic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG162ALogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG162ALogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG162ALogic {
|
||||
return &FLXG162ALogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG162ALogic) FLXG162A(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
98
apps/api/internal/logic/FLXG/flxg3d56logic.go
Normal file
98
apps/api/internal/logic/FLXG/flxg3d56logic.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"tianyuan-api/apps/api/internal/validator"
|
||||
"tianyuan-api/pkg/crypto"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG3D56Logic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG3D56Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG3D56Logic {
|
||||
return &FLXG3D56Logic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG3D56Logic) FLXG3D56(req *types.Request) (resp *types.Response, err 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.FLXG3D56Request
|
||||
|
||||
if validatorErr := validator.ValidateAndParse(decryptData, &data); validatorErr != nil {
|
||||
return nil, validatorErr
|
||||
}
|
||||
|
||||
// 3、西部加密
|
||||
westConfig := l.svcCtx.Config.WestConfig
|
||||
mobileNo, err := crypto.WestDexEncrypt(data.MobileNo, westConfig.Key)
|
||||
if err != nil {
|
||||
logx.Errorf("西部加密错误:%v", err)
|
||||
return nil, errors.New("业务异常")
|
||||
}
|
||||
name, err := crypto.WestDexEncrypt(data.Name, westConfig.Key)
|
||||
if err != nil {
|
||||
logx.Errorf("西部加密错误:%v", err)
|
||||
return nil, errors.New("业务异常")
|
||||
}
|
||||
idCard, err := crypto.WestDexEncrypt(data.IDCard, westConfig.Key)
|
||||
if err != nil {
|
||||
logx.Errorf("西部加密错误:%v", err)
|
||||
return nil, errors.New("业务异常")
|
||||
}
|
||||
timeRange, err := crypto.WestDexEncrypt(data.TimeRange, westConfig.Key)
|
||||
if err != nil {
|
||||
logx.Errorf("西部加密错误:%v", err)
|
||||
return nil, errors.New("业务异常")
|
||||
}
|
||||
// 4、发送请求到西部
|
||||
westdexRequest := map[string]interface{}{
|
||||
"id": idCard,
|
||||
"cell": mobileNo,
|
||||
"name": name,
|
||||
"time_range": timeRange,
|
||||
}
|
||||
westResp, err := l.svcCtx.WestDexService.CallAPI("G26BJ05", 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
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxg54f5logic.go
Normal file
30
apps/api/internal/logic/FLXG/flxg54f5logic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG54F5Logic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG54F5Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG54F5Logic {
|
||||
return &FLXG54F5Logic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG54F5Logic) FLXG54F5(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxg5876logic.go
Normal file
30
apps/api/internal/logic/FLXG/flxg5876logic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG5876Logic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG5876Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG5876Logic {
|
||||
return &FLXG5876Logic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG5876Logic) FLXG5876(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxg75felogic.go
Normal file
30
apps/api/internal/logic/FLXG/flxg75felogic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG75FELogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG75FELogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG75FELogic {
|
||||
return &FLXG75FELogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG75FELogic) FLXG75FE(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxg9687logic.go
Normal file
30
apps/api/internal/logic/FLXG/flxg9687logic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG9687Logic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG9687Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG9687Logic {
|
||||
return &FLXG9687Logic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG9687Logic) FLXG9687(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxg970flogic.go
Normal file
30
apps/api/internal/logic/FLXG/flxg970flogic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXG970FLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXG970FLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG970FLogic {
|
||||
return &FLXG970FLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXG970FLogic) FLXG970F(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxgc9d1logic.go
Normal file
30
apps/api/internal/logic/FLXG/flxgc9d1logic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXGC9D1Logic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXGC9D1Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGC9D1Logic {
|
||||
return &FLXGC9D1Logic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXGC9D1Logic) FLXGC9D1(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxgca3dlogic.go
Normal file
30
apps/api/internal/logic/FLXG/flxgca3dlogic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXGCA3DLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXGCA3DLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGCA3DLogic {
|
||||
return &FLXGCA3DLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXGCA3DLogic) FLXGCA3D(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
30
apps/api/internal/logic/FLXG/flxgdec7logic.go
Normal file
30
apps/api/internal/logic/FLXG/flxgdec7logic.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package FLXG
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type FLXGDEC7Logic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewFLXGDEC7Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGDEC7Logic {
|
||||
return &FLXGDEC7Logic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FLXGDEC7Logic) FLXGDEC7(req *types.Request) (resp *types.Response, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user