com.go 844 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package tables
  2. type WineWithIdRemain struct {
  3. Id uint16 `json:"id"`
  4. Remain uint16 `json:"remain"`
  5. }
  6. type WineWithIdNameRemain struct {
  7. Id uint16 `json:"id"`
  8. Name string `json:"name"`
  9. Remain uint16 `json:"remain"`
  10. }
  11. type idTotal struct {
  12. Id string `json:"id"`
  13. Total uint64 `json:"total"`
  14. }
  15. type idNameTotal struct {
  16. Id string `json:"id"`
  17. Name string `json:"name"`
  18. Total uint64 `json:"total"`
  19. }
  20. type timeTotal struct {
  21. Time string `json:"time"`
  22. Total uint64 `json:"total"`
  23. }
  24. // 0:不限、1:一周、2:一月、3:一季、4:半年、5:一年
  25. func getAlignDays(kind uint8) (string, uint16) {
  26. switch kind {
  27. case 1:
  28. return "%Y-%m-%d", 7
  29. case 2:
  30. return "%Y-%m-%d", 30
  31. case 3:
  32. return "%Y-%m", 120
  33. case 4:
  34. return "%Y-%m", 180
  35. case 5:
  36. return "%Y-%m", 360
  37. default:
  38. return "%Y-%m-%d", 7
  39. }
  40. }