table.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. #*****************************************************************************
  3. # @file table.go
  4. # @author MakerYang(https://www.makeryang.com)
  5. # @statement 免费课程配套开源项目,任何形式收费均为盗版
  6. #*****************************************************************************
  7. */
  8. package GameAccountData
  9. import (
  10. "Game/framework/database"
  11. "Game/framework/utils"
  12. )
  13. var TableName = "game_account_data"
  14. type Data struct {
  15. AccountId int `gorm:"primary_key;AUTO_INCREMENT;unique_index;not null;column:account_id"`
  16. AccountAccount string `gorm:"column:account_account"`
  17. AccountPassword string `gorm:"column:account_password"`
  18. AccountName string `gorm:"column:account_name"`
  19. AccountNumber string `gorm:"column:account_number"`
  20. AccountQuestionA string `gorm:"column:account_question_a"`
  21. AccountQuestionB string `gorm:"column:account_question_b"`
  22. AccountAnswerA string `gorm:"column:account_answer_a"`
  23. AccountAnswerB string `gorm:"column:account_answer_b"`
  24. AccountStatus int `gorm:"column:account_status"`
  25. Database.DefaultField
  26. }
  27. type Return struct {
  28. Token string `json:"token"`
  29. }
  30. func ReturnData(dataStruct *Data) Return {
  31. data := Return{}
  32. if dataStruct.AccountId > 0 {
  33. data.Token = Utils.EncodeId(32, dataStruct.AccountId)
  34. }
  35. return data
  36. }