webForwarding.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package v1
  2. type WebForwardingDataRequest struct {
  3. Id int `form:"id" json:"id"`
  4. CdnWebId int `form:"cdnWebId" json:"cdnWebId"`
  5. Port string `form:"port" json:"port" validate:"required,numeric,min=1,max=65535"`
  6. Domain string `form:"domain" json:"domain" validate:"omitempty,idn_fqdn|ip"`
  7. BackendList []BackendList `form:"backendList" json:"backendList" validate:"required,dive"`
  8. IsHttps int `form:"isHttps" json:"isHttps" default:"0"`
  9. Comment string `form:"comment" json:"comment" validate:"max=50"`
  10. HttpsCert string `form:"httpsCert" json:"httpsCert"`
  11. HttpsKey string `form:"httpsKey" json:"httpsKey"`
  12. SslCertId int64 `form:"sslCertId" json:"sslCertId"`
  13. }
  14. type DeleteWebForwardingRequest struct {
  15. Ids []int `form:"ids" json:"ids" validate:"required,min=1,dive,required"`
  16. Uid int `form:"uid" json:"uid" validate:"required"`
  17. HostId int `form:"hostId" json:"hostId" validate:"required"`
  18. }
  19. type WebForwardingRequest struct {
  20. HostId int `form:"hostId" json:"hostId" validate:"required"`
  21. Uid int `form:"uid" json:"uid" validate:"required"`
  22. WebForwardingData WebForwardingDataRequest `form:"data" json:"data" validate:"required"`
  23. }
  24. type BackendList struct {
  25. Addr string `json:"addr,omitempty" form:"addr" validate:"required,hostport"`
  26. CustomHost string `json:"customHost,omitempty" form:"customHost" validate:"omitempty,idn_fqdn"`
  27. IsHttps int `json:"isHttps,omitempty" form:"isHttps" default:"0"`
  28. }