27 lines
952 B
Go
27 lines
952 B
Go
package model
|
||
|
||
import (
|
||
"time"
|
||
|
||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||
)
|
||
|
||
// Application 表示接入应用,承载通用应用身份与启停配置。
|
||
// 对应表 orbit_applications;这是服务端持久化模型,不直接作为 API 响应。
|
||
type Application struct {
|
||
// ID 应用标识,全局唯一。
|
||
ID core.ID `db:"id"`
|
||
// Revision 乐观并发版本,从 1 开始;更新时必须核对预期版本。
|
||
Revision uint64 `db:"revision"`
|
||
// CreatedAt 创建时间,统一 UTC,数据库精度为微秒。
|
||
CreatedAt time.Time `db:"created_at"`
|
||
// UpdatedAt 最后写入时间,统一 UTC;不能代替并发版本。
|
||
UpdatedAt time.Time `db:"updated_at"`
|
||
// Name 可读名称,唯一性范围由对应数据表约束。
|
||
Name string `db:"name"`
|
||
// Enabled 是否启用;关闭后拒绝相应的新接入或新操作。
|
||
Enabled bool `db:"enabled"`
|
||
}
|
||
|
||
func (Application) TableName() string { return "orbit_applications" }
|