You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

issue_watch.go 559 B

1234567891011121314151617181920
  1. package models
  2. import (
  3. "time"
  4. )
  5. // IssueWatch is connection request for receiving issue notification.
  6. type IssueWatch struct {
  7. ID int64 `xorm:"pk autoincr"`
  8. UserID int64 `xorm:"UNIQUE(watch) NOT NULL"`
  9. IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"`
  10. IsWatching bool `xorm:"NOT NULL"`
  11. Created time.Time `xorm:"-"`
  12. CreatedUnix int64 `xorm:"NOT NULL"`
  13. }
  14. // BeforeInsert is invoked from XORM before inserting an object of this type.
  15. func (iw *IssueWatch) BeforeInsert() {
  16. iw.CreatedUnix = time.Now().Unix()
  17. }