nezha/model/common.go
2024-10-20 14:05:43 +08:00

23 lines
570 B
Go

package model
import (
"time"
"gorm.io/gorm"
)
const CtxKeyAuthorizedUser = "ckau"
type Common struct {
ID uint64 `gorm:"primaryKey" json:"id,omitempty"`
CreatedAt time.Time `gorm:"index;<-:create" json:"created_at,omitempty"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at,omitempty"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
}
type Response struct {
Code int `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Result interface{} `json:"result,omitempty"`
}