feat: add entgo mixin and sonyflake.
This commit is contained in:
@@ -12,8 +12,8 @@ type CreateBy struct{ mixin.Schema }
|
||||
|
||||
func (CreateBy) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("create_by").
|
||||
Comment("创建者").
|
||||
field.Uint32("create_by").
|
||||
Comment("创建者ID").
|
||||
Optional().
|
||||
Nillable(),
|
||||
}
|
||||
@@ -25,8 +25,8 @@ type UpdateBy struct{ mixin.Schema }
|
||||
|
||||
func (UpdateBy) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("update_by").
|
||||
Comment("更新者").
|
||||
field.Uint32("update_by").
|
||||
Comment("更新者ID").
|
||||
Optional().
|
||||
Nillable(),
|
||||
}
|
||||
@@ -38,8 +38,8 @@ type DeleteBy struct{ mixin.Schema }
|
||||
|
||||
func (DeleteBy) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("delete_by").
|
||||
Comment("删除者").
|
||||
field.Uint32("delete_by").
|
||||
Comment("删除者ID").
|
||||
Optional().
|
||||
Nillable(),
|
||||
}
|
||||
@@ -51,8 +51,8 @@ type CreatedBy struct{ mixin.Schema }
|
||||
|
||||
func (CreatedBy) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("created_by").
|
||||
Comment("创建者").
|
||||
field.Uint32("created_by").
|
||||
Comment("创建者ID").
|
||||
Optional().
|
||||
Nillable(),
|
||||
}
|
||||
@@ -64,8 +64,8 @@ type UpdatedBy struct{ mixin.Schema }
|
||||
|
||||
func (UpdatedBy) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("updated_by").
|
||||
Comment("更新者").
|
||||
field.Uint32("updated_by").
|
||||
Comment("更新者ID").
|
||||
Optional().
|
||||
Nillable(),
|
||||
}
|
||||
@@ -77,8 +77,8 @@ type DeletedBy struct{ mixin.Schema }
|
||||
|
||||
func (DeletedBy) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("deleted_by").
|
||||
Comment("删除者").
|
||||
field.Uint32("deleted_by").
|
||||
Comment("删除者ID").
|
||||
Optional().
|
||||
Nillable(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user