Files

46 lines
1.3 KiB
Go
Raw Permalink Normal View History

2024-03-16 11:52:44 +08:00
/**
#*****************************************************************************
2024-08-06 18:30:21 +08:00
# @author MakerYang
# @site mir2.makeryang.com
2024-03-16 11:52:44 +08:00
#*****************************************************************************
*/
package GameAccountData
import (
2024-08-06 18:30:21 +08:00
"Service/framework/database"
"Service/framework/utils"
2024-03-16 11:52:44 +08:00
)
var TableName = "game_account_data"
type Data struct {
AccountId int `gorm:"primary_key;AUTO_INCREMENT;unique_index;not null;column:account_id"`
2024-08-06 18:30:21 +08:00
AccountMail string `gorm:"column:account_mail"`
2024-03-16 11:52:44 +08:00
AccountPassword string `gorm:"column:account_password"`
AccountName string `gorm:"column:account_name"`
AccountNumber string `gorm:"column:account_number"`
AccountQuestionA string `gorm:"column:account_question_a"`
AccountQuestionB string `gorm:"column:account_question_b"`
AccountAnswerA string `gorm:"column:account_answer_a"`
AccountAnswerB string `gorm:"column:account_answer_b"`
2024-08-06 18:30:21 +08:00
AccountGroup int `gorm:"column:account_group"`
2024-03-16 11:52:44 +08:00
AccountStatus int `gorm:"column:account_status"`
Database.DefaultField
}
type Return struct {
Token string `json:"token"`
}
func ReturnData(dataStruct *Data) Return {
data := Return{}
if dataStruct.AccountId > 0 {
data.Token = Utils.EncodeId(32, dataStruct.AccountId)
}
return data
}