common.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package request
  2. import "server/dao"
  3. // PageInfo Paging common input parameter structure
  4. type PageInfo struct {
  5. Page int `json:"page" form:"page"` // 页码
  6. PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
  7. Keyword string `json:"keyword" form:"keyword"` //关键字
  8. }
  9. // GetById Find by id structure
  10. type GetById struct {
  11. ID int `json:"id" form:"id"` // 主键ID
  12. }
  13. func (r *GetById) Uint() uint {
  14. return uint(r.ID)
  15. }
  16. type IdsReq struct {
  17. Ids []int `json:"ids" form:"ids"`
  18. }
  19. // GetAuthorityId Get role by id structure
  20. type GetAuthorityId struct {
  21. AuthorityId uint `json:"authorityId" form:"authorityId"` // 角色ID
  22. }
  23. type DeviceSearch struct {
  24. PageInfo PageInfo `json:"pageInfo" form:"pageInfo"` // 分页信息
  25. Sn string `json:"sn" form:"sn"` //设备sn
  26. Name string `json:"name" form:"name"` // 设备名称
  27. Genre int `json:"genre" form:"genre"` //设备类型
  28. }
  29. type TunnelSearch struct {
  30. PageInfo PageInfo `json:"pageInfo" form:"pageInfo"` // 分页信息
  31. Name string `json:"name" form:"name"` //隧道名称
  32. UserId int `json:"userId" form:"userId"` //
  33. RegionId int `json:"regionId" form:"regionId"`
  34. }
  35. type RegionTunnelsId struct {
  36. TunnelIds []int `json:"tunnelIds" form:"tunnelIds"`
  37. RegionId int `json:"regionId" form:"regionId"`
  38. }
  39. type EditTactics struct {
  40. Sn string `json:"sn" form:"sn"`
  41. Tactics int `json:"tactics" form:"tactics"`
  42. }
  43. type UserTunnels struct {
  44. User dao.SysUser `json:"user" form:"user"`
  45. TunnelIds []int `json:"tunnelIds" form:"tunnelIds"`
  46. }
  47. type Empty struct{}