fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
+10
-11
@@ -10,33 +10,32 @@ import (
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// Api API接口定义,用于权限系统中注册可受控的HTTP接口
|
||||
// Api holds the schema definition for the Api entity.
|
||||
type Api struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (Api) Annotations() []schema.Annotation {
|
||||
return []schema.Annotation{
|
||||
entsql.Annotation{
|
||||
Table: "api",
|
||||
Options: "COMMENT='API接口表,注册系统中可受权限控制的HTTP接口,配合RBAC使用'",
|
||||
},
|
||||
entsql.Annotation{Table: "api"},
|
||||
entsql.WithComments(true),
|
||||
}
|
||||
}
|
||||
|
||||
// Fields of the Api.
|
||||
func (Api) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("id").Positive().Comment("主键ID"),
|
||||
field.String("path").MaxLen(100).NotEmpty().Comment("API路径,如 /api/v1/users"),
|
||||
field.String("method").MaxLen(20).NotEmpty().Comment("请求方法:GET/POST/PUT/DELETE"),
|
||||
field.String("description").MaxLen(60).Optional().Comment("接口功能描述"),
|
||||
field.Time("createdAt").Default(time.Now).Immutable().Comment("创建时间"),
|
||||
field.Int("id").Positive(),
|
||||
field.String("path").MaxLen(100).NotEmpty().Comment("api路径"),
|
||||
field.String("method").MaxLen(20).NotEmpty().Comment("api请求方法"),
|
||||
field.String("description").MaxLen(60).Optional().Comment("api描述"),
|
||||
field.Time("createdAt").Default(time.Now).Immutable().Comment("创建时间"), // 创建时间
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the Api.
|
||||
func (Api) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("permissions", Permission.Type).Ref("apis").Comment("关联的权限项"),
|
||||
edge.From("permissions", Permission.Type).Ref("apis"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user