Documentation ¶
Index ¶
- Constants
- func BalanceList(uids []string) (map[string]string, error)
- func BuildDSN(host string, port int, username, password, dbname, args string) string
- func ChannelCondition(c []string) string
- func Combined(cond ...string) string
- func DeleteHero(id int64) error
- func DeleteUser(uid int64) error
- func EqInt64Condition(col string, v int64) string
- func EqIntCondition(col string, v int) string
- func HeroList(uid int64) ([]model.Hero, error)
- func Insert(bean interface{}) error
- func InsertHero(h *model.Hero) (int64, error)
- func InsertLoginLog(uid int64, d protocol.Device, appid string, channelID string)
- func InsertOnline(count int, scenes map[int]interface{}, ts int64)
- func InsertOrder(order *model.Order) error
- func InsertRegister(reg *model.Register)
- func InsertThirdAccount(account *model.ThirdAccount, u *model.User) error
- func InsertTrade(t *model.Trade) error
- func InsertUser(u *model.User) (int64, error)
- func IsUserExists(uid int64) bool
- func LtInt64Condition(col string, v int64) string
- func MustStartup(dsn string, opts ...ModelOption) func()
- func OnlineStats(begin, end int64) ([]model.Online, error)
- func OnlineStatsLite() (*model.Online, error)
- func OrderList(uid int64, appid, channelID, orderID, payBy string, start, end int64, ...) ([]model.Order, int, error)
- func QueryActivationUser(from, to int64) ([]*protocol.ActivationUser, error)
- func QueryAiConfig(mid int64) (*model.Aiconfig, error)
- func QueryBufferState(id int) (*model.BufferState, error)
- func QueryGuestUser(appId string, imei string) (*model.User, error)
- func QueryHero(id int64) (*model.Hero, error)
- func QueryMonster(id int64) (*model.Monster, error)
- func QueryOrder(orderID string) (*model.Order, error)
- func QueryRegisterUsers(begin, end int64) (int, error)
- func QueryScene(id int) (*model.Scene, error)
- func QuerySpell(id int) (*model.Spell, error)
- func QueryThirdAccount(account, platform string) (*model.ThirdAccount, error)
- func QueryUser(id int64) (*model.User, error)
- func QueryUserInfo(id int64) (*protocol.UserStatsInfo, error)
- func QueryUserList(offset, count int) ([]model.User, int64, error)
- func RangeCondition(column string, begin, end int64) string
- func RegisterUserLog(u *model.User, d protocol.Device, appid string, channelID string, regType int)
- func RetentionList(current int) (*protocol.Retention, error)
- func SceneDoorList(sceneId int) ([]model.SceneDoor, error)
- func SceneList(sceneIds []int) ([]model.Scene, error)
- func SceneMonsterConfigList(sceneId int) ([]model.SceneMonsterConfig, error)
- func Startup() func()
- func UpdateHero(d *model.Hero) error
- func UpdateThirdAccount(account *model.ThirdAccount) error
- func UpdateUser(u *model.User) error
- func UserAddCoin(uid int64, coin int64) error
- func UserLoseCoin(id int64, coin int64) error
- func UserLoseCoinByUID(uid int64, coin int64) error
- func YXPayOrderList(uid int64, appid, channelID, orderID string, start, end int64, ...) ([]model.Order, int, error)
- type Closer
- type KeyPair
- type Logger
- type ModelOption
- type Option
- type Setting
- type ViewChannelApp
- type ViewTrade
Constants ¶
View Source
const ( RoleTypeAdmin = 1 //管理员账号 RoleTypeThird = 2 //三方平台账号 )
Users表中role字段的取值
View Source
const ( OpActionRegister = 1 //注册 OpActionFreezen = 2 //冻结账号 OpActionUnFreezen = 3 //账号解冻 OpActionDelete = 4 //账号删除 )
View Source
const ( UserOffline = 1 //离线 UserOnline = 2 //在线 )
View Source
const ( StatusNormal = 1 //正常 StatusDeleted = 2 //删除 StatusFreezed = 3 //冻结 StatusBound = 4 //绑定 )
View Source
const ( OrderStatusCreated = 1 //创建 OrderStatusPayed = 2 //完成 OrderStatusNotified = 3 //已确认订单 )
订单状态
View Source
const ( OrderTypeUnknown = iota OrderTypeBuyToken //购买令牌 OrderTypeConsumeToken //消费代币(eg:使用令牌购买游戏中的道具,比如房卡) OrderTypeConsume3rd //第三方支付平台消费(eg:直接使用alipay, wechat等购买游戏中的道具) OrderTypeTest //支付测试 )
View Source
const ( NotifyResultSuccess = 1 //通知成功 NotifyResultFailed = 2 //通知失败 )
View Source
const ( RankingNormal = 1 RankingDesc = 2 )
View Source
const (
DefaultTopN = 10
)
View Source
const (
KWX = "broker"
)
Variables ¶
This section is empty.
Functions ¶
func ChannelCondition ¶
func DeleteHero ¶
func EqInt64Condition ¶
func EqIntCondition ¶
func InsertLoginLog ¶
func InsertOnline ¶
func InsertOrder ¶
func InsertRegister ¶
func InsertThirdAccount ¶
func InsertThirdAccount(account *model.ThirdAccount, u *model.User) error
func InsertTrade ¶
func LtInt64Condition ¶
func MustStartup ¶
func MustStartup(dsn string, opts ...ModelOption) func()
New create the database's connection
func QueryActivationUser ¶
func QueryActivationUser(from, to int64) ([]*protocol.ActivationUser, error)
活跃人数
func QueryBufferState ¶
func QueryBufferState(id int) (*model.BufferState, error)
func QueryThirdAccount ¶
func QueryThirdAccount(account, platform string) (*model.ThirdAccount, error)
func QueryUserInfo ¶
func QueryUserInfo(id int64) (*protocol.UserStatsInfo, error)
QueryUserInfo get the user by id
func RangeCondition ¶
给定列, 返回起始时间条件SQL语句, [begin, end)
func RegisterUserLog ¶
func SceneMonsterConfigList ¶
func SceneMonsterConfigList(sceneId int) ([]model.SceneMonsterConfig, error)
func UpdateHero ¶
func UpdateThirdAccount ¶
func UpdateThirdAccount(account *model.ThirdAccount) error
func UserAddCoin ¶
func UserLoseCoin ¶
func UserLoseCoinByUID ¶
Types ¶
type ModelOption ¶
type ModelOption func(*options)
ModelOption specifies an option for dialing a xordefaultModel.
func MaxIdleConns ¶
func MaxIdleConns(i int) ModelOption
MaxIdleConns specifies the max idle connect numbers.
func MaxOpenConns ¶
func MaxOpenConns(i int) ModelOption
MaxOpenConns specifies the max open connect numbers.
type Option ¶
type Option func(setting *Setting)
func MaxIdleConnOption ¶
func MaxOpenConnOption ¶
func ShowSQLOption ¶
type ViewChannelApp ¶
type ViewChannelApp struct { Id int64 Type byte Status byte Uid int64 CreatedAt int64 RegisterAt int64 FirstRechargeAt int64 RealMoney int RegisterType int Os string Imei string OrderId string AppId string Model string ServerId string ProductId string OrderPlatform string PayPlatform string PassportChannelId string PaymentChannelId string }
trade & register & user => views
func (*ViewChannelApp) TableName ¶
func (v *ViewChannelApp) TableName() string
type ViewTrade ¶
type ViewTrade struct { PayAt int64 Uid int64 Id int64 Type int Money int RealMoney int ProductCount int Status int OrderId string ComsumerId string AppId string ChannelId string OrderPlatform string ChannelOrderId string Currency string RoleId string ServerName string ProductId string ProductName string RoleName string PayPlatform string }
trade & order => views
Source Files ¶
Click to show internal directories.
Click to hide internal directories.