de32143b6d
updateMeLogic 更新后重新查询并返回 User 类型,修复 converter 转换 空响应的错误。proto_string 不再丢弃含空格的字符串。userfollows ent schema 补上 created_at 的 Default(time.Now)。
28 lines
535 B
Go
28 lines
535 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
"time"
|
|
)
|
|
|
|
// UserFollows holds the schema definition for the UserFollows entity.
|
|
type UserFollows struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the UserFollows.
|
|
func (UserFollows) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int64("id").Immutable().Unique(),
|
|
field.Int64("follower_id"),
|
|
field.Int64("followee_id"),
|
|
field.Time("created_at").Immutable().Default(time.Now),
|
|
}
|
|
}
|
|
|
|
// Edges of the UserFollows.
|
|
func (UserFollows) Edges() []ent.Edge {
|
|
return nil
|
|
}
|