shorturl.go 657 B

12345678910111213141516171819202122232425262728293031
  1. package model
  2. import xtime "go-common/library/time"
  3. const (
  4. StateNormal = 0
  5. StateDelted = 1
  6. )
  7. type ShortUrl struct {
  8. ID int64 `json:"id"`
  9. Mid int64 `json:"mid"`
  10. Short string `json:"short"`
  11. Long string `json:"long"`
  12. State int8 `json:"state"`
  13. CTime xtime.Time `json:"-"`
  14. MTime xtime.Time `json:"-"`
  15. CreateTime string `json:"ctime"`
  16. }
  17. type Param struct {
  18. ID int64 `form:"id"`
  19. Mid int64 `form:"mid"`
  20. Uri string `form:"url"`
  21. Pn string `form:"pn"`
  22. Ps string `form:"ps"`
  23. }
  24. func (s *ShortUrl) FormatDate() {
  25. s.CreateTime = s.CTime.Time().Format("2006-01-02 15:04:05")
  26. }