24 lines
845 B
Go
24 lines
845 B
Go
|
package models
|
||
|
|
||
|
import (
|
||
|
"gorm.io/gorm"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
var RecordNotFound = gorm.ErrRecordNotFound
|
||
|
|
||
|
type Model struct {
|
||
|
ID uint64 `json:"id" gorm:"primary_key;AUTO_INCREMENT"` // 数据库记录编号
|
||
|
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||
|
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||
|
DeletedAt *time.Time `json:"-" sql:"index"` // 删除时间
|
||
|
}
|
||
|
|
||
|
type Response struct {
|
||
|
// 数据集
|
||
|
RequestId string `protobuf:"bytes,1,opt,name=requestId,proto3" json:"requestId,omitempty"`
|
||
|
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
|
||
|
Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
|
||
|
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
|
||
|
}
|