Skip to content

Commit

Permalink
Merge pull request #241 from Bwko/lint/admin.go
Browse files Browse the repository at this point in the history
Lint models/admin.go
  • Loading branch information
tboerger committed Nov 25, 2016
2 parents 21b7d30 + d8e11a8 commit 574e49c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import (
"code.gitea.io/gitea/modules/setting"
)

//NoticeType describes the notice type
type NoticeType int

const (
//NoticeRepository type
NoticeRepository NoticeType = iota + 1
)

Expand All @@ -33,10 +35,12 @@ type Notice struct {
CreatedUnix int64
}

// BeforeInsert is invoked from XORM before inserting an object of this type.
func (n *Notice) BeforeInsert() {
n.CreatedUnix = time.Now().Unix()
}

// AfterSet is invoked from XORM after setting the value of a field of this object.
func (n *Notice) AfterSet(colName string, _ xorm.Cell) {
switch colName {
case "created_unix":
Expand Down

0 comments on commit 574e49c

Please sign in to comment.