player_material.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package forms
  2. type PlayerPassRoom struct {
  3. ID uint `json:"id"`
  4. Count int `json:"count"`
  5. Difficulty int `json:"difficulty"`
  6. Pass bool `json:"pass"`
  7. IsActivity bool `json:"isActivity"`
  8. YearDay int `json:"yd"`
  9. EnterCount int `json:"ec"`
  10. }
  11. type DropTalent struct {
  12. ID uint `json:"id"`
  13. Count int `json:"level"`
  14. }
  15. type DropedRoles struct {
  16. ID int64 `json:"id"`
  17. Wear bool `json:"wear"`
  18. }
  19. // DropEquipment 装备
  20. type DropEquipment struct {
  21. GID string `json:"id"`
  22. EID int64 `json:"equipId"`
  23. Wear bool `json:"wear"`
  24. }
  25. // PlayerTalent 天赋
  26. type PlayerTalent struct {
  27. ID int `json:"id"`
  28. Level int `json:"level"`
  29. }
  30. // DropMaterial 掉落物品
  31. type DropMaterial struct {
  32. ID int64 `json:"id"`
  33. Count int `json:"count"`
  34. }
  35. // ExpireMaterial 购买商品,如会员 是否有会员根据里面是否有数据判断
  36. type ExpireMaterial struct {
  37. ID int64 `json:"id"`
  38. StartTime int64 `json:"startTime"`
  39. EndTime int64 `json:"endTime"`
  40. LastReward int64 `json:"lastReward"`
  41. }
  42. type PlayerMaterialModel struct {
  43. ID int64 `json:"id"`
  44. Playerid int64 `json:"playerid"`
  45. Coin int64 `json:"coin"`
  46. Diamond int32 `json:"diamond"`
  47. Equipments map[string]*DropEquipment `json:"equipments"`
  48. Materials map[int64]*DropMaterial `json:"materials"`
  49. Roles []*DropedRoles `json:"roles"`
  50. Talents map[int]int `json:"talents"`
  51. PassRoom []*PlayerPassRoom `json:"passRoom"`
  52. RoleRes map[int]int `json:"roleRes"`
  53. BuffMaterials []*ExpireMaterial `json:"buffMaterials"`
  54. AdLimit string `json:"adLimit"`
  55. }
  56. type PlayerEquipmentsReq struct {
  57. ListReq
  58. PlayerId int64 `json:"playerid" form:"playerid" binding:"required"`
  59. }
  60. type PlayerEquipmentsRes struct {
  61. ListRes
  62. }
  63. type DropEquipmentList []DropEquipment
  64. func (de DropEquipmentList) Len() int {
  65. return len(de)
  66. }
  67. func (de DropEquipmentList) Less(i, j int) bool {
  68. return de[i].EID < de[j].EID
  69. }
  70. func (de DropEquipmentList) Swap(i, j int) {
  71. de[i], de[j] = de[j], de[i]
  72. }