58 lines
2.3 KiB
Go
58 lines
2.3 KiB
Go
// ================================================================================
|
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|
// You can delete these comments if you wish manually maintain this interface file.
|
|
// ================================================================================
|
|
|
|
package service
|
|
|
|
import (
|
|
"context"
|
|
"kami/internal/consts"
|
|
"kami/internal/model"
|
|
"kami/internal/model/entity"
|
|
|
|
"github.com/gogf/gf/v2/database/gdb"
|
|
)
|
|
|
|
type (
|
|
IAppleAccount interface {
|
|
Add(ctx context.Context, data model.AppleAccountRecordInput, tx gdb.TX) (err error)
|
|
// Update 修改用户信息
|
|
Update(ctx context.Context, data model.V1CardAppleAccountInfo, tx gdb.TX) (err error)
|
|
// AddWalletAmount 添加金额到账户中
|
|
AddWalletAmount(ctx context.Context, info model.AppleCardWalletInfo, tx gdb.TX) (err error)
|
|
// Delete 删除苹果账号
|
|
Delete(ctx context.Context, id string, tx gdb.TX) (err error)
|
|
// List 获取所有苹果账户
|
|
List(ctx context.Context, req model.CardInfoParamsInput) (total int, data []entity.V1CardAppleAccountInfo, err error)
|
|
ModifyAccountStatus(ctx context.Context, id string, status consts.AppleAccountStatus) (err error)
|
|
// GetDetailById 根据ID获取账号详情
|
|
GetDetailById(ctx context.Context, id string) (data entity.V1CardAppleAccountInfo, err error)
|
|
// GetDetailByAccount 根据账号获取账号详情
|
|
GetDetailByAccount(ctx context.Context, account string) (data entity.V1CardAppleAccountInfo, err error)
|
|
// GetAccordingAccount 轮播,获取符合条件的第一个账户
|
|
GetAccordingAccount(ctx context.Context) (data entity.V1CardAppleAccountInfo, err error)
|
|
// GetAllAccount 获取所有账号
|
|
GetAllAccount(ctx context.Context) (data []entity.V1CardAppleAccountInfo, err error)
|
|
// GetAllAccountByStatus 获取所有可用的账号
|
|
GetAllAccountByStatus(ctx context.Context, status consts.AppleAccountStatus) (data []entity.V1CardAppleAccountInfo, err error)
|
|
// ResetAccountStatus 重置账号状态
|
|
ResetAccountStatus(ctx context.Context) (err error)
|
|
}
|
|
)
|
|
|
|
var (
|
|
localAppleAccount IAppleAccount
|
|
)
|
|
|
|
func AppleAccount() IAppleAccount {
|
|
if localAppleAccount == nil {
|
|
panic("implement not found for interface IAppleAccount, forgot register?")
|
|
}
|
|
return localAppleAccount
|
|
}
|
|
|
|
func RegisterAppleAccount(i IAppleAccount) {
|
|
localAppleAccount = i
|
|
}
|