webforwarding.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package model
  2. import (
  3. v1 "github.com/go-nunu/nunu-layout-advanced/api/v1"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. "time"
  6. )
  7. type WebForwarding struct {
  8. Id int `gorm:"primary"`
  9. HostId int `gorm:"not null"`
  10. CdnWebId int `gorm:"not null"`
  11. Port string `gorm:"not null"`
  12. Domain string `gorm:"null"`
  13. IsHttps int `gorm:"null"`
  14. Comment string `gorm:"null"`
  15. HttpsCert string `gorm:"null"`
  16. HttpsKey string `gorm:"null"`
  17. SslCertId int `gorm:"null"`
  18. Proxy bool `gorm:"null"`
  19. CreatedAt time.Time
  20. UpdatedAt time.Time
  21. }
  22. func (m *WebForwarding) TableName() string {
  23. return "shd_waf_web"
  24. }
  25. // WebForwardingRule 用于存储Web转发规则
  26. type WebForwardingRule struct {
  27. ID primitive.ObjectID `bson:"_id,omitempty"`
  28. Uid int `bson:"uid" json:"uid"`
  29. HostId int `bson:"host_id" json:"host_id"`
  30. WebId int `bson:"web_id" json:"web_id"`
  31. CdnOriginIds map[string]int64 `bson:"cdn_origin_ids" json:"cdn_origin_ids"`
  32. BackendList []v1.BackendList `bson:"backend_list" json:"backend_list"`
  33. CreatedAt time.Time `bson:"created_at" json:"created_at"`
  34. UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
  35. }
  36. func (m *WebForwardingRule) CollectionName() string {
  37. return "web_forwarding_rules"
  38. }