account_group.go 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * @description:账号组相关
  3. * @Author: CP
  4. * @Date: 2020-10-10 16:00:05
  5. * @FilePath: \construction_management\comm\account_group.go
  6. */
  7. package comm
  8. import "errors"
  9. type AccountGroup struct {
  10. JSDW int
  11. JLDW int
  12. SGDW int
  13. SJDW int
  14. DJDW int
  15. GZSJ int
  16. QT int
  17. }
  18. func NewAccountGroup() *AccountGroup {
  19. return &AccountGroup{
  20. JSDW: 1,
  21. JLDW: 2,
  22. SGDW: 3,
  23. SJDW: 4,
  24. DJDW: 5,
  25. GZSJ: 6,
  26. QT: 7,
  27. }
  28. }
  29. // 验证输入
  30. func (a *AccountGroup) ValidRule(index int) error {
  31. if a.JSDW == index || a.JLDW == index || a.SGDW == index || a.SJDW == index || a.DJDW == index || a.GZSJ == index || a.QT == index {
  32. return nil
  33. } else {
  34. return errors.New("账号组不正确")
  35. }
  36. }
  37. // ID转文字描述
  38. // const AccountGroup:=map[string]int{
  39. // "JSDW": 1,
  40. // "JLDW": 2,
  41. // "SGDW": 3,
  42. // "SJDW": 4,
  43. // "DJDW": 5,
  44. // "GZSJ": 6,
  45. // "QT": 7,
  46. // }
  47. // const Group:=[...]string{
  48. // AccountGroup.
  49. // }