peer.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. }
  15. type PeerBatchDeleteForm struct {
  16. RowIds []uint `json:"row_ids" validate:"required"`
  17. }
  18. // ToPeer
  19. func (f *PeerForm) ToPeer() *model.Peer {
  20. return &model.Peer{
  21. RowId: f.RowId,
  22. Id: f.Id,
  23. Cpu: f.Cpu,
  24. Hostname: f.Hostname,
  25. Memory: f.Memory,
  26. Os: f.Os,
  27. Username: f.Username,
  28. Uuid: f.Uuid,
  29. Version: f.Version,
  30. GroupId: f.GroupId,
  31. }
  32. }
  33. type PeerQuery struct {
  34. PageQuery
  35. TimeAgo int `json:"time_ago" form:"time_ago"`
  36. Id string `json:"id" form:"id"`
  37. Hostname string `json:"hostname" form:"hostname"`
  38. Uuids string `json:"uuids" form:"uuids"`
  39. }
  40. type SimpleDataQuery struct {
  41. Ids []string `json:"ids" form:"ids"`
  42. }