123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- package v1
- import (
- "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/v2/os/gcron"
- "nodeMonitor/internal/model"
- "nodeMonitor/internal/model/entity"
- )
- type NodeReq struct {
- g.Meta `path:"/add" tags:"add" method:"post" summary:"增加节点"`
- Name string `p:"name" v:"required#节点名称不能为空"`
- Host string `p:"host" v:"required#节点不能为空"`
- Port int `p:"port"`
- Url string `p:"url"`
- PingType int `p:"pingType"`
- }
- type NodeRes struct {
- //g.Meta `mime:"application/json"`
- }
- type NodeEditReq struct {
- g.Meta `path:"/edit" tags:"edit" method:"post" summary:"编辑"`
- Id int `p:"id" v:"required#节点ID不能为空"`
- Name string `p:"name" v:"required#节点名称不能为空"`
- Host string `p:"host" v:"required#节点不能为空"`
- Port int `p:"port"`
- Url string `p:"url"`
- PingType int `p:"pingType"`
- UrlStatus int `p:"urlstatus"`
- }
- type NodeEditRes struct {
- }
- type NodeDelReq struct {
- g.Meta `path:"/del" tags:"del" method:"post" summary:"删除节点"`
- Id int `p:"id" v:"required#节点Id不能为空"`
- }
- type NodeDelRes struct {
- //g.Meta `mime:"application/json"`
- }
- type NodeAllReq struct {
- g.Meta `path:"/all" tags:"all" method:"get" summary:"获取全部节点"`
- }
- type NodeALlRes struct {
- g.Meta `mime:"application/json"`
- NodeList []*entity.Node `json:"nodeList"`
- }
- type NodeCronStartReq struct {
- g.Meta `path:"/start" tags:"start" method:"post" summary:"开始PING任务"`
- StartTime int `p:"startTime"`
- }
- type NodeCronStartRes struct {
- g.Meta `mime:"application/json"`
- RetEntry []*gcron.Entry
- RetCronCount int
- Status bool
- }
- type NodeCronStopReq struct {
- g.Meta `path:"/stop" tags:"stop" method:"post" summary:"停止PING任务"`
- Remove bool `p:"remove"`
- }
- type NodeCronStopRes struct {
- g.Meta `mime:"application/json"`
- RetCronCount int
- Status bool
- }
- type NodeCronStatusReq struct {
- g.Meta `path:"/task" tags:"task" method:"get" summary:"查看任务状态"`
- }
- type NodeCronStatusRes struct {
- g.Meta `mime:"application/json"`
- RetEntry []*gcron.Entry
- RetCronCount int
- }
- type NodeStatusReq struct {
- g.Meta `path:"/nodestatus" tags:"nodestatus" method:"get" summary:"查看任务状态"`
- }
- type NodeStatusRes struct {
- NodeItme []*model.UserItem
- }
- type NodeConfigReq struct {
- g.Meta `path:"/nodeconfig" tags:"nodeconfig" method:"get" summary:"节点配置请求"`
- ServerId int `p:"serverid"`
- SshCom string `p:"sshcom"`
- SshPass string `p:"sshpass"`
- SshUser string `p:"sshuser"`
- }
- type NodeConfigRes struct {
- }
|