Documentation ¶
Index ¶
- Constants
- Variables
- func AppKeyPairs() (map[string]*KeyPair, error)
- func ApplyClub(uid, clubId int64) error
- 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 ClubList(uid int64) ([]model.Club, error)
- func ClubLoseBalance(clubId, balance int64, consume *model.CardConsume) error
- func Combined(cond ...string) string
- func ConsumeStats(from, to int64) ([]*protocol.CardConsume, error)
- func DeleteApp(appid string) error
- func DeleteDesk(id int64) error
- func DeleteHistoriesByDeskID(deskId int64) error
- func DeleteHistory(id int64) error
- func DeleteUser(uid int64) error
- func DeskList(player int64, offset, count int) ([]model.Desk, int, error)
- func DeskNumberExists(no string) bool
- func EqInt64Condition(col string, v int64) string
- func EqIntCondition(col string, v int) string
- func Insert(bean interface{}) error
- func InsertApp(app *model.App) error
- func InsertConsume(entity *model.CardConsume) error
- func InsertDesk(h *model.Desk) error
- func InsertHistory(h *model.History) error
- func InsertLoginLog(uid int64, d protocol.Device, appid string, channelID string)
- func InsertOnline(count int, deskCount int)
- func InsertOperation(op *model.Operation)
- func InsertOrder(order *model.Order) error
- func InsertProduction(p *model.Production) error
- func InsertRank(r *model.Rank) 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) error
- func IsBalanceEnough(clubId int64) bool
- func IsClubMember(clubId, uid int64) bool
- 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 ProductionList(offset, count int) ([]model.Production, int64, error)
- func QueryActivationUser(from, to int64) ([]*protocol.ActivationUser, error)
- func QueryApp(appid string) (*model.App, error)
- func QueryAppList(offset, count int, cpID string) ([]model.App, int64, error)
- func QueryDesk(id int64) (*model.Desk, error)
- func QueryGuestUser(appId string, imei string) (*model.User, error)
- func QueryHistoriesByDeskID(deskID int64) ([]model.History, int, error)
- func QueryHistory(id int64) (*model.History, error)
- func QueryOrder(orderID string) (*model.Order, error)
- func QueryProduction(prodID string) (*model.Production, error)
- func QueryRegisterUsers(begin, end int64) (int, 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 RankList(typ, n int, date int64) ([][]protocol.Rank, error)
- func RegisterUserLog(u *model.User, d protocol.Device, appid string, channelID string, regType int)
- func RetentionList(current int) (*protocol.Retention, error)
- func UpdateApp(app *model.App) error
- func UpdateDesk(d *model.Desk) error
- func UpdateProduction(p *model.Production) 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 ¶
View Source
var (
DB *xorm.Engine
)
Functions ¶
func AppKeyPairs ¶
AppKeyPairs return all appkey&model.Appsecret pairs
func ChannelCondition ¶
func ClubLoseBalance ¶
func ClubLoseBalance(clubId, balance int64, consume *model.CardConsume) error
func DeleteDesk ¶
func DeleteHistoriesByDeskID ¶
func DeleteHistory ¶
func EqInt64Condition ¶
func EqIntCondition ¶
func InsertConsume ¶
func InsertConsume(entity *model.CardConsume) error
func InsertDesk ¶
func InsertHistory ¶
func InsertLoginLog ¶
func InsertOnline ¶
func InsertOperation ¶
func InsertOrder ¶
func InsertProduction ¶
func InsertProduction(p *model.Production) error
func InsertRank ¶
func InsertRegister ¶
func InsertThirdAccount ¶
func InsertThirdAccount(account *model.ThirdAccount, u *model.User) error
func InsertTrade ¶
func IsBalanceEnough ¶
func IsClubMember ¶
func LtInt64Condition ¶
func MustStartup ¶
func MustStartup(dsn string, opts ...ModelOption) func()
New create the database's connection
func ProductionList ¶
func ProductionList(offset, count int) ([]model.Production, int64, error)
所有offline_at <>0 表示已经下线
func QueryActivationUser ¶
func QueryActivationUser(from, to int64) ([]*protocol.ActivationUser, error)
活跃人数
func QueryHistoriesByDeskID ¶
func QueryProduction ¶
func QueryProduction(prodID string) (*model.Production, 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 UpdateDesk ¶
func UpdateProduction ¶
func UpdateProduction(p *model.Production) error
func UpdateThirdAccount ¶
func UpdateThirdAccount(account *model.ThirdAccount) error
func UserAddCoin ¶
func UserLoseCoin ¶
func UserLoseCoinByUID ¶
Types ¶
type KeyPair ¶
KeyPair rsa's public & private key pair
func KeyPairForApp ¶
KeyPairForApp return appkey&model.Appsecret pair for the app
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.