de32143b6d
updateMeLogic 更新后重新查询并返回 User 类型,修复 converter 转换 空响应的错误。proto_string 不再丢弃含空格的字符串。userfollows ent schema 补上 created_at 的 Default(time.Now)。
70 lines
1.9 KiB
Go
70 lines
1.9 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 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()
|
|
}
|