webforwarding.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. CreatedAt time.Time
  19. UpdatedAt time.Time
  20. }
  21. func (m *WebForwarding) TableName() string {
  22. return "shd_waf_web"
  23. }
  24. // WebForwardingRule 用于存储Web转发规则
  25. type WebForwardingRule struct {
  26. ID primitive.ObjectID `bson:"_id,omitempty"`
  27. Uid int `bson:"uid" json:"uid"`
  28. HostId int `bson:"host_id" json:"host_id"`
  29. WebId int `bson:"web_id" json:"web_id"`
  30. CdnOriginIds map[string]int64 `bson:"cdn_origin_ids" json:"cdn_origin_ids"`
  31. BackendList []v1.BackendList `bson:"backend_list" json:"backend_list"`
  32. CreatedAt time.Time `bson:"created_at" json:"created_at"`
  33. UpdatedAt time.Time `bson:"updated_at" json:"updated_at"`
  34. }
  35. func (m *WebForwardingRule) CollectionName() string {
  36. return "web_forwarding_rules"
  37. }