Browse Source

Lint models/admin.go

for-closed-social
Bwko 8 years ago
parent
commit
d8e11a8eaa
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      models/admin.go

+ 4
- 0
models/admin.go View File

@ -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
)
@ -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":

Loading…
Cancel
Save