peer.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package admin
  2. import "github.com/lejianwen/rustdesk-api/v2/model"
  3. type PeerForm struct {
  4. RowId uint `json:"row_id" `
  5. Id string `json:"id"`
  6. Cpu string `json:"cpu"`
  7. Hostname string `json:"hostname"`
  8. Memory string `json:"memory"`
  9. Os string `json:"os"`
  10. Username string `json:"username"`
  11. Uuid string `json:"uuid"`
  12. Version string `json:"version"`
  13. GroupId uint `json:"group_id"`
  14. Alias string `json:"alias"`
  15. }
  16. type PeerBatchDeleteForm struct {
  17. RowIds []uint `json:"row_ids" validate:"required"`
  18. }
  19. // ToPeer
  20. func (f *PeerForm) ToPeer() *model.Peer {
  21. return &model.Peer{
  22. RowId: f.RowId,
  23. Id: f.Id,
  24. Cpu: f.Cpu,
  25. Hostname: f.Hostname,
  26. Memory: f.Memory,
  27. Os: f.Os,
  28. Username: f.Username,
  29. Uuid: f.Uuid,
  30. Version: f.Version,
  31. GroupId: f.GroupId,
  32. Alias: f.Alias,
  33. }
  34. }
  35. type PeerQuery struct {
  36. PageQuery
  37. TimeAgo int `json:"time_ago" form:"time_ago"`
  38. Id string `json:"id" form:"id"`
  39. Hostname string `json:"hostname" form:"hostname"`
  40. Uuids string `json:"uuids" form:"uuids"`
  41. Ip string `json:"ip" form:"ip"`
  42. Username string `json:"username" form:"username"`
  43. Alias string `json:"alias" form:"alias"`
  44. }
  45. type SimpleDataQuery struct {
  46. Ids []string `json:"ids" form:"ids"`
  47. }