2019-12-08 16:59:58 +08:00
|
|
|
package model
|
|
|
|
|
2022-04-26 12:46:44 +08:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
2019-12-08 16:59:58 +08:00
|
|
|
|
2024-11-22 00:19:36 +08:00
|
|
|
const (
|
|
|
|
CtxKeyAuthorizedUser = "ckau"
|
|
|
|
CtxKeyRealIPStr = "ckri"
|
|
|
|
)
|
|
|
|
|
|
|
|
type CtxKeyRealIP struct{}
|
2019-12-08 16:59:58 +08:00
|
|
|
|
|
|
|
type Common struct {
|
2024-11-19 21:41:21 +08:00
|
|
|
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"`
|
|
|
|
// Do not use soft deletion
|
|
|
|
// DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
|
2019-12-08 16:59:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type Response struct {
|
2021-08-10 20:13:17 +08:00
|
|
|
Code int `json:"code,omitempty"`
|
2019-12-08 16:59:58 +08:00
|
|
|
Message string `json:"message,omitempty"`
|
|
|
|
Result interface{} `json:"result,omitempty"`
|
|
|
|
}
|