mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
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
16 lines
609 B
Go
16 lines
609 B
Go
package models
|
|
|
|
import contractmodels "github.com/go-admin-team/go-admin-core/v2/sdk/contract/models"
|
|
|
|
// Directory, Menu and Button are the menu type enum values used by
|
|
// sys_menu.menu_type, referenced directly from go-admin-core's
|
|
// sdk/contract/models rather than restated as literals: PRD 006's hard
|
|
// constraint 4 requires `const X = pkg.X` for exactly this reason - two
|
|
// independently written copies of the same value can be edited out of step,
|
|
// where a direct reference cannot.
|
|
const (
|
|
Directory = contractmodels.Directory
|
|
Menu = contractmodels.Menu
|
|
Button = contractmodels.Button
|
|
)
|