1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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"`
- Sshcommand string `p:"sshcommand"`
- Sshpassword string `p:"sshpassword"`
- Sshusername string `p:"sshusername"`
- }
- 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
- }
|