node.go 891 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package v1
  2. import (
  3. "github.com/gogf/gf/v2/frame/g"
  4. "nodeMonitor/internal/model/entity"
  5. )
  6. type NodeReq struct {
  7. g.Meta `path:"/add" tags:"add" method:"post" summary:"增加节点"`
  8. Name string `p:"name" v:"required#节点名称不能为空"`
  9. Host string `p:"host" v:"required#节点不能为空"`
  10. Port int `p:"port" v:"required#节点端口不能为空"`
  11. Url string `p:"url"`
  12. }
  13. type NodeRes struct {
  14. //g.Meta `mime:"application/json"`
  15. }
  16. type NodeDelReq struct {
  17. g.Meta `path:"/del" tags:"del" method:"post" summary:"删除节点"`
  18. Host string `p:"host" v:"required#节点不能为空"`
  19. }
  20. type NodeDelRes struct {
  21. //g.Meta `mime:"application/json"`
  22. }
  23. type NodeAllReq struct {
  24. g.Meta `path:"/all" tags:"del" method:"get" summary:"获取全部节点"`
  25. }
  26. type NodeALlRes struct {
  27. g.Meta `mime:"application/json"`
  28. NodeList []*entity.Node `json:"nodeList"`
  29. }