temp
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package walletservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/internal/svc"
|
||||
"tianyuan-api/apps/user/user"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetDeductionByTransactionIdLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetDeductionByTransactionIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDeductionByTransactionIdLogic {
|
||||
return &GetDeductionByTransactionIdLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetDeductionByTransactionIdLogic) GetDeductionByTransactionId(in *user.GetDeductionByTransactionIdRequest) (*user.GetDeductionByTransactionIdResponse, error) {
|
||||
deduction, err := l.svcCtx.DeductionsModel.FindOneByTransactionId(l.ctx, in.TransactionId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &user.GetDeductionByTransactionIdResponse{
|
||||
Id: deduction.Id,
|
||||
UserId: deduction.UserId,
|
||||
Amount: deduction.Amount,
|
||||
TransactionId: deduction.TransactionId,
|
||||
CreatedAt: deduction.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user