533 lines
21 KiB
Go
533 lines
21 KiB
Go
package integration
|
|
|
|
import (
|
|
"context"
|
|
|
|
"chatapp3-golang/internal/config"
|
|
)
|
|
|
|
// Gateways 聚合按职责拆分后的 Java 接口网关。
|
|
type Gateways struct {
|
|
Auth *AuthGateway
|
|
Device *DeviceGateway
|
|
InviteCode *InviteCodeGateway
|
|
Notice *NoticeGateway
|
|
Order *OrderGateway
|
|
RewardDispatch *RewardDispatchGateway
|
|
RewardQuery *RewardQueryGateway
|
|
Profile *ProfileGateway
|
|
Room *RoomGateway
|
|
Team *TeamGateway
|
|
Wallet *WalletGateway
|
|
Freight *FreightGateway
|
|
}
|
|
|
|
// NewGateways 基于共享 HTTP 客户端创建所有 Java 网关。
|
|
func NewGateways(cfg config.Config) Gateways {
|
|
client := New(cfg)
|
|
return Gateways{
|
|
Auth: &AuthGateway{client: client},
|
|
Device: &DeviceGateway{client: client},
|
|
InviteCode: &InviteCodeGateway{client: client},
|
|
Notice: &NoticeGateway{client: client},
|
|
Order: &OrderGateway{client: client},
|
|
RewardDispatch: &RewardDispatchGateway{client: client},
|
|
RewardQuery: &RewardQueryGateway{client: client},
|
|
Profile: &ProfileGateway{client: client},
|
|
Room: &RoomGateway{client: client},
|
|
Team: &TeamGateway{client: client},
|
|
Wallet: &WalletGateway{client: client},
|
|
Freight: &FreightGateway{client: client},
|
|
}
|
|
}
|
|
|
|
// AuthenticateToken 透传到认证网关。
|
|
func (g *Gateways) AuthenticateToken(ctx context.Context, token string) (UserCredential, error) {
|
|
return g.Auth.AuthenticateToken(ctx, token)
|
|
}
|
|
|
|
// CreateIfAbsentUserCredentialToken 透传到认证网关。
|
|
func (g *Gateways) CreateIfAbsentUserCredentialToken(ctx context.Context, userID int64) (string, error) {
|
|
return g.Auth.CreateIfAbsentUserCredentialToken(ctx, userID)
|
|
}
|
|
|
|
// AuthenticateConsoleToken 透传到后台认证网关。
|
|
func (g *Gateways) AuthenticateConsoleToken(ctx context.Context, authorization string) (ConsoleAccount, error) {
|
|
return g.Auth.AuthenticateConsoleToken(ctx, authorization)
|
|
}
|
|
|
|
// GetDeviceFingerprint 透传到设备网关。
|
|
func (g *Gateways) GetDeviceFingerprint(ctx context.Context, userID int64) (string, error) {
|
|
return g.Device.GetDeviceFingerprint(ctx, userID)
|
|
}
|
|
|
|
// EnsureInviteCode 透传到邀请码网关。
|
|
func (g *Gateways) EnsureInviteCode(ctx context.Context, authorization string) (InviteCode, error) {
|
|
return g.InviteCode.EnsureInviteCode(ctx, authorization)
|
|
}
|
|
|
|
// SendOfficialNoticeCustomize 透传到官方通知网关。
|
|
func (g *Gateways) SendOfficialNoticeCustomize(ctx context.Context, req OfficialNoticeCustomizeRequest) error {
|
|
return g.Notice.SendOfficialNoticeCustomize(ctx, req)
|
|
}
|
|
|
|
// MapUserTotalRecharge 透传到订单充值统计网关。
|
|
func (g *Gateways) MapUserTotalRecharge(ctx context.Context, userIDs []int64) (map[int64][]UserTotalRecharge, error) {
|
|
return g.Order.MapUserTotalRecharge(ctx, userIDs)
|
|
}
|
|
|
|
// GetThisMonthTotalPersonalRecharge 透传到订单充值统计网关。
|
|
func (g *Gateways) GetThisMonthTotalPersonalRecharge(ctx context.Context, userID int64) (DecimalString, error) {
|
|
return g.Order.GetThisMonthTotalPersonalRecharge(ctx, userID)
|
|
}
|
|
|
|
// GrantGold 透传到奖励发放网关。
|
|
func (g *Gateways) GrantGold(ctx context.Context, req GrantGoldRequest) error {
|
|
return g.RewardDispatch.GrantGold(ctx, req)
|
|
}
|
|
|
|
// GrantProps 透传到奖励发放网关。
|
|
func (g *Gateways) GrantProps(ctx context.Context, req GrantPropsRequest) error {
|
|
return g.RewardDispatch.GrantProps(ctx, req)
|
|
}
|
|
|
|
// GivePropsBackpack 透传到道具背包发放接口。
|
|
func (g *Gateways) GivePropsBackpack(ctx context.Context, req GivePropsBackpackRequest) error {
|
|
return g.RewardDispatch.GivePropsBackpack(ctx, req)
|
|
}
|
|
|
|
// IncrGiftBackpack 透传到礼物背包发放接口。
|
|
func (g *Gateways) IncrGiftBackpack(ctx context.Context, userID int64, giftID int64, quantity int) error {
|
|
return g.RewardDispatch.IncrGiftBackpack(ctx, userID, giftID, quantity)
|
|
}
|
|
|
|
// GetNobleVIPAbility 透传到贵族 VIP 能力配置接口。
|
|
func (g *Gateways) GetNobleVIPAbility(ctx context.Context, sourceID int64) (PropsNobleVIPAbility, error) {
|
|
return g.RewardQuery.GetNobleVIPAbility(ctx, sourceID)
|
|
}
|
|
|
|
// GetUserMaxNobleVIPAbility 透传到用户当前最高贵族 VIP 能力配置接口。
|
|
func (g *Gateways) GetUserMaxNobleVIPAbility(ctx context.Context, userID int64) (PropsNobleVIPAbility, error) {
|
|
return g.RewardQuery.GetUserMaxNobleVIPAbility(ctx, userID)
|
|
}
|
|
|
|
// SwitchUseProps 透传到道具使用切换接口。
|
|
func (g *Gateways) SwitchUseProps(ctx context.Context, userID int64, propsID int64) error {
|
|
return g.RewardDispatch.SwitchUseProps(ctx, userID, propsID)
|
|
}
|
|
|
|
// ActivateTemporaryBadge 透传到临时徽章激活接口。
|
|
func (g *Gateways) ActivateTemporaryBadge(ctx context.Context, userID int64, badgeID int64, days int) error {
|
|
return g.RewardDispatch.ActivateTemporaryBadge(ctx, userID, badgeID, days)
|
|
}
|
|
|
|
// SendActivityReward 透传到奖励发放网关。
|
|
func (g *Gateways) SendActivityReward(ctx context.Context, req SendActivityRewardRequest) error {
|
|
return g.RewardDispatch.SendActivityReward(ctx, req)
|
|
}
|
|
|
|
// GetRewardGroupDetail 透传到奖励查询网关。
|
|
func (g *Gateways) GetRewardGroupDetail(ctx context.Context, groupID int64) (RewardGroupDetail, error) {
|
|
return g.RewardQuery.GetRewardGroupDetail(ctx, groupID)
|
|
}
|
|
|
|
// FindRewardGroupDetail 透传到奖励查询网关,按名称查找奖励组详情。
|
|
func (g *Gateways) FindRewardGroupDetail(ctx context.Context, sysOrigin string, name string) (RewardGroupDetail, error) {
|
|
return g.RewardQuery.FindRewardGroupDetail(ctx, sysOrigin, name)
|
|
}
|
|
|
|
// GetUserProfile 透传到资料网关。
|
|
func (g *Gateways) GetUserProfile(ctx context.Context, userID int64) (UserProfile, error) {
|
|
return g.Profile.GetUserProfile(ctx, userID)
|
|
}
|
|
|
|
// GetUserRegion 透传到用户地区网关。
|
|
func (g *Gateways) GetUserRegion(ctx context.Context, userID int64, authorization string) (UserRegion, error) {
|
|
return g.Profile.GetUserRegion(ctx, userID, authorization)
|
|
}
|
|
|
|
// GetUserLevel 透传到用户等级网关。
|
|
func (g *Gateways) GetUserLevel(ctx context.Context, sysOrigin string, userID int64) (UserLevel, error) {
|
|
return g.Profile.GetUserLevel(ctx, sysOrigin, userID)
|
|
}
|
|
|
|
// ResolveRegionCodeByCountryCode 透传到 Java 区域配置网关。
|
|
func (g *Gateways) ResolveRegionCodeByCountryCode(ctx context.Context, sysOrigin string, countryCode string) (string, error) {
|
|
return g.Profile.ResolveRegionCodeByCountryCode(ctx, sysOrigin, countryCode)
|
|
}
|
|
|
|
// GetUserProfileByAccount 透传到资料网关。
|
|
func (g *Gateways) GetUserProfileByAccount(ctx context.Context, sysOrigin, account string) (UserProfile, error) {
|
|
return g.Profile.GetUserProfileByAccount(ctx, sysOrigin, account)
|
|
}
|
|
|
|
// GetUserProfileByAccountOne 透传到资料网关。
|
|
func (g *Gateways) GetUserProfileByAccountOne(ctx context.Context, account string) (UserProfile, error) {
|
|
return g.Profile.GetUserProfileByAccountOne(ctx, account)
|
|
}
|
|
|
|
// GetUserLanguage 透传到资料网关。
|
|
func (g *Gateways) GetUserLanguage(ctx context.Context, userID int64) (string, error) {
|
|
return g.Profile.GetUserLanguage(ctx, userID)
|
|
}
|
|
|
|
// RemoveUserProfileCacheAll 透传到用户资料缓存清理接口。
|
|
func (g *Gateways) RemoveUserProfileCacheAll(ctx context.Context, userID int64) error {
|
|
return g.Profile.RemoveUserProfileCacheAll(ctx, userID)
|
|
}
|
|
|
|
// PunishAccount 透传到账号处罚接口。
|
|
func (g *Gateways) PunishAccount(ctx context.Context, req PunishAccountRequest) error {
|
|
return g.Profile.PunishAccount(ctx, req)
|
|
}
|
|
|
|
// UnblockAccount 透传到账号解封接口。
|
|
func (g *Gateways) UnblockAccount(ctx context.Context, req UnblockAccountRequest) error {
|
|
return g.Profile.UnblockAccount(ctx, req)
|
|
}
|
|
|
|
// ListCurrentWeekRoomContribution 透传到房间流水网关。
|
|
func (g *Gateways) ListCurrentWeekRoomContribution(ctx context.Context, limit int) ([]RoomContributionActivityCount, error) {
|
|
return g.Room.ListCurrentWeekRoomContribution(ctx, limit)
|
|
}
|
|
|
|
// GetCurrentWeekRoomContribution 透传到房间流水网关。
|
|
func (g *Gateways) GetCurrentWeekRoomContribution(ctx context.Context, roomID int64) (RoomContributionActivityCount, error) {
|
|
return g.Room.GetCurrentWeekRoomContribution(ctx, roomID)
|
|
}
|
|
|
|
// GetRoomProfileByUserID 透传到房间资料网关。
|
|
func (g *Gateways) GetRoomProfileByUserID(ctx context.Context, userID int64) (RoomProfile, error) {
|
|
return g.Room.GetRoomProfileByUserID(ctx, userID)
|
|
}
|
|
|
|
// MapRoomProfiles 透传到房间资料网关。
|
|
func (g *Gateways) MapRoomProfiles(ctx context.Context, roomIDs []int64) (map[int64]RoomProfile, error) {
|
|
return g.Room.MapRoomProfiles(ctx, roomIDs)
|
|
}
|
|
|
|
// MarkRoomTurnoverRewardCoinsSent 透传到房间流水奖励标记接口。
|
|
func (g *Gateways) MarkRoomTurnoverRewardCoinsSent(ctx context.Context, id string) (bool, error) {
|
|
return g.Room.MarkRoomTurnoverRewardCoinsSent(ctx, id)
|
|
}
|
|
|
|
// GetTeamPolicyRelease 透传到团队政策网关。
|
|
func (g *Gateways) GetTeamPolicyRelease(ctx context.Context, query TeamPolicyReleaseQuery) (TeamPolicyRelease, error) {
|
|
return g.Team.GetTeamPolicyRelease(ctx, query)
|
|
}
|
|
|
|
// MapGoldBalance 透传到钱包网关。
|
|
func (g *Gateways) MapGoldBalance(ctx context.Context, userIDs []int64) (map[int64]int64, error) {
|
|
return g.Wallet.MapGoldBalance(ctx, userIDs)
|
|
}
|
|
|
|
// ExistsGoldEvent 透传到钱包网关。
|
|
func (g *Gateways) ExistsGoldEvent(ctx context.Context, eventID string) (bool, error) {
|
|
return g.Wallet.ExistsGoldEvent(ctx, eventID)
|
|
}
|
|
|
|
// ChangeGoldBalance 透传到钱包网关。
|
|
func (g *Gateways) ChangeGoldBalance(ctx context.Context, cmd GoldReceiptCommand) error {
|
|
return g.Wallet.ChangeGoldBalance(ctx, cmd)
|
|
}
|
|
|
|
// PageFreightSellers 透传到 H5 币商列表接口。
|
|
func (g *Gateways) PageFreightSellers(ctx context.Context, authorization string, sysOrigin string, cursor int, limit int) (FreightSellerPage, error) {
|
|
return g.Freight.PageFreightSellers(ctx, authorization, sysOrigin, cursor, limit)
|
|
}
|
|
|
|
func (g *Gateways) ExistsFreightBalance(ctx context.Context, userID int64) (bool, error) {
|
|
return g.Freight.ExistsFreightBalance(ctx, userID)
|
|
}
|
|
|
|
func (g *Gateways) ExistsFreightSeller(ctx context.Context, userID int64) (bool, error) {
|
|
return g.Freight.ExistsFreightSeller(ctx, userID)
|
|
}
|
|
|
|
func (g *Gateways) ChangeFreightBalance(ctx context.Context, req FreightBalanceChangeRequest) error {
|
|
return g.Freight.ChangeFreightBalance(ctx, req)
|
|
}
|
|
|
|
func (g *Gateways) AddFreightAgentReview(ctx context.Context, req FreightAgentReviewRequest) error {
|
|
return g.Freight.AddFreightAgentReview(ctx, req)
|
|
}
|
|
|
|
func (g *Gateways) IncreaseFreightRechargeRecord(ctx context.Context, userID int64, amount string) error {
|
|
return g.Order.IncreaseFreightRechargeRecord(ctx, userID, amount)
|
|
}
|
|
|
|
// AuthGateway 负责认证相关接口。
|
|
type AuthGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// AuthenticateToken 校验用户 token。
|
|
func (g *AuthGateway) AuthenticateToken(ctx context.Context, token string) (UserCredential, error) {
|
|
return g.client.AuthenticateToken(ctx, token)
|
|
}
|
|
|
|
// CreateIfAbsentUserCredentialToken 创建或返回用户 token。
|
|
func (g *AuthGateway) CreateIfAbsentUserCredentialToken(ctx context.Context, userID int64) (string, error) {
|
|
return g.client.CreateIfAbsentUserCredentialToken(ctx, userID)
|
|
}
|
|
|
|
// AuthenticateConsoleToken 校验后台 console token。
|
|
func (g *AuthGateway) AuthenticateConsoleToken(ctx context.Context, authorization string) (ConsoleAccount, error) {
|
|
return g.client.AuthenticateConsoleToken(ctx, authorization)
|
|
}
|
|
|
|
// DeviceGateway 负责设备指纹相关接口。
|
|
type DeviceGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// GetDeviceFingerprint 查询设备指纹。
|
|
func (g *DeviceGateway) GetDeviceFingerprint(ctx context.Context, userID int64) (string, error) {
|
|
return g.client.GetDeviceFingerprint(ctx, userID)
|
|
}
|
|
|
|
// InviteCodeGateway 负责邀请码相关接口。
|
|
type InviteCodeGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// EnsureInviteCode 确保用户存在邀请码。
|
|
func (g *InviteCodeGateway) EnsureInviteCode(ctx context.Context, authorization string) (InviteCode, error) {
|
|
return g.client.EnsureInviteCode(ctx, authorization)
|
|
}
|
|
|
|
// NoticeGateway 负责实时官方通知接口。
|
|
type NoticeGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// SendOfficialNoticeCustomize 发送自定义官方通知。
|
|
func (g *NoticeGateway) SendOfficialNoticeCustomize(ctx context.Context, req OfficialNoticeCustomizeRequest) error {
|
|
return g.client.SendOfficialNoticeCustomize(ctx, req)
|
|
}
|
|
|
|
// OrderGateway 负责订单充值统计接口。
|
|
type OrderGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// MapUserTotalRecharge 查询用户累计充值分组。
|
|
func (g *OrderGateway) MapUserTotalRecharge(ctx context.Context, userIDs []int64) (map[int64][]UserTotalRecharge, error) {
|
|
return g.client.MapUserTotalRecharge(ctx, userIDs)
|
|
}
|
|
|
|
// GetThisMonthTotalPersonalRecharge 查询用户本月个人充值。
|
|
func (g *OrderGateway) GetThisMonthTotalPersonalRecharge(ctx context.Context, userID int64) (DecimalString, error) {
|
|
return g.client.GetThisMonthTotalPersonalRecharge(ctx, userID)
|
|
}
|
|
|
|
func (g *OrderGateway) IncreaseFreightRechargeRecord(ctx context.Context, userID int64, amount string) error {
|
|
return g.client.IncreaseFreightRechargeRecord(ctx, userID, amount)
|
|
}
|
|
|
|
// RewardDispatchGateway 负责活动奖励发放接口。
|
|
type RewardDispatchGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// GrantGold 发放金币奖励。
|
|
func (g *RewardDispatchGateway) GrantGold(ctx context.Context, req GrantGoldRequest) error {
|
|
return g.client.GrantGold(ctx, req)
|
|
}
|
|
|
|
// GrantProps 发放道具奖励。
|
|
func (g *RewardDispatchGateway) GrantProps(ctx context.Context, req GrantPropsRequest) error {
|
|
return g.client.GrantProps(ctx, req)
|
|
}
|
|
|
|
// GivePropsBackpack 发放单个道具到用户背包。
|
|
func (g *RewardDispatchGateway) GivePropsBackpack(ctx context.Context, req GivePropsBackpackRequest) error {
|
|
return g.client.GivePropsBackpack(ctx, req)
|
|
}
|
|
|
|
// IncrGiftBackpack 发放礼物到用户礼物背包。
|
|
func (g *RewardDispatchGateway) IncrGiftBackpack(ctx context.Context, userID int64, giftID int64, quantity int) error {
|
|
return g.client.IncrGiftBackpack(ctx, userID, giftID, quantity)
|
|
}
|
|
|
|
// SwitchUseProps 切换用户当前使用道具。
|
|
func (g *RewardDispatchGateway) SwitchUseProps(ctx context.Context, userID int64, propsID int64) error {
|
|
return g.client.SwitchUseProps(ctx, userID, propsID)
|
|
}
|
|
|
|
// ActivateTemporaryBadge 激活临时徽章并佩戴。
|
|
func (g *RewardDispatchGateway) ActivateTemporaryBadge(ctx context.Context, userID int64, badgeID int64, days int) error {
|
|
return g.client.ActivateTemporaryBadge(ctx, userID, badgeID, days)
|
|
}
|
|
|
|
// SendActivityReward 发放活动奖励组。
|
|
func (g *RewardDispatchGateway) SendActivityReward(ctx context.Context, req SendActivityRewardRequest) error {
|
|
return g.client.SendActivityReward(ctx, req)
|
|
}
|
|
|
|
// RewardQueryGateway 负责奖励配置查询接口。
|
|
type RewardQueryGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// GetRewardGroupDetail 查询奖励组详情。
|
|
func (g *RewardQueryGateway) GetRewardGroupDetail(ctx context.Context, groupID int64) (RewardGroupDetail, error) {
|
|
return g.client.GetRewardGroupDetail(ctx, groupID)
|
|
}
|
|
|
|
// FindRewardGroupDetail 按名称查询奖励组详情。
|
|
func (g *RewardQueryGateway) FindRewardGroupDetail(ctx context.Context, sysOrigin string, name string) (RewardGroupDetail, error) {
|
|
return g.client.FindRewardGroupDetail(ctx, sysOrigin, name)
|
|
}
|
|
|
|
// GetNobleVIPAbility 查询贵族 VIP 能力配置。
|
|
func (g *RewardQueryGateway) GetNobleVIPAbility(ctx context.Context, sourceID int64) (PropsNobleVIPAbility, error) {
|
|
return g.client.GetNobleVIPAbility(ctx, sourceID)
|
|
}
|
|
|
|
// GetUserMaxNobleVIPAbility 查询用户当前最高贵族 VIP 能力配置。
|
|
func (g *RewardQueryGateway) GetUserMaxNobleVIPAbility(ctx context.Context, userID int64) (PropsNobleVIPAbility, error) {
|
|
return g.client.GetUserMaxNobleVIPAbility(ctx, userID)
|
|
}
|
|
|
|
// ProfileGateway 负责用户资料相关接口。
|
|
type ProfileGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// GetUserProfile 查询用户资料。
|
|
func (g *ProfileGateway) GetUserProfile(ctx context.Context, userID int64) (UserProfile, error) {
|
|
return g.client.GetUserProfile(ctx, userID)
|
|
}
|
|
|
|
// GetUserRegion 查询用户当前地区。
|
|
func (g *ProfileGateway) GetUserRegion(ctx context.Context, userID int64, authorization string) (UserRegion, error) {
|
|
return g.client.GetUserRegion(ctx, userID, authorization)
|
|
}
|
|
|
|
// GetUserLevel 查询用户财富/魅力等级。
|
|
func (g *ProfileGateway) GetUserLevel(ctx context.Context, sysOrigin string, userID int64) (UserLevel, error) {
|
|
return g.client.GetUserLevel(ctx, sysOrigin, userID)
|
|
}
|
|
|
|
// ResolveRegionCodeByCountryCode 根据 Java 区域配置把国家码解析成区域编码。
|
|
func (g *ProfileGateway) ResolveRegionCodeByCountryCode(ctx context.Context, sysOrigin string, countryCode string) (string, error) {
|
|
return g.client.ResolveRegionCodeByCountryCode(ctx, sysOrigin, countryCode)
|
|
}
|
|
|
|
// GetUserProfileByAccount 根据账号查询用户资料。
|
|
func (g *ProfileGateway) GetUserProfileByAccount(ctx context.Context, sysOrigin, account string) (UserProfile, error) {
|
|
return g.client.GetUserProfileByAccount(ctx, sysOrigin, account)
|
|
}
|
|
|
|
// GetUserProfileByAccountOne 根据账号查询单个用户资料。
|
|
func (g *ProfileGateway) GetUserProfileByAccountOne(ctx context.Context, account string) (UserProfile, error) {
|
|
return g.client.GetUserProfileByAccountOne(ctx, account)
|
|
}
|
|
|
|
// GetUserLanguage 查询用户语言。
|
|
func (g *ProfileGateway) GetUserLanguage(ctx context.Context, userID int64) (string, error) {
|
|
return g.client.GetUserLanguage(ctx, userID)
|
|
}
|
|
|
|
// RemoveUserProfileCacheAll 清理用户资料相关缓存。
|
|
func (g *ProfileGateway) RemoveUserProfileCacheAll(ctx context.Context, userID int64) error {
|
|
return g.client.RemoveUserProfileCacheAll(ctx, userID)
|
|
}
|
|
|
|
// PunishAccount 处罚用户账号。
|
|
func (g *ProfileGateway) PunishAccount(ctx context.Context, req PunishAccountRequest) error {
|
|
return g.client.PunishAccount(ctx, req)
|
|
}
|
|
|
|
// UnblockAccount 解封用户账号。
|
|
func (g *ProfileGateway) UnblockAccount(ctx context.Context, req UnblockAccountRequest) error {
|
|
return g.client.UnblockAccount(ctx, req)
|
|
}
|
|
|
|
// RoomGateway 负责房间资料和房间流水相关接口。
|
|
type RoomGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// ListCurrentWeekRoomContribution 查询当前周房间流水排行榜。
|
|
func (g *RoomGateway) ListCurrentWeekRoomContribution(ctx context.Context, limit int) ([]RoomContributionActivityCount, error) {
|
|
return g.client.ListCurrentWeekRoomContribution(ctx, limit)
|
|
}
|
|
|
|
// GetCurrentWeekRoomContribution 查询指定房间当前周流水。
|
|
func (g *RoomGateway) GetCurrentWeekRoomContribution(ctx context.Context, roomID int64) (RoomContributionActivityCount, error) {
|
|
return g.client.GetCurrentWeekRoomContribution(ctx, roomID)
|
|
}
|
|
|
|
// GetRoomProfileByUserID 查询用户当前房间资料。
|
|
func (g *RoomGateway) GetRoomProfileByUserID(ctx context.Context, userID int64) (RoomProfile, error) {
|
|
return g.client.GetRoomProfileByUserID(ctx, userID)
|
|
}
|
|
|
|
// MapRoomProfiles 批量查询房间资料。
|
|
func (g *RoomGateway) MapRoomProfiles(ctx context.Context, roomIDs []int64) (map[int64]RoomProfile, error) {
|
|
return g.client.MapRoomProfiles(ctx, roomIDs)
|
|
}
|
|
|
|
// MarkRoomTurnoverRewardCoinsSent 标记 Java 房间流水统计记录已经发奖。
|
|
func (g *RoomGateway) MarkRoomTurnoverRewardCoinsSent(ctx context.Context, id string) (bool, error) {
|
|
return g.client.MarkRoomTurnoverRewardCoinsSent(ctx, id)
|
|
}
|
|
|
|
// TeamGateway 负责团队政策相关接口。
|
|
type TeamGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// GetTeamPolicyRelease 查询已发布团队政策。
|
|
func (g *TeamGateway) GetTeamPolicyRelease(ctx context.Context, query TeamPolicyReleaseQuery) (TeamPolicyRelease, error) {
|
|
return g.client.GetTeamPolicyRelease(ctx, query)
|
|
}
|
|
|
|
// WalletGateway 负责钱包相关接口。
|
|
type WalletGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// MapGoldBalance 批量查询金币余额。
|
|
func (g *WalletGateway) MapGoldBalance(ctx context.Context, userIDs []int64) (map[int64]int64, error) {
|
|
return g.client.MapGoldBalance(ctx, userIDs)
|
|
}
|
|
|
|
// ExistsGoldEvent 查询事件幂等是否存在。
|
|
func (g *WalletGateway) ExistsGoldEvent(ctx context.Context, eventID string) (bool, error) {
|
|
return g.client.ExistsGoldEvent(ctx, eventID)
|
|
}
|
|
|
|
// ChangeGoldBalance 修改金币余额。
|
|
func (g *WalletGateway) ChangeGoldBalance(ctx context.Context, cmd GoldReceiptCommand) error {
|
|
return g.client.ChangeGoldBalance(ctx, cmd)
|
|
}
|
|
|
|
// FreightGateway 负责货运代理/币商相关接口。
|
|
type FreightGateway struct {
|
|
client *Client
|
|
}
|
|
|
|
// PageFreightSellers 查询 H5 可见币商列表。
|
|
func (g *FreightGateway) PageFreightSellers(ctx context.Context, authorization string, sysOrigin string, cursor int, limit int) (FreightSellerPage, error) {
|
|
return g.client.PageFreightSellers(ctx, authorization, sysOrigin, cursor, limit)
|
|
}
|
|
|
|
func (g *FreightGateway) ExistsFreightBalance(ctx context.Context, userID int64) (bool, error) {
|
|
return g.client.ExistsFreightBalance(ctx, userID)
|
|
}
|
|
|
|
func (g *FreightGateway) ExistsFreightSeller(ctx context.Context, userID int64) (bool, error) {
|
|
return g.client.ExistsFreightSeller(ctx, userID)
|
|
}
|
|
|
|
func (g *FreightGateway) ChangeFreightBalance(ctx context.Context, req FreightBalanceChangeRequest) error {
|
|
return g.client.ChangeFreightBalance(ctx, req)
|
|
}
|
|
|
|
func (g *FreightGateway) AddFreightAgentReview(ctx context.Context, req FreightAgentReviewRequest) error {
|
|
return g.client.AddFreightAgentReview(ctx, req)
|
|
}
|