123456789101112131415161718192021222324252627282930 |
- package dto
- import (
- "github.com/gin-gonic/gin"
- )
- type AddNodeInput struct {
- Name string `form:"name" json:"name" comment:"服务器名称" validate:"required"`
- Host string `form:"host" json:"host" comment:"服务器IP" validate:""`
- Port int `form:"port" json:"port" comment:"端口" validate:""`
- Url string `form:"url" json:"url" comment:"更换服务器地址" validate:"required"`
- }
- func (params *AddNodeInput) BindingValidParams(c *gin.Context) error {
- if err := c.ShouldBind(params); err != nil {
- return err
- }
- return nil
- }
- type RemoveNodeInput struct {
- Host string `form:"host" json:"host" comment:"host" validate:"required"`
- }
- func (params *RemoveNodeInput) BindingValidParams(c *gin.Context) error {
- if err := c.ShouldBind(params); err != nil {
- return err
- }
- return nil
- }
|