Files
go-admin/common/models/by.go
zhangwenjian 2840010dfd refactor🎨: turn common/models into a thin alias of go-admin-core
ControlBy, Model, ModelTime, ActiveRecord, BaseUser, Response, Page,
Migration and the menu type constants now read `type X = pkg.X` /
`const X = pkg.X` against go-admin-core's sdk/contract/models instead
of defining these shapes locally. Every embed, GORM tag and JSON tag
is unchanged - a type alias is the same type, not a new one - and
every existing import of go-admin/common/models keeps compiling with
no changes of its own (verified with `git diff --exit-code` over the
70 files that import common/models, common/dto or common/actions).

The menu type constants (Directory/Menu/Button) are declared as direct
references rather than restated literals: an independently written
copy of the same value can be edited out of step with go-admin-core's,
where a direct reference cannot (PRD 006 hard constraint 4).

PRD 006 F1/F5.

Claude-Session: https://claude.ai/code/session_01HPTAw8b8tAdFNFn8rKdPYx
2026-09-05 10:15:51 +08:00

14 lines
474 B
Go

package models
import contractmodels "github.com/go-admin-team/go-admin-core/v2/sdk/contract/models"
// ControlBy, Model and ModelTime are thin aliases of go-admin-core's
// sdk/contract/models (PRD 006 F1/F5). A type alias is the same type, not a
// new one, so every model that embeds these keeps its GORM tags, JSON tags
// and method set untouched.
type (
ControlBy = contractmodels.ControlBy
Model = contractmodels.Model
ModelTime = contractmodels.ModelTime
)