model

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TbMenu string = "s_menu"

	MenuIsButtonYes byte = 1
	MenuIsButtonNo  byte = 2
)
View Source
const (
	TbAdminUser string = "s_admin_user"

	AdminUserStatusEnable  byte = 1
	AdminUserStatusDisable byte = 2
)
View Source
const (
	BetRuleNameBig         string = "大"
	BetRuleNameSmall       string = "小"
	BetRuleNameSingle      string = "单"
	BetRuleNameDouble      string = "双"
	BetRuleNameTriplet     string = "豹子"
	BetRuleNameLong        string = "龙"
	BetRuleNameHu          string = "虎"
	BetRuleNameHe          string = "合"
	BetRuleNameBigDan      string = "大单"
	BetRuleNameSmallDan    string = "小单"
	BetRuleNameBigDouble   string = "大双"
	BetRuleNameSmallDouble string = "小双"
	BetRuleNamePair        string = "对子(含豹子)" //
	BetRuleNameStraight    string = "顺子"
	BetRuleNameSpecTriplet string = "指定豹子"
)
View Source
const (
	BetStatusOrdered int = 1 //已下单
	BetStatusSettled int = 2 //已结算
)
View Source
const (
	TbGroupAdmin string = "t_group_admin"

	GroupProxyYes int = 1
	GroupProxyNo  int = 2
)
View Source
const (
	TbGroupUser string = "t_group_user"

	//user是否在组中
	GroupUserLeftYes int = 1
	GroupUserLeftNo  int = 2
)
View Source
const (
	ProjectName = "bot-api"

	ApiErrBindParam      int = 400 // 入参错误检测
	ApiErrAuthToken      int = 401 // 令牌认证错误
	ApiErrParamTamper    int = 402 // 参数篡改验证
	ApiErrKickedUser     int = 403 // 用户在其他地方登录而下线
	ApiErrHiddeUser      int = 404 // 用户禁止访问
	ApiErrPermissionUser int = 405 // 用户访问权限受限
	ApiErrServer         int = 500 // 服务内部错误
)
View Source
const (
	SymbolTronTRX string = "TRX" //主币
	SymbolTRCUSDT string = "TRC-USDT"
)
View Source
const (
	//定义游戏的类别
	GameIDK3    int = 11 //经典快三
	GameID5D    int = 21 //5D
	GameIDWinGo int = 31

	//游戏状态定义
	GameStatusON  int = 1 //已开启
	GameStatusOFF int = 2 //已关闭
)
View Source
const (
	TbUserWithdraw = "t_user_withdraw"

	//提现状态定义
	WithdrawStatusRequest          int = 1  //审核中
	WithdrawStatusPassPendingPay   int = 2  //审核通过-待支付
	WithdrawStatusPayOnlineSuccess int = 21 ////线上支付成功
	WithdrawStatusPassOfflinePay   int = 22 //审核通过-线下支付
	WithdrawStatusReject           int = 3  //审核不通过
)
View Source
const (
	TbBetK3 = "b_bet_k3"
)
View Source
const (
	TbGroupUserMoneyRec = "t_group_user_money_rec"
)
View Source
const (
	TbOpenK3 string = "b_open_k3"
)
View Source
const (
	TbRole string = "s_role"
)
View Source
const (
	TbSysEventLog = "s_event_log"
)
View Source
const (
	TbSysException = "s_exception"
)
View Source
const (
	TbUser = "t_user"
)

Variables

View Source
var (
	TbChatGroup string = "t_chat_group"

	//群状态定义
	ChatGroupStatusNormal int = 1 //正常
	ChatGroupStatusKicked int = 2 //踢出
	ChatGroupStatusDelete int = 3 //解散
)
View Source
var (
	MoneyTypeRegister    = myenum.NewENum("注册金", 1)
	MoneyTypeSign        = myenum.NewENum("每日签到金", 2)
	MoneyTypeBet         = myenum.NewENum("会员下单", 3)
	MoneyTypeBetWin      = myenum.NewENum("下单盈利", 31)
	MoneyTypeRecharge    = myenum.NewENum("充值款", 4)
	MoneyTypeWithdraw    = myenum.NewENum("提现款", 5)
	MoneyTypeTransferIn  = myenum.NewENum("代充转入款", 6)
	MoneyTypeTransferOut = myenum.NewENum("代充转出款", 61)
)
View Source
var (
	OpenStatusBet    = myenum.NewENum("待开盘,可以下注", 1)
	OpenStatusClose  = myenum.NewENum("封盘,待开奖", 2)
	OpenStatusOpened = myenum.NewENum("已开盘", 3)
)

Functions

func BaseBetRuleMap added in v1.0.10

func BaseBetRuleMap() map[string]BetRule

func MapBetRuleName added in v1.0.10

func MapBetRuleName() map[string]bool

func MapMoneyType

func MapMoneyType() map[int]string

Types

type AdminUser

type AdminUser struct {
	Id         int64  `gorm:"type:bigint;auto_increment;primary_key;not null" json:"id" ` //是否可空:NO
	Name       string `gorm:"type:varchar(100);uniqueIndex:name;comment:用户名" json:"name"`
	LoginPwd   string `gorm:"type:varchar(100)" json:"login_pwd" ` //是否可空:NO
	Enable     byte   `gorm:"type:tinyint;not null;default:1;comment:启用禁用:1启用 2禁用" json:"enable"`
	RoleID     int64  `gorm:"type:bigint;default:0;comment:角色ID" json:"role_id"`
	CreateTime int64  `gorm:"type:bigint" json:"create_time" ` //是否可空:NO
}

func (*AdminUser) TableName

func (self *AdminUser) TableName() string

type BetK3

type BetK3 struct {
	Id          int64   `gorm:"type:bigint;primaryKey;autoIncrease" json:"id" `
	TgGroupId   int64   `gorm:"type:bigint;default:0;comment:Tg群Id" json:"tg_group_id"`
	TgUserId    int64   `gorm:"type:bigint;default:0;comment:tg用户名ID" json:"tg_user_id"`
	DisplayName string  `gorm:"type:varchar(100);comment:群用户显示名称" json:"display_name"`
	ExpectNo    string  `gorm:"type:varchar(100);comment:期号" json:"expect_no"`
	BetType     string  `gorm:"type:varchar(100);comment:下注类型" json:"bet_type"`
	BetAmount   float64 `gorm:"type:double;default:0;comment:下注金额" json:"bet_amount"`
	Odds        float64 `gorm:"type:double;comment:赔率" json:"odds" `
	Status      int     `gorm:"type:int;comment:下单状态" json:"status" `
	WinMoney    float64 `gorm:"type:double;comment:赢钱数量,0表示没有中" json:"win_money" `
	BetTime     int64   `gorm:"type:bigint;comment:下单时间" json:"bet_time"`
	OpenTime    int64   `gorm:"type:bigint;comment:开盘时间" json:"open_time"`
}

func (*BetK3) FormatLineMsg

func (self *BetK3) FormatLineMsg() string

func (*BetK3) MathWinMoneyBy

func (self *BetK3) MathWinMoneyBy(openInfo OpenK3) float64

func (*BetK3) TableName

func (self *BetK3) TableName() string

type BetRule added in v1.0.10

type BetRule struct {
	Name           string  `json:"name"`            // 玩法名称
	BetDemo        string  `json:"bet_demo"`        // 下注例子
	CommandPattern string  `json:"command_pattern"` // 命令匹配的正则表达式
	MaxBet         int     `json:"max_bet"`         // 最高下注金额
	Odds           float64 `json:"odds"`            // 赔率
}

玩法相关定义 玩法,下单格式,赔率,最低下注额,最高下注额,

type ChatGroup

type ChatGroup struct {
	Id            int64                                 `gorm:"type:bigint;primaryKey;not null;comment:群组ID" json:"id"`
	Title         string                                `gorm:"type:varchar(200);comment:群组标题" json:"title"`
	GameId        int                                   `gorm:"type:int;comment:游戏ID" json:"game_id"`
	GameStatus    int                                   `gorm:"type:int;comment:群游戏状态" json:"game_status"`
	GameFrequency int                                   `gorm:"type:int;default:1;comment:游戏频率,单位分钟" json:"game_frequency"`
	Status        int                                   `gorm:"type:tinyint(5);comment:群的状态" json:"status"`
	ConfigOdds    myjson.JsonObject[map[string]BetRule] `gorm:"type:json;comment:玩法及配率" json:"config_odds"`
	CreateTime    int64                                 `gorm:"type:bigint" json:"create_time" ` //是否可空:NO
}

func (*ChatGroup) GameHelp

func (self *ChatGroup) GameHelp() string

func (*ChatGroup) TableName

func (self *ChatGroup) TableName() string

type GroupAdmin

type GroupAdmin struct {
	Id          int64 `gorm:"type:bigint;auto_increment;primary_key;not null" json:"id" ` //是否可空:NO
	ChatGroupId int64 `gorm:"type:bigint;comment:chat group id" json:"chat_group_id"`
	TgAdminId   int64 `gorm:"type:bigint;index:tg_admin_id;comment:telegram user id" json:"tg_admin_id"`
	IsProxy     int   `gorm:"type:tinyint(2);default:2;comment:是否代理" json:"is_proxy"`
	CreateTime  int64 `gorm:"type:bigint;default:0" json:"create_time" ` //是否可空:NO
}

func (*GroupAdmin) TableName

func (self *GroupAdmin) TableName() string

type GroupUser

type GroupUser struct {
	Id          int64  `gorm:"type:bigint;auto_increment;primary_key;not null" json:"id" ` //是否可空:NO
	TgUserId    int64  `gorm:"type:bigint;index:tg_user_id;comment:telegram user id" json:"tg_user_id"`
	ChatGroupId int64  `gorm:"type:bigint;comment:chat group id" json:"chat_group_id"`
	UserName    string `gorm:"type:varchar(100);default:''" json:"user_name"`
	FirstName   string `gorm:"type:varchar(100);default:''" json:"first_name"`
	LastName    string `gorm:"type:varchar(100);default:''" json:"last_name"`
	IsLeft      int    `gorm:"type:int;comment:是否离开群" json:"is_left"`
	SignTime    int64  `gorm:"type:bigint;default:0;comment:签到时间" json:"sign_time" ` //是否可空:NO
	CreateTime  int64  `gorm:"type:bigint;default:0" json:"create_time" `            //是否可空:NO
}

func (*GroupUser) DisplayName

func (self *GroupUser) DisplayName() string

func (*GroupUser) TableName

func (self *GroupUser) TableName() string

type GroupUserMoneyRec

type GroupUserMoneyRec struct {
	Id          int64   `gorm:"type:bigint;auto_increment;primary_key;not null" json:"id"` //是否可空:NO
	ChatGroupId int64   `gorm:"type:bigint;comment:群主ID" json:"chat_group_id"`
	TgUserId    int64   `gorm:"type:bigint;comment:user id" json:"tg_user_id"`
	TxID        string  `gorm:"type:varchar(100);index:tx_id;comment:交易ID" json:"tx_id"`
	AddTime     int64   `gorm:"type:bigint;comment:增加时间" json:"add_time"`
	Symbol      string  `gorm:"type:varchar(20);comment:代币类型" json:"symbol"` //是否可空:NO
	MoneyType   int     `gorm:"type:tinyint;comment:资金类型" json:"money_type" `
	Money       float64 `gorm:"type:double;comment:金额 column:money" json:"money"`
	Remark      string  `gorm:"type:varchar(150);comment:说明信息" json:"remark"`
}

func (*GroupUserMoneyRec) TableName

func (self *GroupUserMoneyRec) TableName() string
type Menu struct {
	ID             int64                    `gorm:"type:bigint;primaryKey;auto_increment;comment:菜单ID" json:"id"`        // 权限ID
	Name           string                   `gorm:"type:varchar(50);not null;comment:菜单名称" json:"name"`                  // 权限名称
	RouteName      string                   `gorm:"type:varchar(200);not null;comment:路由名称" json:"route_name"`           // 权限路由
	Route          string                   `gorm:"type:varchar(200);not null;comment:菜单路由路径" json:"route"`              // 权限路由
	ParentID       int64                    `gorm:"type:bigint;default:0;comment:上级菜单ID;index" json:"parent_id"`         // 上级权限ID
	IsButton       byte                     `gorm:"type:tinyint;not null;default:2;comment:是否按钮 1是 2否" json:"is_button"` // 是否按钮 1是 2否
	ListPermission myjson.JsonSlice[string] `gorm:"type:json;comment:路由权限清单(%s:%s, method, path)" json:"list_permission"`
}
func (self *Menu) TableName() string

type OpenK3

type OpenK3 struct {
	Id          int64  `gorm:"bigint;primaryKey;autoIncrement" json:"id"`
	ChatGroupId int64  `gorm:"type:bigint;index:chat_group_id;comment:群组ID" json:"chat_group_id"`
	GameId      int    `gorm:"type:int;comment:游戏ID" json:"game_id"`
	ExpectNo    string `gorm:"type:varchar(64);index:issue_number;comment:期号" json:"expect_no"`
	Status      int    `gorm:"type:int;comment:1待开奖,2已开奖" json:"status"`
	ValueA      int    `gorm:"type:int(11);not null" json:"value_a"`
	ValueB      int    `gorm:"type:int(11);not null" json:"value_b"`
	ValueC      int    `gorm:"type:int(11);not null" json:"value_c"`
	CreateTime  int64  `gorm:"type:bigint" json:"create_time"`
	CloseTime   int64  `gorm:"type:bigint" json:"close_time"`
}

func (*OpenK3) FormatLineMsg

func (self *OpenK3) FormatLineMsg() string

func (*OpenK3) FormatMessage

func (self *OpenK3) FormatMessage() string

func (*OpenK3) IsBig

func (self *OpenK3) IsBig() bool

是否大

func (*OpenK3) IsEven

func (self *OpenK3) IsEven() bool

是否双数

func (*OpenK3) IsPair added in v1.1.0

func (self *OpenK3) IsPair() bool

func (*OpenK3) IsStraight added in v1.1.0

func (self *OpenK3) IsStraight() bool

func (*OpenK3) IsTriplet

func (self *OpenK3) IsTriplet() bool

func (*OpenK3) LongHuHe

func (self *OpenK3) LongHuHe() string

func (*OpenK3) SumValues

func (self *OpenK3) SumValues() int

func (*OpenK3) TableName

func (self *OpenK3) TableName() string

type Role

type Role struct {
	Id          int64                   `gorm:"type:bigint;auto_increment;primary_key;not null" json:"id" ` //是否可空:NO
	Name        string                  `gorm:"type:varchar(100);uniqueIndex:name;comment:角色名称" json:"name"`
	Description string                  `gorm:"type:varchar(200);not null;default:'';comment:角色描述" json:"description"` // 角色描述
	ListMenus   myjson.JsonSlice[int64] `gorm:"type:json" json:"list_menus"`
	CreateTime  int64                   `gorm:"type:bigint" json:"create_time" ` //是否可空:NO
}

系统角色

func (*Role) TableName

func (self *Role) TableName() string

type SysEventLog

type SysEventLog struct {
	Id          int64  `gorm:"type:bigint(20) auto_increment;primary_key;comment:" json:"id"`
	Module      string `gorm:"type:varchar(100)" json:"module" `
	SubModule   string `gorm:"type:varchar(100)" json:"sub_module" `
	JobNo       string `gorm:"type:varchar(100)" json:"job_no" `
	Description string `gorm:"type:varchar(100)" json:"description" `
	AddTime     int64  `gorm:"type:bigint" json:"add_time" `
	ActionBy    string `gorm:"type:varchar(100)" json:"action_by" `
}

func (*SysEventLog) TableName

func (self *SysEventLog) TableName() string

type SysException

type SysException struct {
	Id        int64  `gorm:"type:bigint(20) auto_increment;primary_key;comment:" json:"id"`
	ExcTitle  string `gorm:"type:varchar(500)" json:"exc_title" `
	ExcDesc   string `gorm:"type:varchar(2000)" json:"exc_desc" `
	ExcMethod string `gorm:"type:varchar(200)" json:"exc_method" `
	ExcModule string `gorm:"type:varchar(200)" json:"exc_module" `
	AddTime   int64  `gorm:"type:bigint" json:"add_time" `
}

func (*SysException) TableName

func (self *SysException) TableName() string

type User added in v1.0.7

type User struct {
	TgUserId           int64   `gorm:"type:bigint;primary_key:tg_user_id" json:"tg_user_id"`
	UserName           string  `gorm:"type:varchar(100);default:''" json:"user_name"`
	FirstName          string  `gorm:"type:varchar(100);default:''" json:"first_name"`
	LastName           string  `gorm:"type:varchar(100);default:''" json:"last_name"`
	RechargeTrcUsdt    string  `gorm:"type:varchar(100);uniqueIndex:recharge_trc_usdt;comment:充值TRC 地址;not null" json:"recharge_trc_usdt"`
	Money              float64 `gorm:"type:double;default:0;comment:充入的余额,单位U" json:"money"`  //是否可空:NO
	TRXMoney           float64 `gorm:"type:double;default:0;comment:充入的trx" json:"trx_money"` //是否可空:NO
	FrozenMoney        float64 `gorm:"type:double;default:0" json:"frozen_money" `            //是否可空:NO
	DailyWithdrawLimit float64 `gorm:"type:double;default:100" json:"daily_withdraw_limit" `  //是否可空:NO
	CreateTime         int64   `gorm:"type:bigint;default:0" json:"create_time" `             //是否可空:NO
}

tg user info

func (*User) DisplayName added in v1.0.7

func (self *User) DisplayName() string

func (*User) TableName added in v1.0.7

func (self *User) TableName() string

type UserWithdraw added in v1.0.7

type UserWithdraw struct {
	Id            int64   `gorm:"type:bigint;auto_increment;primary_key;not null" json:"id" `             //是否可空:NO
	RelatedPayId  int64   `gorm:"type:bigint;default:0;index;comment:对应的支付平台提现ID" json:"related_pay_id" ` //是否可空:NO
	TgUserId      int64   `gorm:"type:bigint;comment:user id" json:"tg_user_id" `                         //是否可空:NO
	TrcUsdt       string  `gorm:"type:varchar(60);comment:提现地址" json:"trc_usdt"`
	WithdrawMoney float64 `gorm:"type:double;comment:提现金额" json:"withdraw_money"` //是否可空:NO
	HandlingFee   float64 `gorm:"type:double;comment:提现手续费用" json:"handling_fee"` //是否可空:NO
	Status        int     `gorm:"type:tinyint(4);comment:提现状态" json:"status" `    //是否可空:NO 1 request 2 finished 3 rejected
	AddTime       int64   `gorm:"type:bigint;comment:提现时间" json:"add_time" `      //是否可空:NO
	ConfirmTime   int64   `gorm:"type:bigint;comment:到帐时间" json:"confirm_time" `  //是否可空:NO
	//ConfirmMoney  float64 `gorm:"type:double;comment:到帐金额" json:"confirm_money" ` //是否可空:NO withdraw request money will not be same with confirm money
	Remark string `gorm:"type:varchar(100);comment:审核说明" json:"remark"`
}

func (*UserWithdraw) TableName added in v1.0.7

func (self *UserWithdraw) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL