user.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package define
  2. import (
  3. "git.chuangxin1.com/csacred/toolkit/types"
  4. )
  5. // FormID http request form of id
  6. type FormID struct {
  7. ID int `json:"id" form:"id" db:"id"`
  8. }
  9. // FormUser http request from of user
  10. type FormUser struct {
  11. Page int `json:"page" db:"page" form:"page" validate:"required,gt=0"`
  12. PageSize int `json:"pagesize" db:"pagesize" form:"pagesize" validate:"required,gte=5,lte=100"`
  13. Code int `json:"code" db:"code" form:"code"`
  14. Name string `json:"name" db:"name" form:"name" validate:"max=20"`
  15. ID int `json:"id" db:"id" form:"id"`
  16. }
  17. // FormUserChangePwd http request from of user change password
  18. type FormUserChangePwd struct {
  19. OldPwd string `json:"passwd" form:"passwd" validate:"required,min=2,max=20"`
  20. NewPwd string `json:"newpasswd" form:"newpasswd" validate:"required,min=2,max=20"`
  21. NewPwdConfirm string `json:"passwdconfirm" form:"passwdconfirm" validate:"required,min=2,max=20"`
  22. }
  23. // FormUserSignIn http request from of user sign
  24. type FormUserSignIn struct {
  25. Name string `form:"name" db:"phone" validate:"required,min=2,max=20"`
  26. Password string `form:"passwd" validate:"required,min=2,max=20"`
  27. }
  28. // User user
  29. type User struct {
  30. ID int `json:"id"`
  31. Phone string `json:"phone"`
  32. Name string `json:"name"`
  33. Passwd string `json:"passwd"`
  34. Sex string `json:"sex"`
  35. Birthday types.DateText `json:"birthday"`
  36. //*
  37. Country types.NullInt `json:"country"`
  38. Province types.NullInt `json:"province"`
  39. City types.NullInt `json:"city"`
  40. Nation types.NullInt `json:"nation"`
  41. // */
  42. Avatar types.NullString `json:"avatar"`
  43. Signature types.NullString `json:"signature"`
  44. Category int `json:"category"`
  45. Scale int `json:"scale"`
  46. Score int `json:"score"`
  47. Balance float32 `json:"balance"`
  48. Status int `json:"status"`
  49. Stime string `json:"stime"`
  50. Attr types.JSONText `json:"attr"`
  51. }