add i18n support

This commit is contained in:
landaiqing
2024-11-12 22:59:39 +08:00
parent 97ca3fc7b0
commit ae743ba8a6
62 changed files with 4468 additions and 2797 deletions

View File

@@ -1,13 +1,15 @@
package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
"schisandra-album-cloud-microservices/common/ent/schema/mixin"
)
// ScaAuthUser holds the schema definition for the ScaAuthUser entity.
@@ -15,6 +17,12 @@ type ScaAuthUser struct {
ent.Schema
}
func (ScaAuthUser) Mixin() []ent.Mixin {
return []ent.Mixin{
mixin.DefaultMixin{},
}
}
// Fields of the ScaAuthUser.
func (ScaAuthUser) Fields() []ent.Field {
return []ent.Field{
@@ -64,18 +72,6 @@ func (ScaAuthUser) Fields() []ent.Field {
MaxLen(255).
Optional().
Comment("介绍"),
field.Time("created_at").
Default(time.Now).
Immutable().
Comment("创建时间"),
field.Time("update_at").
Default(time.Now).UpdateDefault(time.Now).
Nillable().
Optional().
Comment("更新时间"),
field.Int8("deleted").
Default(0).
Comment("是否删除 0 未删除 1 已删除"),
field.String("blog").
MaxLen(30).
Nillable().
@@ -90,7 +86,10 @@ func (ScaAuthUser) Fields() []ent.Field {
MaxLen(50).
Nillable().
Optional().
Comment("公司"),
Comment("公司").
Annotations(
entsql.WithComments(true),
),
}
}
@@ -113,3 +112,14 @@ func (ScaAuthUser) Indexes() []ent.Index {
Unique(),
}
}
// Annotations of the ScaAuthUser.
func (ScaAuthUser) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.WithComments(true),
schema.Comment("用户表"),
entsql.Annotation{
Table: "sca_auth_user",
},
}
}