summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorThomas Boerger <thomas@webhippie.de>2016-11-25 12:55:24 +0100
committerGitHub <noreply@github.com>2016-11-25 12:55:24 +0100
commit574e49c8548726cc1b76d6544df770fb38af2952 (patch)
treeed8836793725f735c4708df0909f4b295db1ff35 /models
parent21b7d30174b7f6b1c369e7e8c5fbc69b051c1c81 (diff)
parentd8e11a8eaa0a8712024426348d4f7b430cea9e3a (diff)
downloadgitea-574e49c8548726cc1b76d6544df770fb38af2952.tar.gz
gitea-574e49c8548726cc1b76d6544df770fb38af2952.zip
Merge pull request #241 from Bwko/lint/admin.go
Lint models/admin.go
Diffstat (limited to 'models')
-rw-r--r--models/admin.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/admin.go b/models/admin.go
index 14a0e8d009..058e9be8a8 100644
--- a/models/admin.go
+++ b/models/admin.go
@@ -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":