31 lines
887 B
Go
31 lines
887 B
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
|
|
walletDto "shop-user-trade/model/dto/wallet"
|
|
walletService "shop-user-trade/service/wallet"
|
|
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
|
)
|
|
|
|
var Account = new(accountController)
|
|
|
|
type accountController struct{}
|
|
|
|
// Get 获取钱包
|
|
func (c *accountController) Get(ctx context.Context, req *walletDto.GetAccountByUserIdReq) (*walletDto.AccountInfo, error) {
|
|
return walletService.Account.GetAccountByUserId(ctx, req)
|
|
}
|
|
|
|
// Recharge 充值
|
|
func (c *accountController) Recharge(ctx context.Context, req *walletDto.RechargeReq) (res *beans.ResponseEmpty, err error) {
|
|
err = walletService.Account.Recharge(ctx, req)
|
|
return
|
|
}
|
|
|
|
// GetLogs 获取钱包流水
|
|
func (c *accountController) GetLogs(ctx context.Context, req *walletDto.GetAccountLogsReq) (*walletDto.AccountLogData, error) {
|
|
return walletService.Account.GetWalletLogs(ctx, req)
|
|
}
|