单机模式引入gorm数据库框架初步
This commit is contained in:
1 parent
3966606689
commit
348a7f460e
20 files changed
+558
-107
No files matched your search
@@ -8,3 +8,12 @@ type Sdk struct {
|
||||
ID primitive.ObjectID `bson:"_id,omitempty"`
|
||||
NextSdkAccountId uint32 `bson:"next_sdk_account_id"` // 下一个自增账号id
|
||||
}
|
||||
|
||||
type SdkGorm struct {
|
||||
ID uint32 `gorm:"column:id;type:bigint(20);primaryKey"`
|
||||
NextSdkAccountId uint32 `gorm:"column:next_sdk_account_id;type:bigint(20)"` // 下一个自增账号id
|
||||
}
|
||||
|
||||
func (s SdkGorm) TableName() string {
|
||||
return "sdk"
|
||||
}
|
||||
@@ -12,3 +12,17 @@ type SdkAccount struct {
|
||||
ComboToken string `bson:"combo_token"` // 游戏服务器token
|
||||
ComboTokenCreateTime uint64 `bson:"combo_token_create_time"` // 毫秒时间戳
|
||||
}
|
||||
|
||||
type SdkAccountGorm struct {
|
||||
AccountId uint32 `gorm:"column:account_id;type:bigint(20);primaryKey"` // 账号id
|
||||
Username string `gorm:"column:username;type:varchar(255)"` // 用户名
|
||||
Password string `gorm:"column:password;type:varchar(255)"` // 密码
|
||||
Token string `gorm:"column:token;type:varchar(255)"` // 账号token
|
||||
TokenCreateTime uint64 `gorm:"column:token_create_time;type:bigint(20)"` // 毫秒时间戳
|
||||
ComboToken string `gorm:"column:combo_token;type:varchar(255)"` // 游戏服务器token
|
||||
ComboTokenCreateTime uint64 `gorm:"column:combo_token_create_time;type:bigint(20)"` // 毫秒时间戳
|
||||
}
|
||||
|
||||
func (s SdkAccountGorm) TableName() string {
|
||||
return "sdk_account"
|
||||
}
|
||||
Reference in new issue
Block a user