fix: 游戏创建与打手详情接口未返回数据
AddGamesResp 加 Games 字段,创建后查询回填。Game.Id 加 optional 避免请求解析时要求传 id。getPlayerLogic 初始化 resp 避免 copier 写入 nil 指针。补跑 ent go generate 确保 userfollows schema 与 生成代码一致。
This commit is contained in:
@@ -16,7 +16,9 @@ import (
|
||||
func init() {
|
||||
userfollowsFields := schema.UserFollows{}.Fields()
|
||||
_ = userfollowsFields
|
||||
// userfollowsDescCreatedAt is the schema descriptor for created_at field.
|
||||
userfollowsDescCreatedAt := userfollowsFields[3].Descriptor()
|
||||
// userfollows.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
userfollows.DefaultCreatedAt = userfollowsDescCreatedAt.Default.(func() time.Time)
|
||||
userpreferencesFields := schema.UserPreferences{}.Fields()
|
||||
_ = userpreferencesFields
|
||||
|
||||
@@ -42,6 +42,7 @@ func ValidColumn(column string) bool {
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
)
|
||||
|
||||
|
||||
@@ -38,6 +38,14 @@ func (_c *UserFollowsCreate) SetCreatedAt(v time.Time) *UserFollowsCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
|
||||
func (_c *UserFollowsCreate) SetNillableCreatedAt(v *time.Time) *UserFollowsCreate {
|
||||
if v != nil {
|
||||
_c.SetCreatedAt(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetID sets the "id" field.
|
||||
func (_c *UserFollowsCreate) SetID(v int64) *UserFollowsCreate {
|
||||
_c.mutation.SetID(v)
|
||||
@@ -77,6 +85,7 @@ func (_c *UserFollowsCreate) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// defaults sets the default values of the builder before save.
|
||||
func (_c *UserFollowsCreate) defaults() {
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
v := userfollows.DefaultCreatedAt()
|
||||
|
||||
Reference in New Issue
Block a user