mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Lint models/token.go (#244)
This commit is contained in:
		@@ -28,14 +28,17 @@ type AccessToken struct {
 | 
				
			|||||||
	HasUsed           bool `xorm:"-"`
 | 
						HasUsed           bool `xorm:"-"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BeforeInsert will be invoked by XORM before inserting a record representing this object.
 | 
				
			||||||
func (t *AccessToken) BeforeInsert() {
 | 
					func (t *AccessToken) BeforeInsert() {
 | 
				
			||||||
	t.CreatedUnix = time.Now().Unix()
 | 
						t.CreatedUnix = time.Now().Unix()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BeforeUpdate is invoked from XORM before updating this object.
 | 
				
			||||||
func (t *AccessToken) BeforeUpdate() {
 | 
					func (t *AccessToken) BeforeUpdate() {
 | 
				
			||||||
	t.UpdatedUnix = time.Now().Unix()
 | 
						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) {
 | 
					func (t *AccessToken) AfterSet(colName string, _ xorm.Cell) {
 | 
				
			||||||
	switch colName {
 | 
						switch colName {
 | 
				
			||||||
	case "created_unix":
 | 
						case "created_unix":
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user