增加软质押手动结算测试接口
This commit is contained in:
@@ -2,6 +2,9 @@ package carv
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"nova_task/internal/model"
|
||||
"nova_task/internal/pkg/errs"
|
||||
|
||||
"nova_task/internal/svc"
|
||||
"nova_task/internal/types"
|
||||
@@ -24,8 +27,40 @@ func NewBindWalletLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BindWa
|
||||
}
|
||||
}
|
||||
|
||||
func (l *BindWalletLogic) BindWallet(req *types.EmailKey) (resp *types.CarvResult, err error) {
|
||||
l.svcCtx.UserModel.FindOneByEmail(l.ctx, req.Email)
|
||||
func (l *BindWalletLogic) BindWallet(req *types.EmailKey) (*types.CarvResult, error) {
|
||||
u, err := l.svcCtx.UserModel.FindOneByEmail(l.ctx, req.Email)
|
||||
if err != nil {
|
||||
if !errors.Is(err, model.ErrNotFound) {
|
||||
return &types.CarvResult{
|
||||
Error: &types.Error{
|
||||
Code: int(errs.ErrDatabaseOperate),
|
||||
Message: "system error",
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
return &types.CarvResult{
|
||||
Error: &types.Error{
|
||||
Code: int(errs.ErrUserNotFound),
|
||||
Message: "email not exist",
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
return
|
||||
_, err = l.svcCtx.WalletModel.FindAddressByUid(l.ctx, u.Id)
|
||||
if err != nil {
|
||||
if !errors.Is(err, model.ErrNotFound) {
|
||||
return &types.CarvResult{
|
||||
Error: &types.Error{
|
||||
Code: int(errs.ErrDatabaseOperate),
|
||||
Message: "system error",
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
return &types.CarvResult{
|
||||
Result: &types.Result{IsValid: false},
|
||||
}, nil
|
||||
}
|
||||
return &types.CarvResult{
|
||||
Result: &types.Result{IsValid: true},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user