trans_checkUserPassword.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package transaction
  2. import (
  3. "bet24.com/database"
  4. "bet24.com/log"
  5. "encoding/json"
  6. "runtime/debug"
  7. )
  8. type checkUserPassword_in struct {
  9. UserID int
  10. Password string
  11. PartnerId int
  12. Version int
  13. }
  14. type checkUserPassword_out struct {
  15. RetCode int //结果
  16. Amount int //金币
  17. Bank int //保险柜
  18. NickName string //昵称
  19. FaceID int //头像ID
  20. FaceUrl string //头像URL
  21. VipLevel int //Vip等级
  22. Sex int //性别
  23. UserWords string //个性签名
  24. Code int //推荐码
  25. IsGuest int //是否游客
  26. TeacherID int //师父ID
  27. HigherUserID int // 上级用户ID
  28. Grade int // 代理等级
  29. ChipAmount int // 筹码
  30. ChipBank int // 筹码保险柜
  31. Currency string // 币种
  32. CurrencyIsModify int // 是否允许修改(1=允许修改 其他=禁止修改)
  33. UTMSource string // 注册流量渠道
  34. Charm int // 魅力值
  35. }
  36. type checkUserPassword struct {
  37. database.Trans_base
  38. IN checkUserPassword_in
  39. Out checkUserPassword_out
  40. }
  41. func NewCheckUserPassword() *checkUserPassword {
  42. return &checkUserPassword{}
  43. }
  44. func (this *checkUserPassword) DoAction(ch chan<- interface{}) {
  45. defer func() {
  46. if err := recover(); err != nil {
  47. log.Release("transaction recover %v", err)
  48. log.Release("%s", debug.Stack())
  49. }
  50. if ch != nil {
  51. ch <- this
  52. }
  53. }()
  54. statement := database.NewStatement()
  55. statement.SetNeedReturnValue(false)
  56. statement.SetOpenRecordSet(true)
  57. statement.SetProcName("WS_AllUser_CheckLogin")
  58. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.IN.UserID)
  59. statement.AddParamter("@EPassword", database.AdParamInput, database.AdVarChar, 64, this.IN.Password)
  60. sqlstring := statement.GenSql()
  61. jsonData := CenterDB.ExecSqlJson(sqlstring)
  62. var list []checkUserPassword_out
  63. if err := json.Unmarshal([]byte(jsonData), &list); err != nil {
  64. log.Release("checkUserPassword.transaction load json unmarshal err %v", err)
  65. log.Release(jsonData)
  66. this.State = false
  67. return
  68. }
  69. if len(list) == 0 {
  70. log.Release("checkUserPassword.transaction row count == 0")
  71. this.State = false
  72. return
  73. }
  74. this.State = true
  75. this.Out = list[0]
  76. }