status.go 534 B

12345678910111213141516171819202122232425262728293031
  1. package publish
  2. // @snippet_begin(PublishStatus)
  3. const (
  4. StatusDraft = "draft"
  5. StatusOnline = "online"
  6. StatusOffline = "offline"
  7. )
  8. type Status struct {
  9. Status string `gorm:"default:'draft'"`
  10. OnlineUrl string
  11. }
  12. // @snippet_end
  13. func (status Status) GetStatus() string {
  14. return status.Status
  15. }
  16. func (status Status) GetOnlineUrl() string {
  17. return status.OnlineUrl
  18. }
  19. func (status *Status) SetStatus(s string) {
  20. status.Status = s
  21. }
  22. func (status *Status) SetOnlineUrl(onlineUrl string) {
  23. status.OnlineUrl = onlineUrl
  24. }