mirror of
1
Fork 0

Lint models/token.go (#244)

This commit is contained in:
Bwko 2016-11-25 09:03:52 +01:00 committed by Lunny Xiao
parent 6a28909f40
commit 081c2a9395
1 changed files with 3 additions and 0 deletions

View File

@ -28,14 +28,17 @@ type AccessToken struct {
HasUsed bool `xorm:"-"`
}
// BeforeInsert will be invoked by XORM before inserting a record representing this object.
func (t *AccessToken) BeforeInsert() {
t.CreatedUnix = time.Now().Unix()
}
// BeforeUpdate is invoked from XORM before updating this object.
func (t *AccessToken) BeforeUpdate() {
t.UpdatedUnix = time.Now().Unix()
}
// AfterSet is invoked from XORM after setting the value of a field of this object.
func (t *AccessToken) AfterSet(colName string, _ xorm.Cell) {
switch colName {
case "created_unix":