add card 25
This commit is contained in:
parent
baeca96d10
commit
9d1f0f73c1
@ -63,7 +63,22 @@ var (
|
||||
{Name: "password", Type: field.TypeString},
|
||||
{Name: "created_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20230521"},
|
||||
{Name: "raid_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "luck", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "luck_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "like", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "like_rank", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "like_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "ten", Type: field.TypeBool, Nullable: true},
|
||||
{Name: "ten_su", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "ten_kai", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "aiten", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "ten_card", Type: field.TypeString, Nullable: true},
|
||||
{Name: "ten_delete", Type: field.TypeString, Nullable: true},
|
||||
{Name: "ten_post", Type: field.TypeString, Nullable: true},
|
||||
{Name: "ten_get", Type: field.TypeString, Nullable: true},
|
||||
{Name: "ten_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20230613"},
|
||||
{Name: "group_users", Type: field.TypeInt, Nullable: true},
|
||||
}
|
||||
// UsersTable holds the schema information for the "users" table.
|
||||
@ -74,7 +89,7 @@ var (
|
||||
ForeignKeys: []*schema.ForeignKey{
|
||||
{
|
||||
Symbol: "users_groups_users",
|
||||
Columns: []*schema.Column{UsersColumns[9]},
|
||||
Columns: []*schema.Column{UsersColumns[24]},
|
||||
RefColumns: []*schema.Column{GroupsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
|
1306
ent/mutation.go
1306
ent/mutation.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -459,7 +459,7 @@ func decodeListCardParams(args [0]string, r *http.Request) (params ListCardParam
|
||||
MinSet: true,
|
||||
Min: 1,
|
||||
MaxSet: true,
|
||||
Max: 3500,
|
||||
Max: 4000,
|
||||
MinExclusive: false,
|
||||
MaxExclusive: false,
|
||||
MultipleOfSet: false,
|
||||
@ -624,7 +624,7 @@ func decodeListGroupParams(args [0]string, r *http.Request) (params ListGroupPar
|
||||
MinSet: true,
|
||||
Min: 1,
|
||||
MaxSet: true,
|
||||
Max: 3500,
|
||||
Max: 4000,
|
||||
MinExclusive: false,
|
||||
MaxExclusive: false,
|
||||
MultipleOfSet: false,
|
||||
@ -956,7 +956,7 @@ func decodeListUserParams(args [0]string, r *http.Request) (params ListUserParam
|
||||
MinSet: true,
|
||||
Min: 1,
|
||||
MaxSet: true,
|
||||
Max: 3500,
|
||||
Max: 4000,
|
||||
MinExclusive: false,
|
||||
MaxExclusive: false,
|
||||
MultipleOfSet: false,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,10 +15,10 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// origin-config
|
||||
var password = os.Getenv("PASS")
|
||||
var token = os.Getenv("TOKEN")
|
||||
|
||||
var zero = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
// OgentHandler implements the ogen generated Handler interface and uses Ent as data layer.
|
||||
type OgentHandler struct {
|
||||
client *ent.Client
|
||||
@ -42,6 +42,9 @@ func (h *OgentHandler) CreateCard(ctx context.Context, req *CreateCardReq) (Crea
|
||||
if v, ok := req.Card.Get(); ok {
|
||||
b.SetCard(v)
|
||||
}
|
||||
if v, ok := req.Skill.Get(); ok {
|
||||
b.SetSkill(v)
|
||||
}
|
||||
if v, ok := req.Status.Get(); ok {
|
||||
b.SetStatus(v)
|
||||
}
|
||||
@ -54,11 +57,9 @@ func (h *OgentHandler) CreateCard(ctx context.Context, req *CreateCardReq) (Crea
|
||||
if v, ok := req.CreatedAt.Get(); ok {
|
||||
b.SetCreatedAt(v)
|
||||
}
|
||||
if v, ok := req.Skill.Get(); ok {
|
||||
b.SetSkill(v)
|
||||
}
|
||||
// Add all edges.
|
||||
|
||||
//b.SetOwnerID(req.Owner)
|
||||
// origin-config
|
||||
if req.Password == password {
|
||||
b.SetOwnerID(req.Owner)
|
||||
} else {
|
||||
@ -123,12 +124,19 @@ func (h *OgentHandler) ReadCard(ctx context.Context, params ReadCardParams) (Rea
|
||||
|
||||
// UpdateCard handles PATCH /cards/{id} requests.
|
||||
func (h *OgentHandler) UpdateCard(ctx context.Context, req *UpdateCardReq, params UpdateCardParams) (UpdateCardRes, error) {
|
||||
b := h.client.Card.UpdateOneID(0)
|
||||
// Add all fields.
|
||||
// Add all edges.
|
||||
if v, ok := req.Owner.Get(); ok {
|
||||
b.SetOwnerID(v)
|
||||
}
|
||||
b := h.client.Card.UpdateOneID(params.ID)
|
||||
|
||||
|
||||
// Add all fields.
|
||||
if v, ok := req.Skill.Get(); ok {
|
||||
b.SetSkill(v)
|
||||
}
|
||||
// Add all edges.
|
||||
if v, ok := req.Owner.Get(); ok {
|
||||
b.SetOwnerID(v)
|
||||
}
|
||||
|
||||
|
||||
// Persist to storage.
|
||||
e, err := b.Save(ctx)
|
||||
if err != nil {
|
||||
@ -163,7 +171,6 @@ func (h *OgentHandler) UpdateCard(ctx context.Context, req *UpdateCardReq, param
|
||||
// DeleteCard handles DELETE /cards/{id} requests.
|
||||
func (h *OgentHandler) DeleteCard(ctx context.Context, params DeleteCardParams) (DeleteCardRes, error) {
|
||||
err := h.client.Card.DeleteOneID(0).Exec(ctx)
|
||||
//err := h.client.Card.DeleteOneID(params.ID).Exec(ctx)
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotFound(err):
|
||||
@ -254,7 +261,7 @@ func (h *OgentHandler) ReadCardOwner(ctx context.Context, params ReadCardOwnerPa
|
||||
func (h *OgentHandler) CreateGroup(ctx context.Context, req *CreateGroupReq) (CreateGroupRes, error) {
|
||||
b := h.client.Group.Create()
|
||||
// Add all fields.
|
||||
b.SetName(req.Name)
|
||||
b.SetName("")
|
||||
b.SetPassword(req.Password)
|
||||
// Add all edges.
|
||||
b.AddUserIDs(req.Users...)
|
||||
@ -359,7 +366,7 @@ func (h *OgentHandler) UpdateGroup(ctx context.Context, req *UpdateGroupReq, par
|
||||
|
||||
// DeleteGroup handles DELETE /groups/{id} requests.
|
||||
func (h *OgentHandler) DeleteGroup(ctx context.Context, params DeleteGroupParams) (DeleteGroupRes, error) {
|
||||
err := h.client.Group.DeleteOneID(params.ID).Exec(ctx)
|
||||
err := h.client.Group.DeleteOneID(0).Exec(ctx)
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotFound(err):
|
||||
@ -459,7 +466,10 @@ func (h *OgentHandler) ListGroupUsers(ctx context.Context, params ListGroupUsers
|
||||
// CreateUser handles POST /users requests.
|
||||
func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error) {
|
||||
b := h.client.User.Create()
|
||||
|
||||
// Add all fields.
|
||||
//b.SetUsername(req.Username)
|
||||
//origin-config
|
||||
if req.Password == password {
|
||||
b.SetUsername(req.Username)
|
||||
} else {
|
||||
@ -467,15 +477,67 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
}
|
||||
|
||||
b.SetPassword(req.Password)
|
||||
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
if v, ok := req.Token.Get(); ok {
|
||||
b.SetToken(v)
|
||||
}
|
||||
if v, ok := req.CreatedAt.Get(); ok {
|
||||
b.SetCreatedAt(v)
|
||||
}
|
||||
if v, ok := req.UpdatedAt.Get(); ok {
|
||||
b.SetUpdatedAt(v)
|
||||
}
|
||||
if v, ok := req.RaidAt.Get(); ok {
|
||||
b.SetRaidAt(v)
|
||||
}
|
||||
if v, ok := req.Luck.Get(); ok {
|
||||
b.SetLuck(v)
|
||||
}
|
||||
if v, ok := req.Aiten.Get(); ok {
|
||||
b.SetAiten(v)
|
||||
}
|
||||
if v, ok := req.LuckAt.Get(); ok {
|
||||
b.SetLuckAt(v)
|
||||
}
|
||||
if v, ok := req.Like.Get(); ok {
|
||||
b.SetLike(v)
|
||||
}
|
||||
if v, ok := req.LikeRank.Get(); ok {
|
||||
b.SetLikeRank(v)
|
||||
}
|
||||
if v, ok := req.LikeAt.Get(); ok {
|
||||
b.SetLikeAt(v)
|
||||
}
|
||||
if v, ok := req.Ten.Get(); ok {
|
||||
b.SetTen(v)
|
||||
}
|
||||
if v, ok := req.TenSu.Get(); ok {
|
||||
b.SetTenSu(v)
|
||||
}
|
||||
if v, ok := req.TenKai.Get(); ok {
|
||||
b.SetTenKai(v)
|
||||
}
|
||||
if v, ok := req.TenCard.Get(); ok {
|
||||
b.SetTenCard(v)
|
||||
}
|
||||
if v, ok := req.TenDelete.Get(); ok {
|
||||
b.SetTenDelete(v)
|
||||
}
|
||||
if v, ok := req.TenPost.Get(); ok {
|
||||
b.SetTenPost(v)
|
||||
}
|
||||
if v, ok := req.TenGet.Get(); ok {
|
||||
b.SetTenGet(v)
|
||||
}
|
||||
if v, ok := req.TenAt.Get(); ok {
|
||||
b.SetTenAt(v)
|
||||
}
|
||||
if v, ok := req.Next.Get(); ok {
|
||||
b.SetNext(v)
|
||||
}
|
||||
@ -483,7 +545,6 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
b.AddCardIDs(req.Card...)
|
||||
// Persist to storage.
|
||||
e, err := b.Save(ctx)
|
||||
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotSingular(err):
|
||||
@ -546,16 +607,62 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v, ok := req.Token.Get(); ok {
|
||||
if v == token {
|
||||
b.SetToken(v)
|
||||
// Add all fields.
|
||||
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
|
||||
if v, ok := req.UpdatedAt.Get(); ok {
|
||||
b.SetUpdatedAt(v)
|
||||
}
|
||||
if v, ok := req.RaidAt.Get(); ok {
|
||||
b.SetRaidAt(v)
|
||||
}
|
||||
if v, ok := req.Aiten.Get(); ok {
|
||||
b.SetAiten(v)
|
||||
}
|
||||
if v, ok := req.Luck.Get(); ok {
|
||||
b.SetLuck(v)
|
||||
}
|
||||
if v, ok := req.LuckAt.Get(); ok {
|
||||
b.SetLuckAt(v)
|
||||
}
|
||||
if v, ok := req.Like.Get(); ok {
|
||||
b.SetLike(v)
|
||||
}
|
||||
if v, ok := req.LikeRank.Get(); ok {
|
||||
b.SetLikeRank(v)
|
||||
}
|
||||
if v, ok := req.LikeAt.Get(); ok {
|
||||
b.SetLikeAt(v)
|
||||
}
|
||||
if v, ok := req.Ten.Get(); ok {
|
||||
b.SetTen(v)
|
||||
}
|
||||
if v, ok := req.TenSu.Get(); ok {
|
||||
b.SetTenSu(v)
|
||||
}
|
||||
if v, ok := req.TenKai.Get(); ok {
|
||||
b.SetTenKai(v)
|
||||
}
|
||||
if v, ok := req.TenCard.Get(); ok {
|
||||
b.SetTenCard(v)
|
||||
}
|
||||
if v, ok := req.TenDelete.Get(); ok {
|
||||
b.SetTenDelete(v)
|
||||
}
|
||||
if v, ok := req.TenPost.Get(); ok {
|
||||
b.SetTenPost(v)
|
||||
}
|
||||
if v, ok := req.TenGet.Get(); ok {
|
||||
b.SetTenGet(v)
|
||||
}
|
||||
if v, ok := req.TenAt.Get(); ok {
|
||||
b.SetTenAt(v)
|
||||
}
|
||||
if v, ok := req.Next.Get(); ok {
|
||||
b.SetNext(v)
|
||||
}
|
||||
@ -563,11 +670,11 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if req.Card != nil {
|
||||
b.ClearCard().AddCardIDs(req.Card...)
|
||||
}
|
||||
// Persist to storage.
|
||||
}
|
||||
}
|
||||
e, err := b.Save(ctx)
|
||||
|
||||
// Persist to storage.
|
||||
e, err := b.Save(ctx)
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotFound(err):
|
||||
|
@ -147,6 +147,21 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
ret.Like = NewOptInt(e.Like)
|
||||
ret.LikeRank = NewOptInt(e.LikeRank)
|
||||
ret.LikeAt = NewOptDateTime(e.LikeAt)
|
||||
ret.Ten = NewOptBool(e.Ten)
|
||||
ret.TenSu = NewOptInt(e.TenSu)
|
||||
ret.TenKai = NewOptInt(e.TenKai)
|
||||
ret.Aiten = NewOptInt(e.Aiten)
|
||||
ret.TenCard = NewOptString(e.TenCard)
|
||||
ret.TenDelete = NewOptString(e.TenDelete)
|
||||
ret.TenPost = NewOptString(e.TenPost)
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
return &ret
|
||||
}
|
||||
@ -292,6 +307,21 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
ret.Like = NewOptInt(e.Like)
|
||||
ret.LikeRank = NewOptInt(e.LikeRank)
|
||||
ret.LikeAt = NewOptDateTime(e.LikeAt)
|
||||
ret.Ten = NewOptBool(e.Ten)
|
||||
ret.TenSu = NewOptInt(e.TenSu)
|
||||
ret.TenKai = NewOptInt(e.TenKai)
|
||||
ret.Aiten = NewOptInt(e.Aiten)
|
||||
ret.TenCard = NewOptString(e.TenCard)
|
||||
ret.TenDelete = NewOptString(e.TenDelete)
|
||||
ret.TenPost = NewOptString(e.TenPost)
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
return &ret
|
||||
}
|
||||
@ -325,6 +355,21 @@ func NewUserCreate(e *ent.User) *UserCreate {
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
ret.Like = NewOptInt(e.Like)
|
||||
ret.LikeRank = NewOptInt(e.LikeRank)
|
||||
ret.LikeAt = NewOptDateTime(e.LikeAt)
|
||||
ret.Ten = NewOptBool(e.Ten)
|
||||
ret.TenSu = NewOptInt(e.TenSu)
|
||||
ret.TenKai = NewOptInt(e.TenKai)
|
||||
ret.Aiten = NewOptInt(e.Aiten)
|
||||
ret.TenCard = NewOptString(e.TenCard)
|
||||
ret.TenDelete = NewOptString(e.TenDelete)
|
||||
ret.TenPost = NewOptString(e.TenPost)
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
return &ret
|
||||
}
|
||||
@ -358,6 +403,21 @@ func NewUserList(e *ent.User) *UserList {
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
ret.Like = NewOptInt(e.Like)
|
||||
ret.LikeRank = NewOptInt(e.LikeRank)
|
||||
ret.LikeAt = NewOptDateTime(e.LikeAt)
|
||||
ret.Ten = NewOptBool(e.Ten)
|
||||
ret.TenSu = NewOptInt(e.TenSu)
|
||||
ret.TenKai = NewOptInt(e.TenKai)
|
||||
ret.Aiten = NewOptInt(e.Aiten)
|
||||
ret.TenCard = NewOptString(e.TenCard)
|
||||
ret.TenDelete = NewOptString(e.TenDelete)
|
||||
ret.TenPost = NewOptString(e.TenPost)
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
return &ret
|
||||
}
|
||||
@ -391,6 +451,21 @@ func NewUserRead(e *ent.User) *UserRead {
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
ret.Like = NewOptInt(e.Like)
|
||||
ret.LikeRank = NewOptInt(e.LikeRank)
|
||||
ret.LikeAt = NewOptDateTime(e.LikeAt)
|
||||
ret.Ten = NewOptBool(e.Ten)
|
||||
ret.TenSu = NewOptInt(e.TenSu)
|
||||
ret.TenKai = NewOptInt(e.TenKai)
|
||||
ret.Aiten = NewOptInt(e.Aiten)
|
||||
ret.TenCard = NewOptString(e.TenCard)
|
||||
ret.TenDelete = NewOptString(e.TenDelete)
|
||||
ret.TenPost = NewOptString(e.TenPost)
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
return &ret
|
||||
}
|
||||
@ -424,6 +499,21 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
ret.Like = NewOptInt(e.Like)
|
||||
ret.LikeRank = NewOptInt(e.LikeRank)
|
||||
ret.LikeAt = NewOptDateTime(e.LikeAt)
|
||||
ret.Ten = NewOptBool(e.Ten)
|
||||
ret.TenSu = NewOptInt(e.TenSu)
|
||||
ret.TenKai = NewOptInt(e.TenKai)
|
||||
ret.Aiten = NewOptInt(e.Aiten)
|
||||
ret.TenCard = NewOptString(e.TenCard)
|
||||
ret.TenDelete = NewOptString(e.TenDelete)
|
||||
ret.TenPost = NewOptString(e.TenPost)
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
return &ret
|
||||
}
|
||||
|
447
ent/openapi.json
447
ent/openapi.json
@ -30,7 +30,7 @@
|
||||
"description": "item count to render per page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"maximum": 3500,
|
||||
"maximum": 4000,
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
@ -372,7 +372,7 @@
|
||||
"description": "item count to render per page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"maximum": 3500,
|
||||
"maximum": 4000,
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
@ -698,7 +698,7 @@
|
||||
"description": "item count to render per page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"maximum": 3500,
|
||||
"maximum": 4000,
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
@ -768,6 +768,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -928,6 +977,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1242,6 +1340,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -1359,6 +1506,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -1397,6 +1593,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1436,6 +1681,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -1468,6 +1762,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -1500,6 +1843,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -1532,6 +1924,55 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raid_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"luck": {
|
||||
"type": "integer"
|
||||
},
|
||||
"luck_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"like": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_rank": {
|
||||
"type": "integer"
|
||||
},
|
||||
"like_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ten_su": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_delete": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_post": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_get": {
|
||||
"type": "string"
|
||||
},
|
||||
"ten_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
}
|
||||
|
@ -86,8 +86,24 @@ func init() {
|
||||
userDescUpdatedAt := userFields[6].Descriptor()
|
||||
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
||||
// userDescRaidAt is the schema descriptor for raid_at field.
|
||||
userDescRaidAt := userFields[7].Descriptor()
|
||||
// user.DefaultRaidAt holds the default value on creation for the raid_at field.
|
||||
user.DefaultRaidAt = userDescRaidAt.Default.(func() time.Time)
|
||||
// userDescLuckAt is the schema descriptor for luck_at field.
|
||||
userDescLuckAt := userFields[9].Descriptor()
|
||||
// user.DefaultLuckAt holds the default value on creation for the luck_at field.
|
||||
user.DefaultLuckAt = userDescLuckAt.Default.(func() time.Time)
|
||||
// userDescLikeAt is the schema descriptor for like_at field.
|
||||
userDescLikeAt := userFields[12].Descriptor()
|
||||
// user.DefaultLikeAt holds the default value on creation for the like_at field.
|
||||
user.DefaultLikeAt = userDescLikeAt.Default.(func() time.Time)
|
||||
// userDescTenAt is the schema descriptor for ten_at field.
|
||||
userDescTenAt := userFields[21].Descriptor()
|
||||
// user.DefaultTenAt holds the default value on creation for the ten_at field.
|
||||
user.DefaultTenAt = userDescTenAt.Default.(func() time.Time)
|
||||
// userDescNext is the schema descriptor for next field.
|
||||
userDescNext := userFields[7].Descriptor()
|
||||
userDescNext := userFields[22].Descriptor()
|
||||
// user.DefaultNext holds the default value on creation for the next field.
|
||||
user.DefaultNext = userDescNext.Default.(string)
|
||||
}
|
||||
|
@ -119,6 +119,10 @@ func (Card) Fields() []ent.Field {
|
||||
cp = 800 + cp + rand.Intn(1500)
|
||||
}
|
||||
|
||||
if card == 25 {
|
||||
cp = 0
|
||||
}
|
||||
|
||||
return cp
|
||||
}).
|
||||
Optional(),
|
||||
|
@ -64,6 +64,63 @@ func (User) Fields() []ent.Field {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.Time("raid_at").
|
||||
Optional().
|
||||
Default(func() time.Time {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.Int("luck").
|
||||
Optional(),
|
||||
|
||||
field.Time("luck_at").
|
||||
Optional().
|
||||
Default(func() time.Time {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.Int("like").
|
||||
Optional(),
|
||||
|
||||
field.Int("like_rank").
|
||||
Optional(),
|
||||
|
||||
field.Time("like_at").
|
||||
Optional().
|
||||
Default(func() time.Time {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.Bool("ten").
|
||||
Optional(),
|
||||
|
||||
field.Int("ten_su").
|
||||
Optional(),
|
||||
|
||||
field.Int("ten_kai").
|
||||
Optional(),
|
||||
|
||||
field.Int("aiten").
|
||||
Optional(),
|
||||
|
||||
field.String("ten_card").
|
||||
Optional(),
|
||||
|
||||
field.String("ten_delete").
|
||||
Optional(),
|
||||
|
||||
field.String("ten_post").
|
||||
Optional(),
|
||||
|
||||
field.String("ten_get").
|
||||
Optional(),
|
||||
|
||||
field.Time("ten_at").
|
||||
Optional().
|
||||
Default(func() time.Time {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.String("next").
|
||||
Default(Nextime()).
|
||||
Optional(),
|
||||
|
173
ent/user.go
173
ent/user.go
@ -30,6 +30,36 @@ type User struct {
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
// UpdatedAt holds the value of the "updated_at" field.
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
// RaidAt holds the value of the "raid_at" field.
|
||||
RaidAt time.Time `json:"raid_at,omitempty"`
|
||||
// Luck holds the value of the "luck" field.
|
||||
Luck int `json:"luck,omitempty"`
|
||||
// LuckAt holds the value of the "luck_at" field.
|
||||
LuckAt time.Time `json:"luck_at,omitempty"`
|
||||
// Like holds the value of the "like" field.
|
||||
Like int `json:"like,omitempty"`
|
||||
// LikeRank holds the value of the "like_rank" field.
|
||||
LikeRank int `json:"like_rank,omitempty"`
|
||||
// LikeAt holds the value of the "like_at" field.
|
||||
LikeAt time.Time `json:"like_at,omitempty"`
|
||||
// Ten holds the value of the "ten" field.
|
||||
Ten bool `json:"ten,omitempty"`
|
||||
// TenSu holds the value of the "ten_su" field.
|
||||
TenSu int `json:"ten_su,omitempty"`
|
||||
// TenKai holds the value of the "ten_kai" field.
|
||||
TenKai int `json:"ten_kai,omitempty"`
|
||||
// Aiten holds the value of the "aiten" field.
|
||||
Aiten int `json:"aiten,omitempty"`
|
||||
// TenCard holds the value of the "ten_card" field.
|
||||
TenCard string `json:"ten_card,omitempty"`
|
||||
// TenDelete holds the value of the "ten_delete" field.
|
||||
TenDelete string `json:"ten_delete,omitempty"`
|
||||
// TenPost holds the value of the "ten_post" field.
|
||||
TenPost string `json:"ten_post,omitempty"`
|
||||
// TenGet holds the value of the "ten_get" field.
|
||||
TenGet string `json:"ten_get,omitempty"`
|
||||
// TenAt holds the value of the "ten_at" field.
|
||||
TenAt time.Time `json:"ten_at,omitempty"`
|
||||
// Next holds the value of the "next" field.
|
||||
Next string `json:"next,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
@ -61,13 +91,13 @@ func (*User) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case user.FieldDelete:
|
||||
case user.FieldDelete, user.FieldTen:
|
||||
values[i] = new(sql.NullBool)
|
||||
case user.FieldID:
|
||||
case user.FieldID, user.FieldLuck, user.FieldLike, user.FieldLikeRank, user.FieldTenSu, user.FieldTenKai, user.FieldAiten:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case user.FieldUsername, user.FieldDid, user.FieldToken, user.FieldPassword, user.FieldNext:
|
||||
case user.FieldUsername, user.FieldDid, user.FieldToken, user.FieldPassword, user.FieldTenCard, user.FieldTenDelete, user.FieldTenPost, user.FieldTenGet, user.FieldNext:
|
||||
values[i] = new(sql.NullString)
|
||||
case user.FieldCreatedAt, user.FieldUpdatedAt:
|
||||
case user.FieldCreatedAt, user.FieldUpdatedAt, user.FieldRaidAt, user.FieldLuckAt, user.FieldLikeAt, user.FieldTenAt:
|
||||
values[i] = new(sql.NullTime)
|
||||
case user.ForeignKeys[0]: // group_users
|
||||
values[i] = new(sql.NullInt64)
|
||||
@ -134,6 +164,96 @@ func (u *User) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
u.UpdatedAt = value.Time
|
||||
}
|
||||
case user.FieldRaidAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field raid_at", values[i])
|
||||
} else if value.Valid {
|
||||
u.RaidAt = value.Time
|
||||
}
|
||||
case user.FieldLuck:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field luck", values[i])
|
||||
} else if value.Valid {
|
||||
u.Luck = int(value.Int64)
|
||||
}
|
||||
case user.FieldLuckAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field luck_at", values[i])
|
||||
} else if value.Valid {
|
||||
u.LuckAt = value.Time
|
||||
}
|
||||
case user.FieldLike:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field like", values[i])
|
||||
} else if value.Valid {
|
||||
u.Like = int(value.Int64)
|
||||
}
|
||||
case user.FieldLikeRank:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field like_rank", values[i])
|
||||
} else if value.Valid {
|
||||
u.LikeRank = int(value.Int64)
|
||||
}
|
||||
case user.FieldLikeAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field like_at", values[i])
|
||||
} else if value.Valid {
|
||||
u.LikeAt = value.Time
|
||||
}
|
||||
case user.FieldTen:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten", values[i])
|
||||
} else if value.Valid {
|
||||
u.Ten = value.Bool
|
||||
}
|
||||
case user.FieldTenSu:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_su", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenSu = int(value.Int64)
|
||||
}
|
||||
case user.FieldTenKai:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_kai", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenKai = int(value.Int64)
|
||||
}
|
||||
case user.FieldAiten:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field aiten", values[i])
|
||||
} else if value.Valid {
|
||||
u.Aiten = int(value.Int64)
|
||||
}
|
||||
case user.FieldTenCard:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_card", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenCard = value.String
|
||||
}
|
||||
case user.FieldTenDelete:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_delete", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenDelete = value.String
|
||||
}
|
||||
case user.FieldTenPost:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_post", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenPost = value.String
|
||||
}
|
||||
case user.FieldTenGet:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_get", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenGet = value.String
|
||||
}
|
||||
case user.FieldTenAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field ten_at", values[i])
|
||||
} else if value.Valid {
|
||||
u.TenAt = value.Time
|
||||
}
|
||||
case user.FieldNext:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field next", values[i])
|
||||
@ -199,6 +319,51 @@ func (u *User) String() string {
|
||||
builder.WriteString("updated_at=")
|
||||
builder.WriteString(u.UpdatedAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("raid_at=")
|
||||
builder.WriteString(u.RaidAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("luck=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Luck))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("luck_at=")
|
||||
builder.WriteString(u.LuckAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("like=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Like))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("like_rank=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.LikeRank))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("like_at=")
|
||||
builder.WriteString(u.LikeAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Ten))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_su=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.TenSu))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_kai=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.TenKai))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("aiten=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Aiten))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_card=")
|
||||
builder.WriteString(u.TenCard)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_delete=")
|
||||
builder.WriteString(u.TenDelete)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_post=")
|
||||
builder.WriteString(u.TenPost)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_get=")
|
||||
builder.WriteString(u.TenGet)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("ten_at=")
|
||||
builder.WriteString(u.TenAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("next=")
|
||||
builder.WriteString(u.Next)
|
||||
builder.WriteByte(')')
|
||||
|
@ -25,6 +25,36 @@ const (
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// FieldRaidAt holds the string denoting the raid_at field in the database.
|
||||
FieldRaidAt = "raid_at"
|
||||
// FieldLuck holds the string denoting the luck field in the database.
|
||||
FieldLuck = "luck"
|
||||
// FieldLuckAt holds the string denoting the luck_at field in the database.
|
||||
FieldLuckAt = "luck_at"
|
||||
// FieldLike holds the string denoting the like field in the database.
|
||||
FieldLike = "like"
|
||||
// FieldLikeRank holds the string denoting the like_rank field in the database.
|
||||
FieldLikeRank = "like_rank"
|
||||
// FieldLikeAt holds the string denoting the like_at field in the database.
|
||||
FieldLikeAt = "like_at"
|
||||
// FieldTen holds the string denoting the ten field in the database.
|
||||
FieldTen = "ten"
|
||||
// FieldTenSu holds the string denoting the ten_su field in the database.
|
||||
FieldTenSu = "ten_su"
|
||||
// FieldTenKai holds the string denoting the ten_kai field in the database.
|
||||
FieldTenKai = "ten_kai"
|
||||
// FieldAiten holds the string denoting the aiten field in the database.
|
||||
FieldAiten = "aiten"
|
||||
// FieldTenCard holds the string denoting the ten_card field in the database.
|
||||
FieldTenCard = "ten_card"
|
||||
// FieldTenDelete holds the string denoting the ten_delete field in the database.
|
||||
FieldTenDelete = "ten_delete"
|
||||
// FieldTenPost holds the string denoting the ten_post field in the database.
|
||||
FieldTenPost = "ten_post"
|
||||
// FieldTenGet holds the string denoting the ten_get field in the database.
|
||||
FieldTenGet = "ten_get"
|
||||
// FieldTenAt holds the string denoting the ten_at field in the database.
|
||||
FieldTenAt = "ten_at"
|
||||
// FieldNext holds the string denoting the next field in the database.
|
||||
FieldNext = "next"
|
||||
// EdgeCard holds the string denoting the card edge name in mutations.
|
||||
@ -50,6 +80,21 @@ var Columns = []string{
|
||||
FieldPassword,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldRaidAt,
|
||||
FieldLuck,
|
||||
FieldLuckAt,
|
||||
FieldLike,
|
||||
FieldLikeRank,
|
||||
FieldLikeAt,
|
||||
FieldTen,
|
||||
FieldTenSu,
|
||||
FieldTenKai,
|
||||
FieldAiten,
|
||||
FieldTenCard,
|
||||
FieldTenDelete,
|
||||
FieldTenPost,
|
||||
FieldTenGet,
|
||||
FieldTenAt,
|
||||
FieldNext,
|
||||
}
|
||||
|
||||
@ -85,6 +130,14 @@ var (
|
||||
DefaultCreatedAt func() time.Time
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() time.Time
|
||||
// DefaultRaidAt holds the default value on creation for the "raid_at" field.
|
||||
DefaultRaidAt func() time.Time
|
||||
// DefaultLuckAt holds the default value on creation for the "luck_at" field.
|
||||
DefaultLuckAt func() time.Time
|
||||
// DefaultLikeAt holds the default value on creation for the "like_at" field.
|
||||
DefaultLikeAt func() time.Time
|
||||
// DefaultTenAt holds the default value on creation for the "ten_at" field.
|
||||
DefaultTenAt func() time.Time
|
||||
// DefaultNext holds the default value on creation for the "next" field.
|
||||
DefaultNext string
|
||||
)
|
||||
|
@ -90,6 +90,81 @@ func UpdatedAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// RaidAt applies equality check predicate on the "raid_at" field. It's identical to RaidAtEQ.
|
||||
func RaidAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// Luck applies equality check predicate on the "luck" field. It's identical to LuckEQ.
|
||||
func Luck(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckAt applies equality check predicate on the "luck_at" field. It's identical to LuckAtEQ.
|
||||
func LuckAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// Like applies equality check predicate on the "like" field. It's identical to LikeEQ.
|
||||
func Like(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeRank applies equality check predicate on the "like_rank" field. It's identical to LikeRankEQ.
|
||||
func LikeRank(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeAt applies equality check predicate on the "like_at" field. It's identical to LikeAtEQ.
|
||||
func LikeAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// Ten applies equality check predicate on the "ten" field. It's identical to TenEQ.
|
||||
func Ten(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTen, v))
|
||||
}
|
||||
|
||||
// TenSu applies equality check predicate on the "ten_su" field. It's identical to TenSuEQ.
|
||||
func TenSu(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenKai applies equality check predicate on the "ten_kai" field. It's identical to TenKaiEQ.
|
||||
func TenKai(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// Aiten applies equality check predicate on the "aiten" field. It's identical to AitenEQ.
|
||||
func Aiten(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldAiten, v))
|
||||
}
|
||||
|
||||
// TenCard applies equality check predicate on the "ten_card" field. It's identical to TenCardEQ.
|
||||
func TenCard(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenDelete applies equality check predicate on the "ten_delete" field. It's identical to TenDeleteEQ.
|
||||
func TenDelete(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenPost applies equality check predicate on the "ten_post" field. It's identical to TenPostEQ.
|
||||
func TenPost(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenGet applies equality check predicate on the "ten_get" field. It's identical to TenGetEQ.
|
||||
func TenGet(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenAt applies equality check predicate on the "ten_at" field. It's identical to TenAtEQ.
|
||||
func TenAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// Next applies equality check predicate on the "next" field. It's identical to NextEQ.
|
||||
func Next(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNext, v))
|
||||
@ -495,6 +570,826 @@ func UpdatedAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldUpdatedAt))
|
||||
}
|
||||
|
||||
// RaidAtEQ applies the EQ predicate on the "raid_at" field.
|
||||
func RaidAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// RaidAtNEQ applies the NEQ predicate on the "raid_at" field.
|
||||
func RaidAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// RaidAtIn applies the In predicate on the "raid_at" field.
|
||||
func RaidAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldRaidAt, vs...))
|
||||
}
|
||||
|
||||
// RaidAtNotIn applies the NotIn predicate on the "raid_at" field.
|
||||
func RaidAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldRaidAt, vs...))
|
||||
}
|
||||
|
||||
// RaidAtGT applies the GT predicate on the "raid_at" field.
|
||||
func RaidAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// RaidAtGTE applies the GTE predicate on the "raid_at" field.
|
||||
func RaidAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// RaidAtLT applies the LT predicate on the "raid_at" field.
|
||||
func RaidAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// RaidAtLTE applies the LTE predicate on the "raid_at" field.
|
||||
func RaidAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// RaidAtIsNil applies the IsNil predicate on the "raid_at" field.
|
||||
func RaidAtIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldRaidAt))
|
||||
}
|
||||
|
||||
// RaidAtNotNil applies the NotNil predicate on the "raid_at" field.
|
||||
func RaidAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldRaidAt))
|
||||
}
|
||||
|
||||
// LuckEQ applies the EQ predicate on the "luck" field.
|
||||
func LuckEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckNEQ applies the NEQ predicate on the "luck" field.
|
||||
func LuckNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckIn applies the In predicate on the "luck" field.
|
||||
func LuckIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldLuck, vs...))
|
||||
}
|
||||
|
||||
// LuckNotIn applies the NotIn predicate on the "luck" field.
|
||||
func LuckNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldLuck, vs...))
|
||||
}
|
||||
|
||||
// LuckGT applies the GT predicate on the "luck" field.
|
||||
func LuckGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckGTE applies the GTE predicate on the "luck" field.
|
||||
func LuckGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckLT applies the LT predicate on the "luck" field.
|
||||
func LuckLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckLTE applies the LTE predicate on the "luck" field.
|
||||
func LuckLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldLuck, v))
|
||||
}
|
||||
|
||||
// LuckIsNil applies the IsNil predicate on the "luck" field.
|
||||
func LuckIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldLuck))
|
||||
}
|
||||
|
||||
// LuckNotNil applies the NotNil predicate on the "luck" field.
|
||||
func LuckNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldLuck))
|
||||
}
|
||||
|
||||
// LuckAtEQ applies the EQ predicate on the "luck_at" field.
|
||||
func LuckAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// LuckAtNEQ applies the NEQ predicate on the "luck_at" field.
|
||||
func LuckAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// LuckAtIn applies the In predicate on the "luck_at" field.
|
||||
func LuckAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldLuckAt, vs...))
|
||||
}
|
||||
|
||||
// LuckAtNotIn applies the NotIn predicate on the "luck_at" field.
|
||||
func LuckAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldLuckAt, vs...))
|
||||
}
|
||||
|
||||
// LuckAtGT applies the GT predicate on the "luck_at" field.
|
||||
func LuckAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// LuckAtGTE applies the GTE predicate on the "luck_at" field.
|
||||
func LuckAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// LuckAtLT applies the LT predicate on the "luck_at" field.
|
||||
func LuckAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// LuckAtLTE applies the LTE predicate on the "luck_at" field.
|
||||
func LuckAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldLuckAt, v))
|
||||
}
|
||||
|
||||
// LuckAtIsNil applies the IsNil predicate on the "luck_at" field.
|
||||
func LuckAtIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldLuckAt))
|
||||
}
|
||||
|
||||
// LuckAtNotNil applies the NotNil predicate on the "luck_at" field.
|
||||
func LuckAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldLuckAt))
|
||||
}
|
||||
|
||||
// LikeEQ applies the EQ predicate on the "like" field.
|
||||
func LikeEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeNEQ applies the NEQ predicate on the "like" field.
|
||||
func LikeNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeIn applies the In predicate on the "like" field.
|
||||
func LikeIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldLike, vs...))
|
||||
}
|
||||
|
||||
// LikeNotIn applies the NotIn predicate on the "like" field.
|
||||
func LikeNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldLike, vs...))
|
||||
}
|
||||
|
||||
// LikeGT applies the GT predicate on the "like" field.
|
||||
func LikeGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeGTE applies the GTE predicate on the "like" field.
|
||||
func LikeGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeLT applies the LT predicate on the "like" field.
|
||||
func LikeLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeLTE applies the LTE predicate on the "like" field.
|
||||
func LikeLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldLike, v))
|
||||
}
|
||||
|
||||
// LikeIsNil applies the IsNil predicate on the "like" field.
|
||||
func LikeIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldLike))
|
||||
}
|
||||
|
||||
// LikeNotNil applies the NotNil predicate on the "like" field.
|
||||
func LikeNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldLike))
|
||||
}
|
||||
|
||||
// LikeRankEQ applies the EQ predicate on the "like_rank" field.
|
||||
func LikeRankEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeRankNEQ applies the NEQ predicate on the "like_rank" field.
|
||||
func LikeRankNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeRankIn applies the In predicate on the "like_rank" field.
|
||||
func LikeRankIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldLikeRank, vs...))
|
||||
}
|
||||
|
||||
// LikeRankNotIn applies the NotIn predicate on the "like_rank" field.
|
||||
func LikeRankNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldLikeRank, vs...))
|
||||
}
|
||||
|
||||
// LikeRankGT applies the GT predicate on the "like_rank" field.
|
||||
func LikeRankGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeRankGTE applies the GTE predicate on the "like_rank" field.
|
||||
func LikeRankGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeRankLT applies the LT predicate on the "like_rank" field.
|
||||
func LikeRankLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeRankLTE applies the LTE predicate on the "like_rank" field.
|
||||
func LikeRankLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldLikeRank, v))
|
||||
}
|
||||
|
||||
// LikeRankIsNil applies the IsNil predicate on the "like_rank" field.
|
||||
func LikeRankIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldLikeRank))
|
||||
}
|
||||
|
||||
// LikeRankNotNil applies the NotNil predicate on the "like_rank" field.
|
||||
func LikeRankNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldLikeRank))
|
||||
}
|
||||
|
||||
// LikeAtEQ applies the EQ predicate on the "like_at" field.
|
||||
func LikeAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// LikeAtNEQ applies the NEQ predicate on the "like_at" field.
|
||||
func LikeAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// LikeAtIn applies the In predicate on the "like_at" field.
|
||||
func LikeAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldLikeAt, vs...))
|
||||
}
|
||||
|
||||
// LikeAtNotIn applies the NotIn predicate on the "like_at" field.
|
||||
func LikeAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldLikeAt, vs...))
|
||||
}
|
||||
|
||||
// LikeAtGT applies the GT predicate on the "like_at" field.
|
||||
func LikeAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// LikeAtGTE applies the GTE predicate on the "like_at" field.
|
||||
func LikeAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// LikeAtLT applies the LT predicate on the "like_at" field.
|
||||
func LikeAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// LikeAtLTE applies the LTE predicate on the "like_at" field.
|
||||
func LikeAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldLikeAt, v))
|
||||
}
|
||||
|
||||
// LikeAtIsNil applies the IsNil predicate on the "like_at" field.
|
||||
func LikeAtIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldLikeAt))
|
||||
}
|
||||
|
||||
// LikeAtNotNil applies the NotNil predicate on the "like_at" field.
|
||||
func LikeAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldLikeAt))
|
||||
}
|
||||
|
||||
// TenEQ applies the EQ predicate on the "ten" field.
|
||||
func TenEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTen, v))
|
||||
}
|
||||
|
||||
// TenNEQ applies the NEQ predicate on the "ten" field.
|
||||
func TenNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTen, v))
|
||||
}
|
||||
|
||||
// TenIsNil applies the IsNil predicate on the "ten" field.
|
||||
func TenIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTen))
|
||||
}
|
||||
|
||||
// TenNotNil applies the NotNil predicate on the "ten" field.
|
||||
func TenNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTen))
|
||||
}
|
||||
|
||||
// TenSuEQ applies the EQ predicate on the "ten_su" field.
|
||||
func TenSuEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenSuNEQ applies the NEQ predicate on the "ten_su" field.
|
||||
func TenSuNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenSuIn applies the In predicate on the "ten_su" field.
|
||||
func TenSuIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenSu, vs...))
|
||||
}
|
||||
|
||||
// TenSuNotIn applies the NotIn predicate on the "ten_su" field.
|
||||
func TenSuNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenSu, vs...))
|
||||
}
|
||||
|
||||
// TenSuGT applies the GT predicate on the "ten_su" field.
|
||||
func TenSuGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenSuGTE applies the GTE predicate on the "ten_su" field.
|
||||
func TenSuGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenSuLT applies the LT predicate on the "ten_su" field.
|
||||
func TenSuLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenSuLTE applies the LTE predicate on the "ten_su" field.
|
||||
func TenSuLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenSu, v))
|
||||
}
|
||||
|
||||
// TenSuIsNil applies the IsNil predicate on the "ten_su" field.
|
||||
func TenSuIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenSu))
|
||||
}
|
||||
|
||||
// TenSuNotNil applies the NotNil predicate on the "ten_su" field.
|
||||
func TenSuNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenSu))
|
||||
}
|
||||
|
||||
// TenKaiEQ applies the EQ predicate on the "ten_kai" field.
|
||||
func TenKaiEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// TenKaiNEQ applies the NEQ predicate on the "ten_kai" field.
|
||||
func TenKaiNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// TenKaiIn applies the In predicate on the "ten_kai" field.
|
||||
func TenKaiIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenKai, vs...))
|
||||
}
|
||||
|
||||
// TenKaiNotIn applies the NotIn predicate on the "ten_kai" field.
|
||||
func TenKaiNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenKai, vs...))
|
||||
}
|
||||
|
||||
// TenKaiGT applies the GT predicate on the "ten_kai" field.
|
||||
func TenKaiGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// TenKaiGTE applies the GTE predicate on the "ten_kai" field.
|
||||
func TenKaiGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// TenKaiLT applies the LT predicate on the "ten_kai" field.
|
||||
func TenKaiLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// TenKaiLTE applies the LTE predicate on the "ten_kai" field.
|
||||
func TenKaiLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenKai, v))
|
||||
}
|
||||
|
||||
// TenKaiIsNil applies the IsNil predicate on the "ten_kai" field.
|
||||
func TenKaiIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenKai))
|
||||
}
|
||||
|
||||
// TenKaiNotNil applies the NotNil predicate on the "ten_kai" field.
|
||||
func TenKaiNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenKai))
|
||||
}
|
||||
|
||||
// AitenEQ applies the EQ predicate on the "aiten" field.
|
||||
func AitenEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldAiten, v))
|
||||
}
|
||||
|
||||
// AitenNEQ applies the NEQ predicate on the "aiten" field.
|
||||
func AitenNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldAiten, v))
|
||||
}
|
||||
|
||||
// AitenIn applies the In predicate on the "aiten" field.
|
||||
func AitenIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldAiten, vs...))
|
||||
}
|
||||
|
||||
// AitenNotIn applies the NotIn predicate on the "aiten" field.
|
||||
func AitenNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldAiten, vs...))
|
||||
}
|
||||
|
||||
// AitenGT applies the GT predicate on the "aiten" field.
|
||||
func AitenGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldAiten, v))
|
||||
}
|
||||
|
||||
// AitenGTE applies the GTE predicate on the "aiten" field.
|
||||
func AitenGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldAiten, v))
|
||||
}
|
||||
|
||||
// AitenLT applies the LT predicate on the "aiten" field.
|
||||
func AitenLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldAiten, v))
|
||||
}
|
||||
|
||||
// AitenLTE applies the LTE predicate on the "aiten" field.
|
||||
func AitenLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldAiten, v))
|
||||
}
|
||||
|
||||
// AitenIsNil applies the IsNil predicate on the "aiten" field.
|
||||
func AitenIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldAiten))
|
||||
}
|
||||
|
||||
// AitenNotNil applies the NotNil predicate on the "aiten" field.
|
||||
func AitenNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldAiten))
|
||||
}
|
||||
|
||||
// TenCardEQ applies the EQ predicate on the "ten_card" field.
|
||||
func TenCardEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardNEQ applies the NEQ predicate on the "ten_card" field.
|
||||
func TenCardNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardIn applies the In predicate on the "ten_card" field.
|
||||
func TenCardIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenCard, vs...))
|
||||
}
|
||||
|
||||
// TenCardNotIn applies the NotIn predicate on the "ten_card" field.
|
||||
func TenCardNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenCard, vs...))
|
||||
}
|
||||
|
||||
// TenCardGT applies the GT predicate on the "ten_card" field.
|
||||
func TenCardGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardGTE applies the GTE predicate on the "ten_card" field.
|
||||
func TenCardGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardLT applies the LT predicate on the "ten_card" field.
|
||||
func TenCardLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardLTE applies the LTE predicate on the "ten_card" field.
|
||||
func TenCardLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardContains applies the Contains predicate on the "ten_card" field.
|
||||
func TenCardContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardHasPrefix applies the HasPrefix predicate on the "ten_card" field.
|
||||
func TenCardHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardHasSuffix applies the HasSuffix predicate on the "ten_card" field.
|
||||
func TenCardHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardIsNil applies the IsNil predicate on the "ten_card" field.
|
||||
func TenCardIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenCard))
|
||||
}
|
||||
|
||||
// TenCardNotNil applies the NotNil predicate on the "ten_card" field.
|
||||
func TenCardNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenCard))
|
||||
}
|
||||
|
||||
// TenCardEqualFold applies the EqualFold predicate on the "ten_card" field.
|
||||
func TenCardEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenCardContainsFold applies the ContainsFold predicate on the "ten_card" field.
|
||||
func TenCardContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldTenCard, v))
|
||||
}
|
||||
|
||||
// TenDeleteEQ applies the EQ predicate on the "ten_delete" field.
|
||||
func TenDeleteEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteNEQ applies the NEQ predicate on the "ten_delete" field.
|
||||
func TenDeleteNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteIn applies the In predicate on the "ten_delete" field.
|
||||
func TenDeleteIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenDelete, vs...))
|
||||
}
|
||||
|
||||
// TenDeleteNotIn applies the NotIn predicate on the "ten_delete" field.
|
||||
func TenDeleteNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenDelete, vs...))
|
||||
}
|
||||
|
||||
// TenDeleteGT applies the GT predicate on the "ten_delete" field.
|
||||
func TenDeleteGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteGTE applies the GTE predicate on the "ten_delete" field.
|
||||
func TenDeleteGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteLT applies the LT predicate on the "ten_delete" field.
|
||||
func TenDeleteLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteLTE applies the LTE predicate on the "ten_delete" field.
|
||||
func TenDeleteLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteContains applies the Contains predicate on the "ten_delete" field.
|
||||
func TenDeleteContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteHasPrefix applies the HasPrefix predicate on the "ten_delete" field.
|
||||
func TenDeleteHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteHasSuffix applies the HasSuffix predicate on the "ten_delete" field.
|
||||
func TenDeleteHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteIsNil applies the IsNil predicate on the "ten_delete" field.
|
||||
func TenDeleteIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenDelete))
|
||||
}
|
||||
|
||||
// TenDeleteNotNil applies the NotNil predicate on the "ten_delete" field.
|
||||
func TenDeleteNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenDelete))
|
||||
}
|
||||
|
||||
// TenDeleteEqualFold applies the EqualFold predicate on the "ten_delete" field.
|
||||
func TenDeleteEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenDeleteContainsFold applies the ContainsFold predicate on the "ten_delete" field.
|
||||
func TenDeleteContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldTenDelete, v))
|
||||
}
|
||||
|
||||
// TenPostEQ applies the EQ predicate on the "ten_post" field.
|
||||
func TenPostEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostNEQ applies the NEQ predicate on the "ten_post" field.
|
||||
func TenPostNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostIn applies the In predicate on the "ten_post" field.
|
||||
func TenPostIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenPost, vs...))
|
||||
}
|
||||
|
||||
// TenPostNotIn applies the NotIn predicate on the "ten_post" field.
|
||||
func TenPostNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenPost, vs...))
|
||||
}
|
||||
|
||||
// TenPostGT applies the GT predicate on the "ten_post" field.
|
||||
func TenPostGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostGTE applies the GTE predicate on the "ten_post" field.
|
||||
func TenPostGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostLT applies the LT predicate on the "ten_post" field.
|
||||
func TenPostLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostLTE applies the LTE predicate on the "ten_post" field.
|
||||
func TenPostLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostContains applies the Contains predicate on the "ten_post" field.
|
||||
func TenPostContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostHasPrefix applies the HasPrefix predicate on the "ten_post" field.
|
||||
func TenPostHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostHasSuffix applies the HasSuffix predicate on the "ten_post" field.
|
||||
func TenPostHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostIsNil applies the IsNil predicate on the "ten_post" field.
|
||||
func TenPostIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenPost))
|
||||
}
|
||||
|
||||
// TenPostNotNil applies the NotNil predicate on the "ten_post" field.
|
||||
func TenPostNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenPost))
|
||||
}
|
||||
|
||||
// TenPostEqualFold applies the EqualFold predicate on the "ten_post" field.
|
||||
func TenPostEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenPostContainsFold applies the ContainsFold predicate on the "ten_post" field.
|
||||
func TenPostContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldTenPost, v))
|
||||
}
|
||||
|
||||
// TenGetEQ applies the EQ predicate on the "ten_get" field.
|
||||
func TenGetEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetNEQ applies the NEQ predicate on the "ten_get" field.
|
||||
func TenGetNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetIn applies the In predicate on the "ten_get" field.
|
||||
func TenGetIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenGet, vs...))
|
||||
}
|
||||
|
||||
// TenGetNotIn applies the NotIn predicate on the "ten_get" field.
|
||||
func TenGetNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenGet, vs...))
|
||||
}
|
||||
|
||||
// TenGetGT applies the GT predicate on the "ten_get" field.
|
||||
func TenGetGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetGTE applies the GTE predicate on the "ten_get" field.
|
||||
func TenGetGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetLT applies the LT predicate on the "ten_get" field.
|
||||
func TenGetLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetLTE applies the LTE predicate on the "ten_get" field.
|
||||
func TenGetLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetContains applies the Contains predicate on the "ten_get" field.
|
||||
func TenGetContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetHasPrefix applies the HasPrefix predicate on the "ten_get" field.
|
||||
func TenGetHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetHasSuffix applies the HasSuffix predicate on the "ten_get" field.
|
||||
func TenGetHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetIsNil applies the IsNil predicate on the "ten_get" field.
|
||||
func TenGetIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenGet))
|
||||
}
|
||||
|
||||
// TenGetNotNil applies the NotNil predicate on the "ten_get" field.
|
||||
func TenGetNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenGet))
|
||||
}
|
||||
|
||||
// TenGetEqualFold applies the EqualFold predicate on the "ten_get" field.
|
||||
func TenGetEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenGetContainsFold applies the ContainsFold predicate on the "ten_get" field.
|
||||
func TenGetContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldTenGet, v))
|
||||
}
|
||||
|
||||
// TenAtEQ applies the EQ predicate on the "ten_at" field.
|
||||
func TenAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// TenAtNEQ applies the NEQ predicate on the "ten_at" field.
|
||||
func TenAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// TenAtIn applies the In predicate on the "ten_at" field.
|
||||
func TenAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldTenAt, vs...))
|
||||
}
|
||||
|
||||
// TenAtNotIn applies the NotIn predicate on the "ten_at" field.
|
||||
func TenAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldTenAt, vs...))
|
||||
}
|
||||
|
||||
// TenAtGT applies the GT predicate on the "ten_at" field.
|
||||
func TenAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// TenAtGTE applies the GTE predicate on the "ten_at" field.
|
||||
func TenAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// TenAtLT applies the LT predicate on the "ten_at" field.
|
||||
func TenAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// TenAtLTE applies the LTE predicate on the "ten_at" field.
|
||||
func TenAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldTenAt, v))
|
||||
}
|
||||
|
||||
// TenAtIsNil applies the IsNil predicate on the "ten_at" field.
|
||||
func TenAtIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldTenAt))
|
||||
}
|
||||
|
||||
// TenAtNotNil applies the NotNil predicate on the "ten_at" field.
|
||||
func TenAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldTenAt))
|
||||
}
|
||||
|
||||
// NextEQ applies the EQ predicate on the "next" field.
|
||||
func NextEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNext, v))
|
||||
|
@ -103,6 +103,216 @@ func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate {
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetRaidAt sets the "raid_at" field.
|
||||
func (uc *UserCreate) SetRaidAt(t time.Time) *UserCreate {
|
||||
uc.mutation.SetRaidAt(t)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableRaidAt sets the "raid_at" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableRaidAt(t *time.Time) *UserCreate {
|
||||
if t != nil {
|
||||
uc.SetRaidAt(*t)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetLuck sets the "luck" field.
|
||||
func (uc *UserCreate) SetLuck(i int) *UserCreate {
|
||||
uc.mutation.SetLuck(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableLuck sets the "luck" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableLuck(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetLuck(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetLuckAt sets the "luck_at" field.
|
||||
func (uc *UserCreate) SetLuckAt(t time.Time) *UserCreate {
|
||||
uc.mutation.SetLuckAt(t)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableLuckAt sets the "luck_at" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableLuckAt(t *time.Time) *UserCreate {
|
||||
if t != nil {
|
||||
uc.SetLuckAt(*t)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetLike sets the "like" field.
|
||||
func (uc *UserCreate) SetLike(i int) *UserCreate {
|
||||
uc.mutation.SetLike(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableLike sets the "like" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableLike(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetLike(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetLikeRank sets the "like_rank" field.
|
||||
func (uc *UserCreate) SetLikeRank(i int) *UserCreate {
|
||||
uc.mutation.SetLikeRank(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableLikeRank sets the "like_rank" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableLikeRank(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetLikeRank(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetLikeAt sets the "like_at" field.
|
||||
func (uc *UserCreate) SetLikeAt(t time.Time) *UserCreate {
|
||||
uc.mutation.SetLikeAt(t)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableLikeAt sets the "like_at" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableLikeAt(t *time.Time) *UserCreate {
|
||||
if t != nil {
|
||||
uc.SetLikeAt(*t)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTen sets the "ten" field.
|
||||
func (uc *UserCreate) SetTen(b bool) *UserCreate {
|
||||
uc.mutation.SetTen(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTen sets the "ten" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTen(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetTen(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenSu sets the "ten_su" field.
|
||||
func (uc *UserCreate) SetTenSu(i int) *UserCreate {
|
||||
uc.mutation.SetTenSu(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenSu sets the "ten_su" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenSu(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetTenSu(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenKai sets the "ten_kai" field.
|
||||
func (uc *UserCreate) SetTenKai(i int) *UserCreate {
|
||||
uc.mutation.SetTenKai(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenKai sets the "ten_kai" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenKai(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetTenKai(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetAiten sets the "aiten" field.
|
||||
func (uc *UserCreate) SetAiten(i int) *UserCreate {
|
||||
uc.mutation.SetAiten(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableAiten sets the "aiten" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableAiten(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetAiten(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenCard sets the "ten_card" field.
|
||||
func (uc *UserCreate) SetTenCard(s string) *UserCreate {
|
||||
uc.mutation.SetTenCard(s)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenCard sets the "ten_card" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenCard(s *string) *UserCreate {
|
||||
if s != nil {
|
||||
uc.SetTenCard(*s)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenDelete sets the "ten_delete" field.
|
||||
func (uc *UserCreate) SetTenDelete(s string) *UserCreate {
|
||||
uc.mutation.SetTenDelete(s)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenDelete sets the "ten_delete" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenDelete(s *string) *UserCreate {
|
||||
if s != nil {
|
||||
uc.SetTenDelete(*s)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenPost sets the "ten_post" field.
|
||||
func (uc *UserCreate) SetTenPost(s string) *UserCreate {
|
||||
uc.mutation.SetTenPost(s)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenPost sets the "ten_post" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenPost(s *string) *UserCreate {
|
||||
if s != nil {
|
||||
uc.SetTenPost(*s)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenGet sets the "ten_get" field.
|
||||
func (uc *UserCreate) SetTenGet(s string) *UserCreate {
|
||||
uc.mutation.SetTenGet(s)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenGet sets the "ten_get" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenGet(s *string) *UserCreate {
|
||||
if s != nil {
|
||||
uc.SetTenGet(*s)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetTenAt sets the "ten_at" field.
|
||||
func (uc *UserCreate) SetTenAt(t time.Time) *UserCreate {
|
||||
uc.mutation.SetTenAt(t)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableTenAt sets the "ten_at" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableTenAt(t *time.Time) *UserCreate {
|
||||
if t != nil {
|
||||
uc.SetTenAt(*t)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNext sets the "next" field.
|
||||
func (uc *UserCreate) SetNext(s string) *UserCreate {
|
||||
uc.mutation.SetNext(s)
|
||||
@ -179,6 +389,22 @@ func (uc *UserCreate) defaults() {
|
||||
v := user.DefaultUpdatedAt()
|
||||
uc.mutation.SetUpdatedAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.RaidAt(); !ok {
|
||||
v := user.DefaultRaidAt()
|
||||
uc.mutation.SetRaidAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.LuckAt(); !ok {
|
||||
v := user.DefaultLuckAt()
|
||||
uc.mutation.SetLuckAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.LikeAt(); !ok {
|
||||
v := user.DefaultLikeAt()
|
||||
uc.mutation.SetLikeAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.TenAt(); !ok {
|
||||
v := user.DefaultTenAt()
|
||||
uc.mutation.SetTenAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Next(); !ok {
|
||||
v := user.DefaultNext
|
||||
uc.mutation.SetNext(v)
|
||||
@ -257,6 +483,66 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(user.FieldUpdatedAt, field.TypeTime, value)
|
||||
_node.UpdatedAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.RaidAt(); ok {
|
||||
_spec.SetField(user.FieldRaidAt, field.TypeTime, value)
|
||||
_node.RaidAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.Luck(); ok {
|
||||
_spec.SetField(user.FieldLuck, field.TypeInt, value)
|
||||
_node.Luck = value
|
||||
}
|
||||
if value, ok := uc.mutation.LuckAt(); ok {
|
||||
_spec.SetField(user.FieldLuckAt, field.TypeTime, value)
|
||||
_node.LuckAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.Like(); ok {
|
||||
_spec.SetField(user.FieldLike, field.TypeInt, value)
|
||||
_node.Like = value
|
||||
}
|
||||
if value, ok := uc.mutation.LikeRank(); ok {
|
||||
_spec.SetField(user.FieldLikeRank, field.TypeInt, value)
|
||||
_node.LikeRank = value
|
||||
}
|
||||
if value, ok := uc.mutation.LikeAt(); ok {
|
||||
_spec.SetField(user.FieldLikeAt, field.TypeTime, value)
|
||||
_node.LikeAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.Ten(); ok {
|
||||
_spec.SetField(user.FieldTen, field.TypeBool, value)
|
||||
_node.Ten = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenSu(); ok {
|
||||
_spec.SetField(user.FieldTenSu, field.TypeInt, value)
|
||||
_node.TenSu = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenKai(); ok {
|
||||
_spec.SetField(user.FieldTenKai, field.TypeInt, value)
|
||||
_node.TenKai = value
|
||||
}
|
||||
if value, ok := uc.mutation.Aiten(); ok {
|
||||
_spec.SetField(user.FieldAiten, field.TypeInt, value)
|
||||
_node.Aiten = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenCard(); ok {
|
||||
_spec.SetField(user.FieldTenCard, field.TypeString, value)
|
||||
_node.TenCard = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenDelete(); ok {
|
||||
_spec.SetField(user.FieldTenDelete, field.TypeString, value)
|
||||
_node.TenDelete = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenPost(); ok {
|
||||
_spec.SetField(user.FieldTenPost, field.TypeString, value)
|
||||
_node.TenPost = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenGet(); ok {
|
||||
_spec.SetField(user.FieldTenGet, field.TypeString, value)
|
||||
_node.TenGet = value
|
||||
}
|
||||
if value, ok := uc.mutation.TenAt(); ok {
|
||||
_spec.SetField(user.FieldTenAt, field.TypeTime, value)
|
||||
_node.TenAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.Next(); ok {
|
||||
_spec.SetField(user.FieldNext, field.TypeString, value)
|
||||
_node.Next = value
|
||||
|
@ -109,6 +109,348 @@ func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate {
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetRaidAt sets the "raid_at" field.
|
||||
func (uu *UserUpdate) SetRaidAt(t time.Time) *UserUpdate {
|
||||
uu.mutation.SetRaidAt(t)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableRaidAt sets the "raid_at" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableRaidAt(t *time.Time) *UserUpdate {
|
||||
if t != nil {
|
||||
uu.SetRaidAt(*t)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearRaidAt clears the value of the "raid_at" field.
|
||||
func (uu *UserUpdate) ClearRaidAt() *UserUpdate {
|
||||
uu.mutation.ClearRaidAt()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetLuck sets the "luck" field.
|
||||
func (uu *UserUpdate) SetLuck(i int) *UserUpdate {
|
||||
uu.mutation.ResetLuck()
|
||||
uu.mutation.SetLuck(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableLuck sets the "luck" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableLuck(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetLuck(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddLuck adds i to the "luck" field.
|
||||
func (uu *UserUpdate) AddLuck(i int) *UserUpdate {
|
||||
uu.mutation.AddLuck(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearLuck clears the value of the "luck" field.
|
||||
func (uu *UserUpdate) ClearLuck() *UserUpdate {
|
||||
uu.mutation.ClearLuck()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetLuckAt sets the "luck_at" field.
|
||||
func (uu *UserUpdate) SetLuckAt(t time.Time) *UserUpdate {
|
||||
uu.mutation.SetLuckAt(t)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableLuckAt sets the "luck_at" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableLuckAt(t *time.Time) *UserUpdate {
|
||||
if t != nil {
|
||||
uu.SetLuckAt(*t)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearLuckAt clears the value of the "luck_at" field.
|
||||
func (uu *UserUpdate) ClearLuckAt() *UserUpdate {
|
||||
uu.mutation.ClearLuckAt()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetLike sets the "like" field.
|
||||
func (uu *UserUpdate) SetLike(i int) *UserUpdate {
|
||||
uu.mutation.ResetLike()
|
||||
uu.mutation.SetLike(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableLike sets the "like" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableLike(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetLike(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddLike adds i to the "like" field.
|
||||
func (uu *UserUpdate) AddLike(i int) *UserUpdate {
|
||||
uu.mutation.AddLike(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearLike clears the value of the "like" field.
|
||||
func (uu *UserUpdate) ClearLike() *UserUpdate {
|
||||
uu.mutation.ClearLike()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetLikeRank sets the "like_rank" field.
|
||||
func (uu *UserUpdate) SetLikeRank(i int) *UserUpdate {
|
||||
uu.mutation.ResetLikeRank()
|
||||
uu.mutation.SetLikeRank(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableLikeRank sets the "like_rank" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableLikeRank(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetLikeRank(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddLikeRank adds i to the "like_rank" field.
|
||||
func (uu *UserUpdate) AddLikeRank(i int) *UserUpdate {
|
||||
uu.mutation.AddLikeRank(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearLikeRank clears the value of the "like_rank" field.
|
||||
func (uu *UserUpdate) ClearLikeRank() *UserUpdate {
|
||||
uu.mutation.ClearLikeRank()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetLikeAt sets the "like_at" field.
|
||||
func (uu *UserUpdate) SetLikeAt(t time.Time) *UserUpdate {
|
||||
uu.mutation.SetLikeAt(t)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableLikeAt sets the "like_at" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableLikeAt(t *time.Time) *UserUpdate {
|
||||
if t != nil {
|
||||
uu.SetLikeAt(*t)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearLikeAt clears the value of the "like_at" field.
|
||||
func (uu *UserUpdate) ClearLikeAt() *UserUpdate {
|
||||
uu.mutation.ClearLikeAt()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTen sets the "ten" field.
|
||||
func (uu *UserUpdate) SetTen(b bool) *UserUpdate {
|
||||
uu.mutation.SetTen(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTen sets the "ten" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTen(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetTen(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTen clears the value of the "ten" field.
|
||||
func (uu *UserUpdate) ClearTen() *UserUpdate {
|
||||
uu.mutation.ClearTen()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenSu sets the "ten_su" field.
|
||||
func (uu *UserUpdate) SetTenSu(i int) *UserUpdate {
|
||||
uu.mutation.ResetTenSu()
|
||||
uu.mutation.SetTenSu(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenSu sets the "ten_su" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenSu(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetTenSu(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddTenSu adds i to the "ten_su" field.
|
||||
func (uu *UserUpdate) AddTenSu(i int) *UserUpdate {
|
||||
uu.mutation.AddTenSu(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenSu clears the value of the "ten_su" field.
|
||||
func (uu *UserUpdate) ClearTenSu() *UserUpdate {
|
||||
uu.mutation.ClearTenSu()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenKai sets the "ten_kai" field.
|
||||
func (uu *UserUpdate) SetTenKai(i int) *UserUpdate {
|
||||
uu.mutation.ResetTenKai()
|
||||
uu.mutation.SetTenKai(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenKai sets the "ten_kai" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenKai(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetTenKai(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddTenKai adds i to the "ten_kai" field.
|
||||
func (uu *UserUpdate) AddTenKai(i int) *UserUpdate {
|
||||
uu.mutation.AddTenKai(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenKai clears the value of the "ten_kai" field.
|
||||
func (uu *UserUpdate) ClearTenKai() *UserUpdate {
|
||||
uu.mutation.ClearTenKai()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetAiten sets the "aiten" field.
|
||||
func (uu *UserUpdate) SetAiten(i int) *UserUpdate {
|
||||
uu.mutation.ResetAiten()
|
||||
uu.mutation.SetAiten(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableAiten sets the "aiten" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableAiten(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetAiten(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddAiten adds i to the "aiten" field.
|
||||
func (uu *UserUpdate) AddAiten(i int) *UserUpdate {
|
||||
uu.mutation.AddAiten(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearAiten clears the value of the "aiten" field.
|
||||
func (uu *UserUpdate) ClearAiten() *UserUpdate {
|
||||
uu.mutation.ClearAiten()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenCard sets the "ten_card" field.
|
||||
func (uu *UserUpdate) SetTenCard(s string) *UserUpdate {
|
||||
uu.mutation.SetTenCard(s)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenCard sets the "ten_card" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenCard(s *string) *UserUpdate {
|
||||
if s != nil {
|
||||
uu.SetTenCard(*s)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenCard clears the value of the "ten_card" field.
|
||||
func (uu *UserUpdate) ClearTenCard() *UserUpdate {
|
||||
uu.mutation.ClearTenCard()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenDelete sets the "ten_delete" field.
|
||||
func (uu *UserUpdate) SetTenDelete(s string) *UserUpdate {
|
||||
uu.mutation.SetTenDelete(s)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenDelete sets the "ten_delete" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenDelete(s *string) *UserUpdate {
|
||||
if s != nil {
|
||||
uu.SetTenDelete(*s)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenDelete clears the value of the "ten_delete" field.
|
||||
func (uu *UserUpdate) ClearTenDelete() *UserUpdate {
|
||||
uu.mutation.ClearTenDelete()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenPost sets the "ten_post" field.
|
||||
func (uu *UserUpdate) SetTenPost(s string) *UserUpdate {
|
||||
uu.mutation.SetTenPost(s)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenPost sets the "ten_post" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenPost(s *string) *UserUpdate {
|
||||
if s != nil {
|
||||
uu.SetTenPost(*s)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenPost clears the value of the "ten_post" field.
|
||||
func (uu *UserUpdate) ClearTenPost() *UserUpdate {
|
||||
uu.mutation.ClearTenPost()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenGet sets the "ten_get" field.
|
||||
func (uu *UserUpdate) SetTenGet(s string) *UserUpdate {
|
||||
uu.mutation.SetTenGet(s)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenGet sets the "ten_get" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenGet(s *string) *UserUpdate {
|
||||
if s != nil {
|
||||
uu.SetTenGet(*s)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenGet clears the value of the "ten_get" field.
|
||||
func (uu *UserUpdate) ClearTenGet() *UserUpdate {
|
||||
uu.mutation.ClearTenGet()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetTenAt sets the "ten_at" field.
|
||||
func (uu *UserUpdate) SetTenAt(t time.Time) *UserUpdate {
|
||||
uu.mutation.SetTenAt(t)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableTenAt sets the "ten_at" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableTenAt(t *time.Time) *UserUpdate {
|
||||
if t != nil {
|
||||
uu.SetTenAt(*t)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearTenAt clears the value of the "ten_at" field.
|
||||
func (uu *UserUpdate) ClearTenAt() *UserUpdate {
|
||||
uu.mutation.ClearTenAt()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNext sets the "next" field.
|
||||
func (uu *UserUpdate) SetNext(s string) *UserUpdate {
|
||||
uu.mutation.SetNext(s)
|
||||
@ -233,6 +575,114 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if uu.mutation.UpdatedAtCleared() {
|
||||
_spec.ClearField(user.FieldUpdatedAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.RaidAt(); ok {
|
||||
_spec.SetField(user.FieldRaidAt, field.TypeTime, value)
|
||||
}
|
||||
if uu.mutation.RaidAtCleared() {
|
||||
_spec.ClearField(user.FieldRaidAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.Luck(); ok {
|
||||
_spec.SetField(user.FieldLuck, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedLuck(); ok {
|
||||
_spec.AddField(user.FieldLuck, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.LuckCleared() {
|
||||
_spec.ClearField(user.FieldLuck, field.TypeInt)
|
||||
}
|
||||
if value, ok := uu.mutation.LuckAt(); ok {
|
||||
_spec.SetField(user.FieldLuckAt, field.TypeTime, value)
|
||||
}
|
||||
if uu.mutation.LuckAtCleared() {
|
||||
_spec.ClearField(user.FieldLuckAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.Like(); ok {
|
||||
_spec.SetField(user.FieldLike, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedLike(); ok {
|
||||
_spec.AddField(user.FieldLike, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.LikeCleared() {
|
||||
_spec.ClearField(user.FieldLike, field.TypeInt)
|
||||
}
|
||||
if value, ok := uu.mutation.LikeRank(); ok {
|
||||
_spec.SetField(user.FieldLikeRank, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedLikeRank(); ok {
|
||||
_spec.AddField(user.FieldLikeRank, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.LikeRankCleared() {
|
||||
_spec.ClearField(user.FieldLikeRank, field.TypeInt)
|
||||
}
|
||||
if value, ok := uu.mutation.LikeAt(); ok {
|
||||
_spec.SetField(user.FieldLikeAt, field.TypeTime, value)
|
||||
}
|
||||
if uu.mutation.LikeAtCleared() {
|
||||
_spec.ClearField(user.FieldLikeAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.Ten(); ok {
|
||||
_spec.SetField(user.FieldTen, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.TenCleared() {
|
||||
_spec.ClearField(user.FieldTen, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.TenSu(); ok {
|
||||
_spec.SetField(user.FieldTenSu, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedTenSu(); ok {
|
||||
_spec.AddField(user.FieldTenSu, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.TenSuCleared() {
|
||||
_spec.ClearField(user.FieldTenSu, field.TypeInt)
|
||||
}
|
||||
if value, ok := uu.mutation.TenKai(); ok {
|
||||
_spec.SetField(user.FieldTenKai, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedTenKai(); ok {
|
||||
_spec.AddField(user.FieldTenKai, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.TenKaiCleared() {
|
||||
_spec.ClearField(user.FieldTenKai, field.TypeInt)
|
||||
}
|
||||
if value, ok := uu.mutation.Aiten(); ok {
|
||||
_spec.SetField(user.FieldAiten, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedAiten(); ok {
|
||||
_spec.AddField(user.FieldAiten, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.AitenCleared() {
|
||||
_spec.ClearField(user.FieldAiten, field.TypeInt)
|
||||
}
|
||||
if value, ok := uu.mutation.TenCard(); ok {
|
||||
_spec.SetField(user.FieldTenCard, field.TypeString, value)
|
||||
}
|
||||
if uu.mutation.TenCardCleared() {
|
||||
_spec.ClearField(user.FieldTenCard, field.TypeString)
|
||||
}
|
||||
if value, ok := uu.mutation.TenDelete(); ok {
|
||||
_spec.SetField(user.FieldTenDelete, field.TypeString, value)
|
||||
}
|
||||
if uu.mutation.TenDeleteCleared() {
|
||||
_spec.ClearField(user.FieldTenDelete, field.TypeString)
|
||||
}
|
||||
if value, ok := uu.mutation.TenPost(); ok {
|
||||
_spec.SetField(user.FieldTenPost, field.TypeString, value)
|
||||
}
|
||||
if uu.mutation.TenPostCleared() {
|
||||
_spec.ClearField(user.FieldTenPost, field.TypeString)
|
||||
}
|
||||
if value, ok := uu.mutation.TenGet(); ok {
|
||||
_spec.SetField(user.FieldTenGet, field.TypeString, value)
|
||||
}
|
||||
if uu.mutation.TenGetCleared() {
|
||||
_spec.ClearField(user.FieldTenGet, field.TypeString)
|
||||
}
|
||||
if value, ok := uu.mutation.TenAt(); ok {
|
||||
_spec.SetField(user.FieldTenAt, field.TypeTime, value)
|
||||
}
|
||||
if uu.mutation.TenAtCleared() {
|
||||
_spec.ClearField(user.FieldTenAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.Next(); ok {
|
||||
_spec.SetField(user.FieldNext, field.TypeString, value)
|
||||
}
|
||||
@ -384,6 +834,348 @@ func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne {
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetRaidAt sets the "raid_at" field.
|
||||
func (uuo *UserUpdateOne) SetRaidAt(t time.Time) *UserUpdateOne {
|
||||
uuo.mutation.SetRaidAt(t)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableRaidAt sets the "raid_at" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableRaidAt(t *time.Time) *UserUpdateOne {
|
||||
if t != nil {
|
||||
uuo.SetRaidAt(*t)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearRaidAt clears the value of the "raid_at" field.
|
||||
func (uuo *UserUpdateOne) ClearRaidAt() *UserUpdateOne {
|
||||
uuo.mutation.ClearRaidAt()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetLuck sets the "luck" field.
|
||||
func (uuo *UserUpdateOne) SetLuck(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetLuck()
|
||||
uuo.mutation.SetLuck(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableLuck sets the "luck" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableLuck(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetLuck(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddLuck adds i to the "luck" field.
|
||||
func (uuo *UserUpdateOne) AddLuck(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddLuck(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearLuck clears the value of the "luck" field.
|
||||
func (uuo *UserUpdateOne) ClearLuck() *UserUpdateOne {
|
||||
uuo.mutation.ClearLuck()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetLuckAt sets the "luck_at" field.
|
||||
func (uuo *UserUpdateOne) SetLuckAt(t time.Time) *UserUpdateOne {
|
||||
uuo.mutation.SetLuckAt(t)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableLuckAt sets the "luck_at" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableLuckAt(t *time.Time) *UserUpdateOne {
|
||||
if t != nil {
|
||||
uuo.SetLuckAt(*t)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearLuckAt clears the value of the "luck_at" field.
|
||||
func (uuo *UserUpdateOne) ClearLuckAt() *UserUpdateOne {
|
||||
uuo.mutation.ClearLuckAt()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetLike sets the "like" field.
|
||||
func (uuo *UserUpdateOne) SetLike(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetLike()
|
||||
uuo.mutation.SetLike(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableLike sets the "like" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableLike(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetLike(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddLike adds i to the "like" field.
|
||||
func (uuo *UserUpdateOne) AddLike(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddLike(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearLike clears the value of the "like" field.
|
||||
func (uuo *UserUpdateOne) ClearLike() *UserUpdateOne {
|
||||
uuo.mutation.ClearLike()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetLikeRank sets the "like_rank" field.
|
||||
func (uuo *UserUpdateOne) SetLikeRank(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetLikeRank()
|
||||
uuo.mutation.SetLikeRank(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableLikeRank sets the "like_rank" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableLikeRank(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetLikeRank(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddLikeRank adds i to the "like_rank" field.
|
||||
func (uuo *UserUpdateOne) AddLikeRank(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddLikeRank(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearLikeRank clears the value of the "like_rank" field.
|
||||
func (uuo *UserUpdateOne) ClearLikeRank() *UserUpdateOne {
|
||||
uuo.mutation.ClearLikeRank()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetLikeAt sets the "like_at" field.
|
||||
func (uuo *UserUpdateOne) SetLikeAt(t time.Time) *UserUpdateOne {
|
||||
uuo.mutation.SetLikeAt(t)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableLikeAt sets the "like_at" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableLikeAt(t *time.Time) *UserUpdateOne {
|
||||
if t != nil {
|
||||
uuo.SetLikeAt(*t)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearLikeAt clears the value of the "like_at" field.
|
||||
func (uuo *UserUpdateOne) ClearLikeAt() *UserUpdateOne {
|
||||
uuo.mutation.ClearLikeAt()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTen sets the "ten" field.
|
||||
func (uuo *UserUpdateOne) SetTen(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetTen(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTen sets the "ten" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTen(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetTen(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTen clears the value of the "ten" field.
|
||||
func (uuo *UserUpdateOne) ClearTen() *UserUpdateOne {
|
||||
uuo.mutation.ClearTen()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenSu sets the "ten_su" field.
|
||||
func (uuo *UserUpdateOne) SetTenSu(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetTenSu()
|
||||
uuo.mutation.SetTenSu(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenSu sets the "ten_su" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenSu(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetTenSu(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddTenSu adds i to the "ten_su" field.
|
||||
func (uuo *UserUpdateOne) AddTenSu(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddTenSu(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenSu clears the value of the "ten_su" field.
|
||||
func (uuo *UserUpdateOne) ClearTenSu() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenSu()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenKai sets the "ten_kai" field.
|
||||
func (uuo *UserUpdateOne) SetTenKai(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetTenKai()
|
||||
uuo.mutation.SetTenKai(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenKai sets the "ten_kai" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenKai(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetTenKai(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddTenKai adds i to the "ten_kai" field.
|
||||
func (uuo *UserUpdateOne) AddTenKai(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddTenKai(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenKai clears the value of the "ten_kai" field.
|
||||
func (uuo *UserUpdateOne) ClearTenKai() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenKai()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetAiten sets the "aiten" field.
|
||||
func (uuo *UserUpdateOne) SetAiten(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetAiten()
|
||||
uuo.mutation.SetAiten(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableAiten sets the "aiten" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableAiten(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetAiten(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddAiten adds i to the "aiten" field.
|
||||
func (uuo *UserUpdateOne) AddAiten(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddAiten(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearAiten clears the value of the "aiten" field.
|
||||
func (uuo *UserUpdateOne) ClearAiten() *UserUpdateOne {
|
||||
uuo.mutation.ClearAiten()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenCard sets the "ten_card" field.
|
||||
func (uuo *UserUpdateOne) SetTenCard(s string) *UserUpdateOne {
|
||||
uuo.mutation.SetTenCard(s)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenCard sets the "ten_card" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenCard(s *string) *UserUpdateOne {
|
||||
if s != nil {
|
||||
uuo.SetTenCard(*s)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenCard clears the value of the "ten_card" field.
|
||||
func (uuo *UserUpdateOne) ClearTenCard() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenCard()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenDelete sets the "ten_delete" field.
|
||||
func (uuo *UserUpdateOne) SetTenDelete(s string) *UserUpdateOne {
|
||||
uuo.mutation.SetTenDelete(s)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenDelete sets the "ten_delete" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenDelete(s *string) *UserUpdateOne {
|
||||
if s != nil {
|
||||
uuo.SetTenDelete(*s)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenDelete clears the value of the "ten_delete" field.
|
||||
func (uuo *UserUpdateOne) ClearTenDelete() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenDelete()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenPost sets the "ten_post" field.
|
||||
func (uuo *UserUpdateOne) SetTenPost(s string) *UserUpdateOne {
|
||||
uuo.mutation.SetTenPost(s)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenPost sets the "ten_post" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenPost(s *string) *UserUpdateOne {
|
||||
if s != nil {
|
||||
uuo.SetTenPost(*s)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenPost clears the value of the "ten_post" field.
|
||||
func (uuo *UserUpdateOne) ClearTenPost() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenPost()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenGet sets the "ten_get" field.
|
||||
func (uuo *UserUpdateOne) SetTenGet(s string) *UserUpdateOne {
|
||||
uuo.mutation.SetTenGet(s)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenGet sets the "ten_get" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenGet(s *string) *UserUpdateOne {
|
||||
if s != nil {
|
||||
uuo.SetTenGet(*s)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenGet clears the value of the "ten_get" field.
|
||||
func (uuo *UserUpdateOne) ClearTenGet() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenGet()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetTenAt sets the "ten_at" field.
|
||||
func (uuo *UserUpdateOne) SetTenAt(t time.Time) *UserUpdateOne {
|
||||
uuo.mutation.SetTenAt(t)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableTenAt sets the "ten_at" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableTenAt(t *time.Time) *UserUpdateOne {
|
||||
if t != nil {
|
||||
uuo.SetTenAt(*t)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearTenAt clears the value of the "ten_at" field.
|
||||
func (uuo *UserUpdateOne) ClearTenAt() *UserUpdateOne {
|
||||
uuo.mutation.ClearTenAt()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNext sets the "next" field.
|
||||
func (uuo *UserUpdateOne) SetNext(s string) *UserUpdateOne {
|
||||
uuo.mutation.SetNext(s)
|
||||
@ -538,6 +1330,114 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
|
||||
if uuo.mutation.UpdatedAtCleared() {
|
||||
_spec.ClearField(user.FieldUpdatedAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.RaidAt(); ok {
|
||||
_spec.SetField(user.FieldRaidAt, field.TypeTime, value)
|
||||
}
|
||||
if uuo.mutation.RaidAtCleared() {
|
||||
_spec.ClearField(user.FieldRaidAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.Luck(); ok {
|
||||
_spec.SetField(user.FieldLuck, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedLuck(); ok {
|
||||
_spec.AddField(user.FieldLuck, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.LuckCleared() {
|
||||
_spec.ClearField(user.FieldLuck, field.TypeInt)
|
||||
}
|
||||
if value, ok := uuo.mutation.LuckAt(); ok {
|
||||
_spec.SetField(user.FieldLuckAt, field.TypeTime, value)
|
||||
}
|
||||
if uuo.mutation.LuckAtCleared() {
|
||||
_spec.ClearField(user.FieldLuckAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.Like(); ok {
|
||||
_spec.SetField(user.FieldLike, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedLike(); ok {
|
||||
_spec.AddField(user.FieldLike, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.LikeCleared() {
|
||||
_spec.ClearField(user.FieldLike, field.TypeInt)
|
||||
}
|
||||
if value, ok := uuo.mutation.LikeRank(); ok {
|
||||
_spec.SetField(user.FieldLikeRank, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedLikeRank(); ok {
|
||||
_spec.AddField(user.FieldLikeRank, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.LikeRankCleared() {
|
||||
_spec.ClearField(user.FieldLikeRank, field.TypeInt)
|
||||
}
|
||||
if value, ok := uuo.mutation.LikeAt(); ok {
|
||||
_spec.SetField(user.FieldLikeAt, field.TypeTime, value)
|
||||
}
|
||||
if uuo.mutation.LikeAtCleared() {
|
||||
_spec.ClearField(user.FieldLikeAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.Ten(); ok {
|
||||
_spec.SetField(user.FieldTen, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.TenCleared() {
|
||||
_spec.ClearField(user.FieldTen, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenSu(); ok {
|
||||
_spec.SetField(user.FieldTenSu, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedTenSu(); ok {
|
||||
_spec.AddField(user.FieldTenSu, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.TenSuCleared() {
|
||||
_spec.ClearField(user.FieldTenSu, field.TypeInt)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenKai(); ok {
|
||||
_spec.SetField(user.FieldTenKai, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedTenKai(); ok {
|
||||
_spec.AddField(user.FieldTenKai, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.TenKaiCleared() {
|
||||
_spec.ClearField(user.FieldTenKai, field.TypeInt)
|
||||
}
|
||||
if value, ok := uuo.mutation.Aiten(); ok {
|
||||
_spec.SetField(user.FieldAiten, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedAiten(); ok {
|
||||
_spec.AddField(user.FieldAiten, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.AitenCleared() {
|
||||
_spec.ClearField(user.FieldAiten, field.TypeInt)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenCard(); ok {
|
||||
_spec.SetField(user.FieldTenCard, field.TypeString, value)
|
||||
}
|
||||
if uuo.mutation.TenCardCleared() {
|
||||
_spec.ClearField(user.FieldTenCard, field.TypeString)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenDelete(); ok {
|
||||
_spec.SetField(user.FieldTenDelete, field.TypeString, value)
|
||||
}
|
||||
if uuo.mutation.TenDeleteCleared() {
|
||||
_spec.ClearField(user.FieldTenDelete, field.TypeString)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenPost(); ok {
|
||||
_spec.SetField(user.FieldTenPost, field.TypeString, value)
|
||||
}
|
||||
if uuo.mutation.TenPostCleared() {
|
||||
_spec.ClearField(user.FieldTenPost, field.TypeString)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenGet(); ok {
|
||||
_spec.SetField(user.FieldTenGet, field.TypeString, value)
|
||||
}
|
||||
if uuo.mutation.TenGetCleared() {
|
||||
_spec.ClearField(user.FieldTenGet, field.TypeString)
|
||||
}
|
||||
if value, ok := uuo.mutation.TenAt(); ok {
|
||||
_spec.SetField(user.FieldTenAt, field.TypeTime, value)
|
||||
}
|
||||
if uuo.mutation.TenAtCleared() {
|
||||
_spec.ClearField(user.FieldTenAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.Next(); ok {
|
||||
_spec.SetField(user.FieldNext, field.TypeString, value)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/zsh
|
||||
echo id card cp
|
||||
echo username card cp
|
||||
read
|
||||
host=https://api.syui.ai
|
||||
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
|
||||
@ -13,7 +13,7 @@ if [ -z "$3" ];then
|
||||
exit
|
||||
fi
|
||||
|
||||
id=$1
|
||||
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
|
||||
card=$2
|
||||
cp=$3
|
||||
s="normal"
|
||||
|
@ -9,6 +9,8 @@ host=https://api.syui.ai
|
||||
token=`cat ~/.config/atr/api_card.json|jq -r .token`
|
||||
host_users="$host/users?itemsPerPage=2550"
|
||||
updated_at_n=`date --iso-8601=seconds -d '1 days ago'`
|
||||
now_at=`date --iso-8601=seconds`
|
||||
raid_at_n=`date --iso-8601=seconds -d '1 days ago'`
|
||||
data=`curl -sL "$host_users"|jq .`
|
||||
nd=`date +"%Y%m%d"`
|
||||
|
||||
@ -16,8 +18,12 @@ n=`echo $data|jq length`
|
||||
n=$((n - 1))
|
||||
|
||||
if [ -n "$1" ];then
|
||||
id=$1
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\",\"token\":\"$token\"}" -s $host/users/$id
|
||||
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
|
||||
if [ "ai" = "$1" ] || [ "yui" = "$1" ];then
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"luck\": 7, \"like\":0}" -s $host/users/$id
|
||||
else
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"ten_su\": 0, \"luck_at\": \"$now_at\", \"ten\":false,\"ten_at\": \"$updated_at_n\",\"token\": \"$token\",\"ten_kai\" : 0}" -s $host/users/$id
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -26,5 +32,9 @@ do
|
||||
name=`echo $data|jq ".[$i]"|jq -r .username`
|
||||
id=`echo $data|jq ".[$i]"|jq -r .id`
|
||||
echo "{\"updated_at\":\"$updated_at_n\"} -s $host/users/$id"
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\",\"token\":\"$token\"}" -s $host/users/$id
|
||||
if [ "ai" = "$1" ];then
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"luck\": 7}" -s $host/users/$id
|
||||
else
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"ten_at\": \"$updated_at_n\"}" -s $host/users/$id
|
||||
fi
|
||||
done
|
||||
|
@ -459,7 +459,7 @@ func decodeListCardParams(args [0]string, r *http.Request) (params ListCardParam
|
||||
MinSet: true,
|
||||
Min: 1,
|
||||
MaxSet: true,
|
||||
Max: 3500,
|
||||
Max: 4000,
|
||||
MinExclusive: false,
|
||||
MaxExclusive: false,
|
||||
MultipleOfSet: false,
|
||||
@ -624,7 +624,7 @@ func decodeListGroupParams(args [0]string, r *http.Request) (params ListGroupPar
|
||||
MinSet: true,
|
||||
Min: 1,
|
||||
MaxSet: true,
|
||||
Max: 3500,
|
||||
Max: 4000,
|
||||
MinExclusive: false,
|
||||
MaxExclusive: false,
|
||||
MultipleOfSet: false,
|
||||
@ -956,7 +956,7 @@ func decodeListUserParams(args [0]string, r *http.Request) (params ListUserParam
|
||||
MinSet: true,
|
||||
Min: 1,
|
||||
MaxSet: true,
|
||||
Max: 3500,
|
||||
Max: 4000,
|
||||
MinExclusive: false,
|
||||
MaxExclusive: false,
|
||||
MultipleOfSet: false,
|
||||
|
@ -15,10 +15,10 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// origin-config
|
||||
var password = os.Getenv("PASS")
|
||||
var token = os.Getenv("TOKEN")
|
||||
|
||||
var zero = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
// OgentHandler implements the ogen generated Handler interface and uses Ent as data layer.
|
||||
type OgentHandler struct {
|
||||
client *ent.Client
|
||||
@ -42,6 +42,9 @@ func (h *OgentHandler) CreateCard(ctx context.Context, req *CreateCardReq) (Crea
|
||||
if v, ok := req.Card.Get(); ok {
|
||||
b.SetCard(v)
|
||||
}
|
||||
if v, ok := req.Skill.Get(); ok {
|
||||
b.SetSkill(v)
|
||||
}
|
||||
if v, ok := req.Status.Get(); ok {
|
||||
b.SetStatus(v)
|
||||
}
|
||||
@ -54,11 +57,9 @@ func (h *OgentHandler) CreateCard(ctx context.Context, req *CreateCardReq) (Crea
|
||||
if v, ok := req.CreatedAt.Get(); ok {
|
||||
b.SetCreatedAt(v)
|
||||
}
|
||||
if v, ok := req.Skill.Get(); ok {
|
||||
b.SetSkill(v)
|
||||
}
|
||||
// Add all edges.
|
||||
|
||||
//b.SetOwnerID(req.Owner)
|
||||
// origin-config
|
||||
if req.Password == password {
|
||||
b.SetOwnerID(req.Owner)
|
||||
} else {
|
||||
@ -123,12 +124,19 @@ func (h *OgentHandler) ReadCard(ctx context.Context, params ReadCardParams) (Rea
|
||||
|
||||
// UpdateCard handles PATCH /cards/{id} requests.
|
||||
func (h *OgentHandler) UpdateCard(ctx context.Context, req *UpdateCardReq, params UpdateCardParams) (UpdateCardRes, error) {
|
||||
b := h.client.Card.UpdateOneID(0)
|
||||
// Add all fields.
|
||||
// Add all edges.
|
||||
if v, ok := req.Owner.Get(); ok {
|
||||
b.SetOwnerID(v)
|
||||
}
|
||||
b := h.client.Card.UpdateOneID(params.ID)
|
||||
|
||||
|
||||
// Add all fields.
|
||||
if v, ok := req.Skill.Get(); ok {
|
||||
b.SetSkill(v)
|
||||
}
|
||||
// Add all edges.
|
||||
if v, ok := req.Owner.Get(); ok {
|
||||
b.SetOwnerID(v)
|
||||
}
|
||||
|
||||
|
||||
// Persist to storage.
|
||||
e, err := b.Save(ctx)
|
||||
if err != nil {
|
||||
@ -163,7 +171,6 @@ func (h *OgentHandler) UpdateCard(ctx context.Context, req *UpdateCardReq, param
|
||||
// DeleteCard handles DELETE /cards/{id} requests.
|
||||
func (h *OgentHandler) DeleteCard(ctx context.Context, params DeleteCardParams) (DeleteCardRes, error) {
|
||||
err := h.client.Card.DeleteOneID(0).Exec(ctx)
|
||||
//err := h.client.Card.DeleteOneID(params.ID).Exec(ctx)
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotFound(err):
|
||||
@ -254,7 +261,7 @@ func (h *OgentHandler) ReadCardOwner(ctx context.Context, params ReadCardOwnerPa
|
||||
func (h *OgentHandler) CreateGroup(ctx context.Context, req *CreateGroupReq) (CreateGroupRes, error) {
|
||||
b := h.client.Group.Create()
|
||||
// Add all fields.
|
||||
b.SetName(req.Name)
|
||||
b.SetName("")
|
||||
b.SetPassword(req.Password)
|
||||
// Add all edges.
|
||||
b.AddUserIDs(req.Users...)
|
||||
@ -359,7 +366,7 @@ func (h *OgentHandler) UpdateGroup(ctx context.Context, req *UpdateGroupReq, par
|
||||
|
||||
// DeleteGroup handles DELETE /groups/{id} requests.
|
||||
func (h *OgentHandler) DeleteGroup(ctx context.Context, params DeleteGroupParams) (DeleteGroupRes, error) {
|
||||
err := h.client.Group.DeleteOneID(params.ID).Exec(ctx)
|
||||
err := h.client.Group.DeleteOneID(0).Exec(ctx)
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotFound(err):
|
||||
@ -459,7 +466,10 @@ func (h *OgentHandler) ListGroupUsers(ctx context.Context, params ListGroupUsers
|
||||
// CreateUser handles POST /users requests.
|
||||
func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error) {
|
||||
b := h.client.User.Create()
|
||||
|
||||
// Add all fields.
|
||||
//b.SetUsername(req.Username)
|
||||
//origin-config
|
||||
if req.Password == password {
|
||||
b.SetUsername(req.Username)
|
||||
} else {
|
||||
@ -467,15 +477,67 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
}
|
||||
|
||||
b.SetPassword(req.Password)
|
||||
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
if v, ok := req.Token.Get(); ok {
|
||||
b.SetToken(v)
|
||||
}
|
||||
if v, ok := req.CreatedAt.Get(); ok {
|
||||
b.SetCreatedAt(v)
|
||||
}
|
||||
if v, ok := req.UpdatedAt.Get(); ok {
|
||||
b.SetUpdatedAt(v)
|
||||
}
|
||||
if v, ok := req.RaidAt.Get(); ok {
|
||||
b.SetRaidAt(v)
|
||||
}
|
||||
if v, ok := req.Luck.Get(); ok {
|
||||
b.SetLuck(v)
|
||||
}
|
||||
if v, ok := req.Aiten.Get(); ok {
|
||||
b.SetAiten(v)
|
||||
}
|
||||
if v, ok := req.LuckAt.Get(); ok {
|
||||
b.SetLuckAt(v)
|
||||
}
|
||||
if v, ok := req.Like.Get(); ok {
|
||||
b.SetLike(v)
|
||||
}
|
||||
if v, ok := req.LikeRank.Get(); ok {
|
||||
b.SetLikeRank(v)
|
||||
}
|
||||
if v, ok := req.LikeAt.Get(); ok {
|
||||
b.SetLikeAt(v)
|
||||
}
|
||||
if v, ok := req.Ten.Get(); ok {
|
||||
b.SetTen(v)
|
||||
}
|
||||
if v, ok := req.TenSu.Get(); ok {
|
||||
b.SetTenSu(v)
|
||||
}
|
||||
if v, ok := req.TenKai.Get(); ok {
|
||||
b.SetTenKai(v)
|
||||
}
|
||||
if v, ok := req.TenCard.Get(); ok {
|
||||
b.SetTenCard(v)
|
||||
}
|
||||
if v, ok := req.TenDelete.Get(); ok {
|
||||
b.SetTenDelete(v)
|
||||
}
|
||||
if v, ok := req.TenPost.Get(); ok {
|
||||
b.SetTenPost(v)
|
||||
}
|
||||
if v, ok := req.TenGet.Get(); ok {
|
||||
b.SetTenGet(v)
|
||||
}
|
||||
if v, ok := req.TenAt.Get(); ok {
|
||||
b.SetTenAt(v)
|
||||
}
|
||||
if v, ok := req.Next.Get(); ok {
|
||||
b.SetNext(v)
|
||||
}
|
||||
@ -483,7 +545,6 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
b.AddCardIDs(req.Card...)
|
||||
// Persist to storage.
|
||||
e, err := b.Save(ctx)
|
||||
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotSingular(err):
|
||||
@ -546,16 +607,62 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v, ok := req.Token.Get(); ok {
|
||||
if v == token {
|
||||
b.SetToken(v)
|
||||
// Add all fields.
|
||||
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
|
||||
if v, ok := req.UpdatedAt.Get(); ok {
|
||||
b.SetUpdatedAt(v)
|
||||
}
|
||||
if v, ok := req.RaidAt.Get(); ok {
|
||||
b.SetRaidAt(v)
|
||||
}
|
||||
if v, ok := req.Aiten.Get(); ok {
|
||||
b.SetAiten(v)
|
||||
}
|
||||
if v, ok := req.Luck.Get(); ok {
|
||||
b.SetLuck(v)
|
||||
}
|
||||
if v, ok := req.LuckAt.Get(); ok {
|
||||
b.SetLuckAt(v)
|
||||
}
|
||||
if v, ok := req.Like.Get(); ok {
|
||||
b.SetLike(v)
|
||||
}
|
||||
if v, ok := req.LikeRank.Get(); ok {
|
||||
b.SetLikeRank(v)
|
||||
}
|
||||
if v, ok := req.LikeAt.Get(); ok {
|
||||
b.SetLikeAt(v)
|
||||
}
|
||||
if v, ok := req.Ten.Get(); ok {
|
||||
b.SetTen(v)
|
||||
}
|
||||
if v, ok := req.TenSu.Get(); ok {
|
||||
b.SetTenSu(v)
|
||||
}
|
||||
if v, ok := req.TenKai.Get(); ok {
|
||||
b.SetTenKai(v)
|
||||
}
|
||||
if v, ok := req.TenCard.Get(); ok {
|
||||
b.SetTenCard(v)
|
||||
}
|
||||
if v, ok := req.TenDelete.Get(); ok {
|
||||
b.SetTenDelete(v)
|
||||
}
|
||||
if v, ok := req.TenPost.Get(); ok {
|
||||
b.SetTenPost(v)
|
||||
}
|
||||
if v, ok := req.TenGet.Get(); ok {
|
||||
b.SetTenGet(v)
|
||||
}
|
||||
if v, ok := req.TenAt.Get(); ok {
|
||||
b.SetTenAt(v)
|
||||
}
|
||||
if v, ok := req.Next.Get(); ok {
|
||||
b.SetNext(v)
|
||||
}
|
||||
@ -563,11 +670,11 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if req.Card != nil {
|
||||
b.ClearCard().AddCardIDs(req.Card...)
|
||||
}
|
||||
// Persist to storage.
|
||||
}
|
||||
}
|
||||
e, err := b.Save(ctx)
|
||||
|
||||
// Persist to storage.
|
||||
e, err := b.Save(ctx)
|
||||
if err != nil {
|
||||
switch {
|
||||
case ent.IsNotFound(err):
|
||||
|
75
tmp/test.zsh
Executable file
75
tmp/test.zsh
Executable file
@ -0,0 +1,75 @@
|
||||
#!/bin/zsh
|
||||
|
||||
case $OSTYPE in
|
||||
darwin*)
|
||||
alias date="/opt/homebrew/bin/gdate"
|
||||
;;
|
||||
esac
|
||||
u=ai
|
||||
s=normal
|
||||
host=https://api.syui.ai
|
||||
token=`cat ~/.config/atr/api_card.json|jq -r .token`
|
||||
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
|
||||
host_users="$host/users?itemsPerPage=2550"
|
||||
updated_at_n=`date --iso-8601=seconds -d '1 days ago'`
|
||||
now_at=`date --iso-8601=seconds`
|
||||
raid_at_n=`date --iso-8601=seconds -d '1 days ago'`
|
||||
data=`curl -sL "$host_users"|jq .`
|
||||
nd=`date +"%Y%m%d"`
|
||||
card=0
|
||||
cp=0
|
||||
body="next[y]"
|
||||
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$u\")"|jq -r .id`
|
||||
echo $id
|
||||
|
||||
#echo no token
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"ten_su\": 1, \"luck_at\": \"$now_at\", \"ten_at\": \"$updated_at_n\"}" -s $host/users/$id
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo yes token
|
||||
#echo $token
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"ten_su\": 1, \"luck_at\": \"$now_at\", \"ten_at\": \"$updated_at_n\",\"token\": \"$token\"}" -s $host/users/$id
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo account delete id no token
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"delete\":true}" -s $host/users/381
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo account delete id token
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"delete\":false,\"token\":\"$token\"}" -s $host/users/381
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo add card no pass
|
||||
#curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp}" -sL $host/cards
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo add card no pass
|
||||
#echo $id
|
||||
#curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\"}" -sL $host/cards
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo add user
|
||||
#curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"test\",\"did\":\"t\"}" -s "$host/users"
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo add user pass
|
||||
#curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"test\",\"did\":\"t\",\"password\":\"$pass\"}" -s "$host/users"
|
||||
#echo $body
|
||||
#read
|
||||
|
||||
#echo card draw no pass
|
||||
#curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id}" -s $host/cards
|
||||
#echo $body
|
||||
#read
|
||||
#
|
||||
#echo card draw ok pass
|
||||
#curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"password\":\"$pass\"}" -s $host/cards
|
||||
#echo $body
|
||||
#read
|
Loading…
Reference in New Issue
Block a user