f0048f9e12
AddGamesResp 加 Games 字段,创建后查询回填。Game.Id 加 optional 避免请求解析时要求传 id。getPlayerLogic 初始化 resp 避免 copier 写入 nil 指针。补跑 ent go generate 确保 userfollows schema 与 生成代码一致。
71 lines
2.0 KiB
Go
71 lines
2.0 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package userfollows
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the userfollows type in the database.
|
|
Label = "user_follows"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldFollowerID holds the string denoting the follower_id field in the database.
|
|
FieldFollowerID = "follower_id"
|
|
// FieldFolloweeID holds the string denoting the followee_id field in the database.
|
|
FieldFolloweeID = "followee_id"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// Table holds the table name of the userfollows in the database.
|
|
Table = "user_follows"
|
|
)
|
|
|
|
// Columns holds all SQL columns for userfollows fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldFollowerID,
|
|
FieldFolloweeID,
|
|
FieldCreatedAt,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the UserFollows queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByFollowerID orders the results by the follower_id field.
|
|
func ByFollowerID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFollowerID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByFolloweeID orders the results by the followee_id field.
|
|
func ByFolloweeID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFolloweeID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|