peer.go 1.0 KB

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