add room
This commit is contained in:
parent
1124b851aa
commit
a35e67d683
@ -74,6 +74,7 @@ var (
|
||||
{Name: "created_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "raid_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "server_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "egg_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "luck", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "luck_at", Type: field.TypeTime, Nullable: true},
|
||||
@ -90,7 +91,8 @@ var (
|
||||
{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: "20230821"},
|
||||
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20230911"},
|
||||
{Name: "room", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "group_users", Type: field.TypeInt, Nullable: true},
|
||||
}
|
||||
// UsersTable holds the schema information for the "users" table.
|
||||
@ -101,7 +103,7 @@ var (
|
||||
ForeignKeys: []*schema.ForeignKey{
|
||||
{
|
||||
Symbol: "users_groups_users",
|
||||
Columns: []*schema.Column{UsersColumns[33]},
|
||||
Columns: []*schema.Column{UsersColumns[35]},
|
||||
RefColumns: []*schema.Column{GroupsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
|
182
ent/mutation.go
182
ent/mutation.go
@ -1683,6 +1683,7 @@ type UserMutation struct {
|
||||
created_at *time.Time
|
||||
updated_at *time.Time
|
||||
raid_at *time.Time
|
||||
server_at *time.Time
|
||||
egg_at *time.Time
|
||||
luck *int
|
||||
addluck *int
|
||||
@ -1707,6 +1708,8 @@ type UserMutation struct {
|
||||
ten_get *string
|
||||
ten_at *time.Time
|
||||
next *string
|
||||
room *int
|
||||
addroom *int
|
||||
clearedFields map[string]struct{}
|
||||
card map[int]struct{}
|
||||
removedcard map[int]struct{}
|
||||
@ -2523,6 +2526,55 @@ func (m *UserMutation) ResetRaidAt() {
|
||||
delete(m.clearedFields, user.FieldRaidAt)
|
||||
}
|
||||
|
||||
// SetServerAt sets the "server_at" field.
|
||||
func (m *UserMutation) SetServerAt(t time.Time) {
|
||||
m.server_at = &t
|
||||
}
|
||||
|
||||
// ServerAt returns the value of the "server_at" field in the mutation.
|
||||
func (m *UserMutation) ServerAt() (r time.Time, exists bool) {
|
||||
v := m.server_at
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldServerAt returns the old "server_at" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldServerAt(ctx context.Context) (v time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldServerAt is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldServerAt requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldServerAt: %w", err)
|
||||
}
|
||||
return oldValue.ServerAt, nil
|
||||
}
|
||||
|
||||
// ClearServerAt clears the value of the "server_at" field.
|
||||
func (m *UserMutation) ClearServerAt() {
|
||||
m.server_at = nil
|
||||
m.clearedFields[user.FieldServerAt] = struct{}{}
|
||||
}
|
||||
|
||||
// ServerAtCleared returns if the "server_at" field was cleared in this mutation.
|
||||
func (m *UserMutation) ServerAtCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldServerAt]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetServerAt resets all changes to the "server_at" field.
|
||||
func (m *UserMutation) ResetServerAt() {
|
||||
m.server_at = nil
|
||||
delete(m.clearedFields, user.FieldServerAt)
|
||||
}
|
||||
|
||||
// SetEggAt sets the "egg_at" field.
|
||||
func (m *UserMutation) SetEggAt(t time.Time) {
|
||||
m.egg_at = &t
|
||||
@ -3503,6 +3555,76 @@ func (m *UserMutation) ResetNext() {
|
||||
delete(m.clearedFields, user.FieldNext)
|
||||
}
|
||||
|
||||
// SetRoom sets the "room" field.
|
||||
func (m *UserMutation) SetRoom(i int) {
|
||||
m.room = &i
|
||||
m.addroom = nil
|
||||
}
|
||||
|
||||
// Room returns the value of the "room" field in the mutation.
|
||||
func (m *UserMutation) Room() (r int, exists bool) {
|
||||
v := m.room
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldRoom returns the old "room" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldRoom(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldRoom is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldRoom requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldRoom: %w", err)
|
||||
}
|
||||
return oldValue.Room, nil
|
||||
}
|
||||
|
||||
// AddRoom adds i to the "room" field.
|
||||
func (m *UserMutation) AddRoom(i int) {
|
||||
if m.addroom != nil {
|
||||
*m.addroom += i
|
||||
} else {
|
||||
m.addroom = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedRoom returns the value that was added to the "room" field in this mutation.
|
||||
func (m *UserMutation) AddedRoom() (r int, exists bool) {
|
||||
v := m.addroom
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearRoom clears the value of the "room" field.
|
||||
func (m *UserMutation) ClearRoom() {
|
||||
m.room = nil
|
||||
m.addroom = nil
|
||||
m.clearedFields[user.FieldRoom] = struct{}{}
|
||||
}
|
||||
|
||||
// RoomCleared returns if the "room" field was cleared in this mutation.
|
||||
func (m *UserMutation) RoomCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldRoom]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetRoom resets all changes to the "room" field.
|
||||
func (m *UserMutation) ResetRoom() {
|
||||
m.room = nil
|
||||
m.addroom = nil
|
||||
delete(m.clearedFields, user.FieldRoom)
|
||||
}
|
||||
|
||||
// AddCardIDs adds the "card" edge to the Card entity by ids.
|
||||
func (m *UserMutation) AddCardIDs(ids ...int) {
|
||||
if m.card == nil {
|
||||
@ -3591,7 +3713,7 @@ func (m *UserMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *UserMutation) Fields() []string {
|
||||
fields := make([]string, 0, 32)
|
||||
fields := make([]string, 0, 34)
|
||||
if m.username != nil {
|
||||
fields = append(fields, user.FieldUsername)
|
||||
}
|
||||
@ -3637,6 +3759,9 @@ func (m *UserMutation) Fields() []string {
|
||||
if m.raid_at != nil {
|
||||
fields = append(fields, user.FieldRaidAt)
|
||||
}
|
||||
if m.server_at != nil {
|
||||
fields = append(fields, user.FieldServerAt)
|
||||
}
|
||||
if m.egg_at != nil {
|
||||
fields = append(fields, user.FieldEggAt)
|
||||
}
|
||||
@ -3688,6 +3813,9 @@ func (m *UserMutation) Fields() []string {
|
||||
if m.next != nil {
|
||||
fields = append(fields, user.FieldNext)
|
||||
}
|
||||
if m.room != nil {
|
||||
fields = append(fields, user.FieldRoom)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@ -3726,6 +3854,8 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.UpdatedAt()
|
||||
case user.FieldRaidAt:
|
||||
return m.RaidAt()
|
||||
case user.FieldServerAt:
|
||||
return m.ServerAt()
|
||||
case user.FieldEggAt:
|
||||
return m.EggAt()
|
||||
case user.FieldLuck:
|
||||
@ -3760,6 +3890,8 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.TenAt()
|
||||
case user.FieldNext:
|
||||
return m.Next()
|
||||
case user.FieldRoom:
|
||||
return m.Room()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@ -3799,6 +3931,8 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er
|
||||
return m.OldUpdatedAt(ctx)
|
||||
case user.FieldRaidAt:
|
||||
return m.OldRaidAt(ctx)
|
||||
case user.FieldServerAt:
|
||||
return m.OldServerAt(ctx)
|
||||
case user.FieldEggAt:
|
||||
return m.OldEggAt(ctx)
|
||||
case user.FieldLuck:
|
||||
@ -3833,6 +3967,8 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er
|
||||
return m.OldTenAt(ctx)
|
||||
case user.FieldNext:
|
||||
return m.OldNext(ctx)
|
||||
case user.FieldRoom:
|
||||
return m.OldRoom(ctx)
|
||||
}
|
||||
return nil, fmt.Errorf("unknown User field %s", name)
|
||||
}
|
||||
@ -3947,6 +4083,13 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetRaidAt(v)
|
||||
return nil
|
||||
case user.FieldServerAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetServerAt(v)
|
||||
return nil
|
||||
case user.FieldEggAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
@ -4066,6 +4209,13 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetNext(v)
|
||||
return nil
|
||||
case user.FieldRoom:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetRoom(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User field %s", name)
|
||||
}
|
||||
@ -4095,6 +4245,9 @@ func (m *UserMutation) AddedFields() []string {
|
||||
if m.addaiten != nil {
|
||||
fields = append(fields, user.FieldAiten)
|
||||
}
|
||||
if m.addroom != nil {
|
||||
fields = append(fields, user.FieldRoom)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@ -4117,6 +4270,8 @@ func (m *UserMutation) AddedField(name string) (ent.Value, bool) {
|
||||
return m.AddedTenKai()
|
||||
case user.FieldAiten:
|
||||
return m.AddedAiten()
|
||||
case user.FieldRoom:
|
||||
return m.AddedRoom()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@ -4175,6 +4330,13 @@ func (m *UserMutation) AddField(name string, value ent.Value) error {
|
||||
}
|
||||
m.AddAiten(v)
|
||||
return nil
|
||||
case user.FieldRoom:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddRoom(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User numeric field %s", name)
|
||||
}
|
||||
@ -4222,6 +4384,9 @@ func (m *UserMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(user.FieldRaidAt) {
|
||||
fields = append(fields, user.FieldRaidAt)
|
||||
}
|
||||
if m.FieldCleared(user.FieldServerAt) {
|
||||
fields = append(fields, user.FieldServerAt)
|
||||
}
|
||||
if m.FieldCleared(user.FieldEggAt) {
|
||||
fields = append(fields, user.FieldEggAt)
|
||||
}
|
||||
@ -4273,6 +4438,9 @@ func (m *UserMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(user.FieldNext) {
|
||||
fields = append(fields, user.FieldNext)
|
||||
}
|
||||
if m.FieldCleared(user.FieldRoom) {
|
||||
fields = append(fields, user.FieldRoom)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@ -4326,6 +4494,9 @@ func (m *UserMutation) ClearField(name string) error {
|
||||
case user.FieldRaidAt:
|
||||
m.ClearRaidAt()
|
||||
return nil
|
||||
case user.FieldServerAt:
|
||||
m.ClearServerAt()
|
||||
return nil
|
||||
case user.FieldEggAt:
|
||||
m.ClearEggAt()
|
||||
return nil
|
||||
@ -4377,6 +4548,9 @@ func (m *UserMutation) ClearField(name string) error {
|
||||
case user.FieldNext:
|
||||
m.ClearNext()
|
||||
return nil
|
||||
case user.FieldRoom:
|
||||
m.ClearRoom()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User nullable field %s", name)
|
||||
}
|
||||
@ -4430,6 +4604,9 @@ func (m *UserMutation) ResetField(name string) error {
|
||||
case user.FieldRaidAt:
|
||||
m.ResetRaidAt()
|
||||
return nil
|
||||
case user.FieldServerAt:
|
||||
m.ResetServerAt()
|
||||
return nil
|
||||
case user.FieldEggAt:
|
||||
m.ResetEggAt()
|
||||
return nil
|
||||
@ -4481,6 +4658,9 @@ func (m *UserMutation) ResetField(name string) error {
|
||||
case user.FieldNext:
|
||||
m.ResetNext()
|
||||
return nil
|
||||
case user.FieldRoom:
|
||||
m.ResetRoom()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User field %s", name)
|
||||
}
|
||||
|
@ -573,6 +573,12 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -675,9 +681,15 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfCardOwnerRead = [31]string{
|
||||
var jsonFieldsNameOfCardOwnerRead = [33]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
@ -692,23 +704,25 @@ var jsonFieldsNameOfCardOwnerRead = [31]string{
|
||||
11: "created_at",
|
||||
12: "updated_at",
|
||||
13: "raid_at",
|
||||
14: "egg_at",
|
||||
15: "luck",
|
||||
16: "luck_at",
|
||||
17: "like",
|
||||
18: "like_rank",
|
||||
19: "like_at",
|
||||
20: "fav",
|
||||
21: "ten",
|
||||
22: "ten_su",
|
||||
23: "ten_kai",
|
||||
24: "aiten",
|
||||
25: "ten_card",
|
||||
26: "ten_delete",
|
||||
27: "ten_post",
|
||||
28: "ten_get",
|
||||
29: "ten_at",
|
||||
30: "next",
|
||||
14: "server_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "room",
|
||||
}
|
||||
|
||||
// Decode decodes CardOwnerRead from json.
|
||||
@ -716,7 +730,7 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode CardOwnerRead to nil")
|
||||
}
|
||||
var requiredBitSet [4]uint8
|
||||
var requiredBitSet [5]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -864,6 +878,16 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -1034,6 +1058,16 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@ -1043,11 +1077,12 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
for i, mask := range [5]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -2072,6 +2107,12 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -2174,6 +2215,12 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Card != nil {
|
||||
e.FieldStart("card")
|
||||
@ -2186,7 +2233,7 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfCreateUserReq = [33]string{
|
||||
var jsonFieldsNameOfCreateUserReq = [35]string{
|
||||
0: "username",
|
||||
1: "did",
|
||||
2: "member",
|
||||
@ -2202,24 +2249,26 @@ var jsonFieldsNameOfCreateUserReq = [33]string{
|
||||
12: "created_at",
|
||||
13: "updated_at",
|
||||
14: "raid_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "card",
|
||||
15: "server_at",
|
||||
16: "egg_at",
|
||||
17: "luck",
|
||||
18: "luck_at",
|
||||
19: "like",
|
||||
20: "like_rank",
|
||||
21: "like_at",
|
||||
22: "fav",
|
||||
23: "ten",
|
||||
24: "ten_su",
|
||||
25: "ten_kai",
|
||||
26: "aiten",
|
||||
27: "ten_card",
|
||||
28: "ten_delete",
|
||||
29: "ten_post",
|
||||
30: "ten_get",
|
||||
31: "ten_at",
|
||||
32: "next",
|
||||
33: "room",
|
||||
34: "card",
|
||||
}
|
||||
|
||||
// Decode decodes CreateUserReq from json.
|
||||
@ -2385,6 +2434,16 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -2555,6 +2614,16 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
case "card":
|
||||
if err := func() error {
|
||||
s.Card = make([]int, 0)
|
||||
@ -3185,6 +3254,12 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -3287,9 +3362,15 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfGroupUsersList = [31]string{
|
||||
var jsonFieldsNameOfGroupUsersList = [33]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
@ -3304,23 +3385,25 @@ var jsonFieldsNameOfGroupUsersList = [31]string{
|
||||
11: "created_at",
|
||||
12: "updated_at",
|
||||
13: "raid_at",
|
||||
14: "egg_at",
|
||||
15: "luck",
|
||||
16: "luck_at",
|
||||
17: "like",
|
||||
18: "like_rank",
|
||||
19: "like_at",
|
||||
20: "fav",
|
||||
21: "ten",
|
||||
22: "ten_su",
|
||||
23: "ten_kai",
|
||||
24: "aiten",
|
||||
25: "ten_card",
|
||||
26: "ten_delete",
|
||||
27: "ten_post",
|
||||
28: "ten_get",
|
||||
29: "ten_at",
|
||||
30: "next",
|
||||
14: "server_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "room",
|
||||
}
|
||||
|
||||
// Decode decodes GroupUsersList from json.
|
||||
@ -3328,7 +3411,7 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode GroupUsersList to nil")
|
||||
}
|
||||
var requiredBitSet [4]uint8
|
||||
var requiredBitSet [5]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -3476,6 +3559,16 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -3646,6 +3739,16 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@ -3655,11 +3758,12 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
for i, mask := range [5]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -5004,6 +5108,12 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -5106,6 +5216,12 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Card != nil {
|
||||
e.FieldStart("card")
|
||||
@ -5118,7 +5234,7 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUpdateUserReq = [30]string{
|
||||
var jsonFieldsNameOfUpdateUserReq = [32]string{
|
||||
0: "did",
|
||||
1: "member",
|
||||
2: "book",
|
||||
@ -5131,24 +5247,26 @@ var jsonFieldsNameOfUpdateUserReq = [30]string{
|
||||
9: "token",
|
||||
10: "updated_at",
|
||||
11: "raid_at",
|
||||
12: "egg_at",
|
||||
13: "luck",
|
||||
14: "luck_at",
|
||||
15: "like",
|
||||
16: "like_rank",
|
||||
17: "like_at",
|
||||
18: "fav",
|
||||
19: "ten",
|
||||
20: "ten_su",
|
||||
21: "ten_kai",
|
||||
22: "aiten",
|
||||
23: "ten_card",
|
||||
24: "ten_delete",
|
||||
25: "ten_post",
|
||||
26: "ten_get",
|
||||
27: "ten_at",
|
||||
28: "next",
|
||||
29: "card",
|
||||
12: "server_at",
|
||||
13: "egg_at",
|
||||
14: "luck",
|
||||
15: "luck_at",
|
||||
16: "like",
|
||||
17: "like_rank",
|
||||
18: "like_at",
|
||||
19: "fav",
|
||||
20: "ten",
|
||||
21: "ten_su",
|
||||
22: "ten_kai",
|
||||
23: "aiten",
|
||||
24: "ten_card",
|
||||
25: "ten_delete",
|
||||
26: "ten_post",
|
||||
27: "ten_get",
|
||||
28: "ten_at",
|
||||
29: "next",
|
||||
30: "room",
|
||||
31: "card",
|
||||
}
|
||||
|
||||
// Decode decodes UpdateUserReq from json.
|
||||
@ -5279,6 +5397,16 @@ func (s *UpdateUserReq) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -5449,6 +5577,16 @@ func (s *UpdateUserReq) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
case "card":
|
||||
if err := func() error {
|
||||
s.Card = make([]int, 0)
|
||||
@ -5817,6 +5955,12 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -5919,9 +6063,15 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserCreate = [31]string{
|
||||
var jsonFieldsNameOfUserCreate = [33]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
@ -5936,23 +6086,25 @@ var jsonFieldsNameOfUserCreate = [31]string{
|
||||
11: "created_at",
|
||||
12: "updated_at",
|
||||
13: "raid_at",
|
||||
14: "egg_at",
|
||||
15: "luck",
|
||||
16: "luck_at",
|
||||
17: "like",
|
||||
18: "like_rank",
|
||||
19: "like_at",
|
||||
20: "fav",
|
||||
21: "ten",
|
||||
22: "ten_su",
|
||||
23: "ten_kai",
|
||||
24: "aiten",
|
||||
25: "ten_card",
|
||||
26: "ten_delete",
|
||||
27: "ten_post",
|
||||
28: "ten_get",
|
||||
29: "ten_at",
|
||||
30: "next",
|
||||
14: "server_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "room",
|
||||
}
|
||||
|
||||
// Decode decodes UserCreate from json.
|
||||
@ -5960,7 +6112,7 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserCreate to nil")
|
||||
}
|
||||
var requiredBitSet [4]uint8
|
||||
var requiredBitSet [5]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -6108,6 +6260,16 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -6278,6 +6440,16 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@ -6287,11 +6459,12 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
for i, mask := range [5]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -6428,6 +6601,12 @@ func (s *UserList) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -6530,9 +6709,15 @@ func (s *UserList) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserList = [31]string{
|
||||
var jsonFieldsNameOfUserList = [33]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
@ -6547,23 +6732,25 @@ var jsonFieldsNameOfUserList = [31]string{
|
||||
11: "created_at",
|
||||
12: "updated_at",
|
||||
13: "raid_at",
|
||||
14: "egg_at",
|
||||
15: "luck",
|
||||
16: "luck_at",
|
||||
17: "like",
|
||||
18: "like_rank",
|
||||
19: "like_at",
|
||||
20: "fav",
|
||||
21: "ten",
|
||||
22: "ten_su",
|
||||
23: "ten_kai",
|
||||
24: "aiten",
|
||||
25: "ten_card",
|
||||
26: "ten_delete",
|
||||
27: "ten_post",
|
||||
28: "ten_get",
|
||||
29: "ten_at",
|
||||
30: "next",
|
||||
14: "server_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "room",
|
||||
}
|
||||
|
||||
// Decode decodes UserList from json.
|
||||
@ -6571,7 +6758,7 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserList to nil")
|
||||
}
|
||||
var requiredBitSet [4]uint8
|
||||
var requiredBitSet [5]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -6719,6 +6906,16 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -6889,6 +7086,16 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@ -6898,11 +7105,12 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
for i, mask := range [5]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -7039,6 +7247,12 @@ func (s *UserRead) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -7141,9 +7355,15 @@ func (s *UserRead) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserRead = [31]string{
|
||||
var jsonFieldsNameOfUserRead = [33]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
@ -7158,23 +7378,25 @@ var jsonFieldsNameOfUserRead = [31]string{
|
||||
11: "created_at",
|
||||
12: "updated_at",
|
||||
13: "raid_at",
|
||||
14: "egg_at",
|
||||
15: "luck",
|
||||
16: "luck_at",
|
||||
17: "like",
|
||||
18: "like_rank",
|
||||
19: "like_at",
|
||||
20: "fav",
|
||||
21: "ten",
|
||||
22: "ten_su",
|
||||
23: "ten_kai",
|
||||
24: "aiten",
|
||||
25: "ten_card",
|
||||
26: "ten_delete",
|
||||
27: "ten_post",
|
||||
28: "ten_get",
|
||||
29: "ten_at",
|
||||
30: "next",
|
||||
14: "server_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "room",
|
||||
}
|
||||
|
||||
// Decode decodes UserRead from json.
|
||||
@ -7182,7 +7404,7 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserRead to nil")
|
||||
}
|
||||
var requiredBitSet [4]uint8
|
||||
var requiredBitSet [5]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -7330,6 +7552,16 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -7500,6 +7732,16 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@ -7509,11 +7751,12 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
for i, mask := range [5]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -7650,6 +7893,12 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) {
|
||||
s.RaidAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.ServerAt.Set {
|
||||
e.FieldStart("server_at")
|
||||
s.ServerAt.Encode(e, json.EncodeDateTime)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.EggAt.Set {
|
||||
e.FieldStart("egg_at")
|
||||
@ -7752,9 +8001,15 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) {
|
||||
s.Next.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Room.Set {
|
||||
e.FieldStart("room")
|
||||
s.Room.Encode(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserUpdate = [31]string{
|
||||
var jsonFieldsNameOfUserUpdate = [33]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
@ -7769,23 +8024,25 @@ var jsonFieldsNameOfUserUpdate = [31]string{
|
||||
11: "created_at",
|
||||
12: "updated_at",
|
||||
13: "raid_at",
|
||||
14: "egg_at",
|
||||
15: "luck",
|
||||
16: "luck_at",
|
||||
17: "like",
|
||||
18: "like_rank",
|
||||
19: "like_at",
|
||||
20: "fav",
|
||||
21: "ten",
|
||||
22: "ten_su",
|
||||
23: "ten_kai",
|
||||
24: "aiten",
|
||||
25: "ten_card",
|
||||
26: "ten_delete",
|
||||
27: "ten_post",
|
||||
28: "ten_get",
|
||||
29: "ten_at",
|
||||
30: "next",
|
||||
14: "server_at",
|
||||
15: "egg_at",
|
||||
16: "luck",
|
||||
17: "luck_at",
|
||||
18: "like",
|
||||
19: "like_rank",
|
||||
20: "like_at",
|
||||
21: "fav",
|
||||
22: "ten",
|
||||
23: "ten_su",
|
||||
24: "ten_kai",
|
||||
25: "aiten",
|
||||
26: "ten_card",
|
||||
27: "ten_delete",
|
||||
28: "ten_post",
|
||||
29: "ten_get",
|
||||
30: "ten_at",
|
||||
31: "next",
|
||||
32: "room",
|
||||
}
|
||||
|
||||
// Decode decodes UserUpdate from json.
|
||||
@ -7793,7 +8050,7 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserUpdate to nil")
|
||||
}
|
||||
var requiredBitSet [4]uint8
|
||||
var requiredBitSet [5]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -7941,6 +8198,16 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"raid_at\"")
|
||||
}
|
||||
case "server_at":
|
||||
if err := func() error {
|
||||
s.ServerAt.Reset()
|
||||
if err := s.ServerAt.Decode(d, json.DecodeDateTime); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"server_at\"")
|
||||
}
|
||||
case "egg_at":
|
||||
if err := func() error {
|
||||
s.EggAt.Reset()
|
||||
@ -8111,6 +8378,16 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"next\"")
|
||||
}
|
||||
case "room":
|
||||
if err := func() error {
|
||||
s.Room.Reset()
|
||||
if err := s.Room.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"room\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@ -8120,11 +8397,12 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
for i, mask := range [5]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
|
@ -232,6 +232,7 @@ type CardOwnerRead struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -249,6 +250,7 @@ type CardOwnerRead struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@ -321,6 +323,11 @@ func (s *CardOwnerRead) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *CardOwnerRead) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *CardOwnerRead) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -406,6 +413,11 @@ func (s *CardOwnerRead) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *CardOwnerRead) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *CardOwnerRead) SetID(val int) {
|
||||
s.ID = val
|
||||
@ -476,6 +488,11 @@ func (s *CardOwnerRead) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *CardOwnerRead) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *CardOwnerRead) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -561,6 +578,11 @@ func (s *CardOwnerRead) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *CardOwnerRead) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
func (*CardOwnerRead) readCardOwnerRes() {}
|
||||
|
||||
// Ref: #/components/schemas/CardRead
|
||||
@ -949,6 +971,7 @@ type CreateUserReq struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -966,6 +989,7 @@ type CreateUserReq struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
Card []int `json:"card"`
|
||||
}
|
||||
|
||||
@ -1044,6 +1068,11 @@ func (s *CreateUserReq) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *CreateUserReq) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *CreateUserReq) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -1129,6 +1158,11 @@ func (s *CreateUserReq) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *CreateUserReq) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// GetCard returns the value of Card.
|
||||
func (s *CreateUserReq) GetCard() []int {
|
||||
return s.Card
|
||||
@ -1209,6 +1243,11 @@ func (s *CreateUserReq) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *CreateUserReq) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *CreateUserReq) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -1294,6 +1333,11 @@ func (s *CreateUserReq) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *CreateUserReq) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
// SetCard sets the value of Card.
|
||||
func (s *CreateUserReq) SetCard(val []int) {
|
||||
s.Card = val
|
||||
@ -1446,6 +1490,7 @@ type GroupUsersList struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -1463,6 +1508,7 @@ type GroupUsersList struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@ -1535,6 +1581,11 @@ func (s *GroupUsersList) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *GroupUsersList) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *GroupUsersList) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -1620,6 +1671,11 @@ func (s *GroupUsersList) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *GroupUsersList) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *GroupUsersList) SetID(val int) {
|
||||
s.ID = val
|
||||
@ -1690,6 +1746,11 @@ func (s *GroupUsersList) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *GroupUsersList) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *GroupUsersList) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -1775,6 +1836,11 @@ func (s *GroupUsersList) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *GroupUsersList) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
type ListCardOKApplicationJSON []CardList
|
||||
|
||||
func (*ListCardOKApplicationJSON) listCardRes() {}
|
||||
@ -2336,6 +2402,7 @@ type UpdateUserReq struct {
|
||||
Token OptString `json:"token"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -2353,6 +2420,7 @@ type UpdateUserReq struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
Card []int `json:"card"`
|
||||
}
|
||||
|
||||
@ -2416,6 +2484,11 @@ func (s *UpdateUserReq) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *UpdateUserReq) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *UpdateUserReq) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -2501,6 +2574,11 @@ func (s *UpdateUserReq) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *UpdateUserReq) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// GetCard returns the value of Card.
|
||||
func (s *UpdateUserReq) GetCard() []int {
|
||||
return s.Card
|
||||
@ -2566,6 +2644,11 @@ func (s *UpdateUserReq) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *UpdateUserReq) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *UpdateUserReq) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -2651,6 +2734,11 @@ func (s *UpdateUserReq) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *UpdateUserReq) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
// SetCard sets the value of Card.
|
||||
func (s *UpdateUserReq) SetCard(val []int) {
|
||||
s.Card = val
|
||||
@ -2775,6 +2863,7 @@ type UserCreate struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -2792,6 +2881,7 @@ type UserCreate struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@ -2864,6 +2954,11 @@ func (s *UserCreate) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *UserCreate) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *UserCreate) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -2949,6 +3044,11 @@ func (s *UserCreate) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *UserCreate) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *UserCreate) SetID(val int) {
|
||||
s.ID = val
|
||||
@ -3019,6 +3119,11 @@ func (s *UserCreate) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *UserCreate) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *UserCreate) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -3104,6 +3209,11 @@ func (s *UserCreate) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *UserCreate) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
func (*UserCreate) createUserRes() {}
|
||||
|
||||
// Ref: #/components/schemas/UserList
|
||||
@ -3122,6 +3232,7 @@ type UserList struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -3139,6 +3250,7 @@ type UserList struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@ -3211,6 +3323,11 @@ func (s *UserList) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *UserList) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *UserList) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -3296,6 +3413,11 @@ func (s *UserList) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *UserList) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *UserList) SetID(val int) {
|
||||
s.ID = val
|
||||
@ -3366,6 +3488,11 @@ func (s *UserList) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *UserList) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *UserList) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -3451,6 +3578,11 @@ func (s *UserList) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *UserList) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
// Ref: #/components/schemas/UserRead
|
||||
type UserRead struct {
|
||||
ID int `json:"id"`
|
||||
@ -3467,6 +3599,7 @@ type UserRead struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -3484,6 +3617,7 @@ type UserRead struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@ -3556,6 +3690,11 @@ func (s *UserRead) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *UserRead) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *UserRead) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -3641,6 +3780,11 @@ func (s *UserRead) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *UserRead) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *UserRead) SetID(val int) {
|
||||
s.ID = val
|
||||
@ -3711,6 +3855,11 @@ func (s *UserRead) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *UserRead) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *UserRead) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -3796,6 +3945,11 @@ func (s *UserRead) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *UserRead) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
func (*UserRead) readUserRes() {}
|
||||
|
||||
// Ref: #/components/schemas/UserUpdate
|
||||
@ -3814,6 +3968,7 @@ type UserUpdate struct {
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
UpdatedAt OptDateTime `json:"updated_at"`
|
||||
RaidAt OptDateTime `json:"raid_at"`
|
||||
ServerAt OptDateTime `json:"server_at"`
|
||||
EggAt OptDateTime `json:"egg_at"`
|
||||
Luck OptInt `json:"luck"`
|
||||
LuckAt OptDateTime `json:"luck_at"`
|
||||
@ -3831,6 +3986,7 @@ type UserUpdate struct {
|
||||
TenGet OptString `json:"ten_get"`
|
||||
TenAt OptDateTime `json:"ten_at"`
|
||||
Next OptString `json:"next"`
|
||||
Room OptInt `json:"room"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@ -3903,6 +4059,11 @@ func (s *UserUpdate) GetRaidAt() OptDateTime {
|
||||
return s.RaidAt
|
||||
}
|
||||
|
||||
// GetServerAt returns the value of ServerAt.
|
||||
func (s *UserUpdate) GetServerAt() OptDateTime {
|
||||
return s.ServerAt
|
||||
}
|
||||
|
||||
// GetEggAt returns the value of EggAt.
|
||||
func (s *UserUpdate) GetEggAt() OptDateTime {
|
||||
return s.EggAt
|
||||
@ -3988,6 +4149,11 @@ func (s *UserUpdate) GetNext() OptString {
|
||||
return s.Next
|
||||
}
|
||||
|
||||
// GetRoom returns the value of Room.
|
||||
func (s *UserUpdate) GetRoom() OptInt {
|
||||
return s.Room
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *UserUpdate) SetID(val int) {
|
||||
s.ID = val
|
||||
@ -4058,6 +4224,11 @@ func (s *UserUpdate) SetRaidAt(val OptDateTime) {
|
||||
s.RaidAt = val
|
||||
}
|
||||
|
||||
// SetServerAt sets the value of ServerAt.
|
||||
func (s *UserUpdate) SetServerAt(val OptDateTime) {
|
||||
s.ServerAt = val
|
||||
}
|
||||
|
||||
// SetEggAt sets the value of EggAt.
|
||||
func (s *UserUpdate) SetEggAt(val OptDateTime) {
|
||||
s.EggAt = val
|
||||
@ -4143,4 +4314,9 @@ func (s *UserUpdate) SetNext(val OptString) {
|
||||
s.Next = val
|
||||
}
|
||||
|
||||
// SetRoom sets the value of Room.
|
||||
func (s *UserUpdate) SetRoom(val OptInt) {
|
||||
s.Room = val
|
||||
}
|
||||
|
||||
func (*UserUpdate) updateUserRes() {}
|
||||
|
@ -506,6 +506,13 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
|
||||
b.SetPassword(req.Password)
|
||||
|
||||
if v, ok := req.ServerAt.Get(); ok {
|
||||
b.SetServerAt(v)
|
||||
}
|
||||
|
||||
if v, ok := req.Room.Get(); ok {
|
||||
b.SetRoom(v)
|
||||
}
|
||||
if v, ok := req.Fav.Get(); ok {
|
||||
b.SetFav(v)
|
||||
}
|
||||
@ -663,6 +670,12 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v == token {
|
||||
b.SetToken(v)
|
||||
|
||||
if v, ok := req.ServerAt.Get(); ok {
|
||||
b.SetServerAt(v)
|
||||
}
|
||||
if v, ok := req.Room.Get(); ok {
|
||||
b.SetRoom(v)
|
||||
}
|
||||
if v, ok := req.Fav.Get(); ok {
|
||||
b.SetFav(v)
|
||||
}
|
||||
|
@ -163,6 +163,7 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.ServerAt = NewOptDateTime(e.ServerAt)
|
||||
ret.EggAt = NewOptDateTime(e.EggAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
@ -180,6 +181,7 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
ret.Room = NewOptInt(e.Room)
|
||||
return &ret
|
||||
}
|
||||
|
||||
@ -332,6 +334,7 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.ServerAt = NewOptDateTime(e.ServerAt)
|
||||
ret.EggAt = NewOptDateTime(e.EggAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
@ -349,6 +352,7 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
ret.Room = NewOptInt(e.Room)
|
||||
return &ret
|
||||
}
|
||||
|
||||
@ -389,6 +393,7 @@ func NewUserCreate(e *ent.User) *UserCreate {
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.ServerAt = NewOptDateTime(e.ServerAt)
|
||||
ret.EggAt = NewOptDateTime(e.EggAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
@ -406,6 +411,7 @@ func NewUserCreate(e *ent.User) *UserCreate {
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
ret.Room = NewOptInt(e.Room)
|
||||
return &ret
|
||||
}
|
||||
|
||||
@ -446,6 +452,7 @@ func NewUserList(e *ent.User) *UserList {
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.ServerAt = NewOptDateTime(e.ServerAt)
|
||||
ret.EggAt = NewOptDateTime(e.EggAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
@ -463,6 +470,7 @@ func NewUserList(e *ent.User) *UserList {
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
ret.Room = NewOptInt(e.Room)
|
||||
return &ret
|
||||
}
|
||||
|
||||
@ -503,6 +511,7 @@ func NewUserRead(e *ent.User) *UserRead {
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.ServerAt = NewOptDateTime(e.ServerAt)
|
||||
ret.EggAt = NewOptDateTime(e.EggAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
@ -520,6 +529,7 @@ func NewUserRead(e *ent.User) *UserRead {
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
ret.Room = NewOptInt(e.Room)
|
||||
return &ret
|
||||
}
|
||||
|
||||
@ -560,6 +570,7 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
ret.UpdatedAt = NewOptDateTime(e.UpdatedAt)
|
||||
ret.RaidAt = NewOptDateTime(e.RaidAt)
|
||||
ret.ServerAt = NewOptDateTime(e.ServerAt)
|
||||
ret.EggAt = NewOptDateTime(e.EggAt)
|
||||
ret.Luck = NewOptInt(e.Luck)
|
||||
ret.LuckAt = NewOptDateTime(e.LuckAt)
|
||||
@ -577,6 +588,7 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
|
||||
ret.TenGet = NewOptString(e.TenGet)
|
||||
ret.TenAt = NewOptDateTime(e.TenAt)
|
||||
ret.Next = NewOptString(e.Next)
|
||||
ret.Room = NewOptInt(e.Room)
|
||||
return &ret
|
||||
}
|
||||
|
||||
|
@ -823,6 +823,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -878,6 +882,9 @@
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
},
|
||||
"card": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -1060,6 +1067,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1115,6 +1126,9 @@
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
},
|
||||
"card": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -1484,6 +1498,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1538,6 +1556,9 @@
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -1678,6 +1699,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1732,6 +1757,9 @@
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -1793,6 +1821,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1848,6 +1880,9 @@
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
},
|
||||
"card": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -1909,6 +1944,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1963,6 +2002,9 @@
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -2018,6 +2060,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -2072,6 +2118,9 @@
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -2127,6 +2176,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -2181,6 +2234,9 @@
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -2236,6 +2292,10 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"server_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"egg_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -2290,6 +2350,9 @@
|
||||
},
|
||||
"next": {
|
||||
"type": "string"
|
||||
},
|
||||
"room": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -118,24 +118,28 @@ func init() {
|
||||
userDescRaidAt := userFields[14].Descriptor()
|
||||
// user.DefaultRaidAt holds the default value on creation for the raid_at field.
|
||||
user.DefaultRaidAt = userDescRaidAt.Default.(func() time.Time)
|
||||
// userDescServerAt is the schema descriptor for server_at field.
|
||||
userDescServerAt := userFields[15].Descriptor()
|
||||
// user.DefaultServerAt holds the default value on creation for the server_at field.
|
||||
user.DefaultServerAt = userDescServerAt.Default.(func() time.Time)
|
||||
// userDescEggAt is the schema descriptor for egg_at field.
|
||||
userDescEggAt := userFields[15].Descriptor()
|
||||
userDescEggAt := userFields[16].Descriptor()
|
||||
// user.DefaultEggAt holds the default value on creation for the egg_at field.
|
||||
user.DefaultEggAt = userDescEggAt.Default.(func() time.Time)
|
||||
// userDescLuckAt is the schema descriptor for luck_at field.
|
||||
userDescLuckAt := userFields[17].Descriptor()
|
||||
userDescLuckAt := userFields[18].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[20].Descriptor()
|
||||
userDescLikeAt := userFields[21].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[30].Descriptor()
|
||||
userDescTenAt := userFields[31].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[31].Descriptor()
|
||||
userDescNext := userFields[32].Descriptor()
|
||||
// user.DefaultNext holds the default value on creation for the next field.
|
||||
user.DefaultNext = userDescNext.Default.(string)
|
||||
}
|
||||
|
@ -98,6 +98,12 @@ func (User) Fields() []ent.Field {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.Time("server_at").
|
||||
Optional().
|
||||
Default(func() time.Time {
|
||||
return time.Now().In(jst)
|
||||
}),
|
||||
|
||||
field.Time("egg_at").
|
||||
Optional().
|
||||
Default(func() time.Time {
|
||||
@ -162,6 +168,9 @@ func (User) Fields() []ent.Field {
|
||||
Default(Nextime()).
|
||||
Optional(),
|
||||
|
||||
field.Int("room").
|
||||
Optional(),
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
26
ent/user.go
26
ent/user.go
@ -46,6 +46,8 @@ type User struct {
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
// RaidAt holds the value of the "raid_at" field.
|
||||
RaidAt time.Time `json:"raid_at,omitempty"`
|
||||
// ServerAt holds the value of the "server_at" field.
|
||||
ServerAt time.Time `json:"server_at,omitempty"`
|
||||
// EggAt holds the value of the "egg_at" field.
|
||||
EggAt time.Time `json:"egg_at,omitempty"`
|
||||
// Luck holds the value of the "luck" field.
|
||||
@ -80,6 +82,8 @@ type User struct {
|
||||
TenAt time.Time `json:"ten_at,omitempty"`
|
||||
// Next holds the value of the "next" field.
|
||||
Next string `json:"next,omitempty"`
|
||||
// Room holds the value of the "room" field.
|
||||
Room int `json:"room,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges UserEdges `json:"edges"`
|
||||
@ -111,11 +115,11 @@ func (*User) scanValues(columns []string) ([]any, error) {
|
||||
switch columns[i] {
|
||||
case user.FieldMember, user.FieldBook, user.FieldManga, user.FieldBadge, user.FieldBsky, user.FieldMastodon, user.FieldDelete, user.FieldHandle, user.FieldTen:
|
||||
values[i] = new(sql.NullBool)
|
||||
case user.FieldID, user.FieldLuck, user.FieldLike, user.FieldLikeRank, user.FieldFav, user.FieldTenSu, user.FieldTenKai, user.FieldAiten:
|
||||
case user.FieldID, user.FieldLuck, user.FieldLike, user.FieldLikeRank, user.FieldFav, user.FieldTenSu, user.FieldTenKai, user.FieldAiten, user.FieldRoom:
|
||||
values[i] = new(sql.NullInt64)
|
||||
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, user.FieldRaidAt, user.FieldEggAt, user.FieldLuckAt, user.FieldLikeAt, user.FieldTenAt:
|
||||
case user.FieldCreatedAt, user.FieldUpdatedAt, user.FieldRaidAt, user.FieldServerAt, user.FieldEggAt, user.FieldLuckAt, user.FieldLikeAt, user.FieldTenAt:
|
||||
values[i] = new(sql.NullTime)
|
||||
case user.ForeignKeys[0]: // group_users
|
||||
values[i] = new(sql.NullInt64)
|
||||
@ -230,6 +234,12 @@ func (u *User) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
u.RaidAt = value.Time
|
||||
}
|
||||
case user.FieldServerAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field server_at", values[i])
|
||||
} else if value.Valid {
|
||||
u.ServerAt = value.Time
|
||||
}
|
||||
case user.FieldEggAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field egg_at", values[i])
|
||||
@ -332,6 +342,12 @@ func (u *User) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
u.Next = value.String
|
||||
}
|
||||
case user.FieldRoom:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field room", values[i])
|
||||
} else if value.Valid {
|
||||
u.Room = int(value.Int64)
|
||||
}
|
||||
case user.ForeignKeys[0]:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for edge-field group_users", value)
|
||||
@ -415,6 +431,9 @@ func (u *User) String() string {
|
||||
builder.WriteString("raid_at=")
|
||||
builder.WriteString(u.RaidAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("server_at=")
|
||||
builder.WriteString(u.ServerAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("egg_at=")
|
||||
builder.WriteString(u.EggAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
@ -465,6 +484,9 @@ func (u *User) String() string {
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("next=")
|
||||
builder.WriteString(u.Next)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("room=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Room))
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ const (
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// FieldRaidAt holds the string denoting the raid_at field in the database.
|
||||
FieldRaidAt = "raid_at"
|
||||
// FieldServerAt holds the string denoting the server_at field in the database.
|
||||
FieldServerAt = "server_at"
|
||||
// FieldEggAt holds the string denoting the egg_at field in the database.
|
||||
FieldEggAt = "egg_at"
|
||||
// FieldLuck holds the string denoting the luck field in the database.
|
||||
@ -75,6 +77,8 @@ const (
|
||||
FieldTenAt = "ten_at"
|
||||
// FieldNext holds the string denoting the next field in the database.
|
||||
FieldNext = "next"
|
||||
// FieldRoom holds the string denoting the room field in the database.
|
||||
FieldRoom = "room"
|
||||
// EdgeCard holds the string denoting the card edge name in mutations.
|
||||
EdgeCard = "card"
|
||||
// Table holds the table name of the user in the database.
|
||||
@ -106,6 +110,7 @@ var Columns = []string{
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldRaidAt,
|
||||
FieldServerAt,
|
||||
FieldEggAt,
|
||||
FieldLuck,
|
||||
FieldLuckAt,
|
||||
@ -123,6 +128,7 @@ var Columns = []string{
|
||||
FieldTenGet,
|
||||
FieldTenAt,
|
||||
FieldNext,
|
||||
FieldRoom,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "users"
|
||||
@ -173,6 +179,8 @@ var (
|
||||
DefaultUpdatedAt func() time.Time
|
||||
// DefaultRaidAt holds the default value on creation for the "raid_at" field.
|
||||
DefaultRaidAt func() time.Time
|
||||
// DefaultServerAt holds the default value on creation for the "server_at" field.
|
||||
DefaultServerAt func() time.Time
|
||||
// DefaultEggAt holds the default value on creation for the "egg_at" field.
|
||||
DefaultEggAt func() time.Time
|
||||
// DefaultLuckAt holds the default value on creation for the "luck_at" field.
|
||||
|
@ -130,6 +130,11 @@ func RaidAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldRaidAt, v))
|
||||
}
|
||||
|
||||
// ServerAt applies equality check predicate on the "server_at" field. It's identical to ServerAtEQ.
|
||||
func ServerAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// EggAt applies equality check predicate on the "egg_at" field. It's identical to EggAtEQ.
|
||||
func EggAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldEggAt, v))
|
||||
@ -215,6 +220,11 @@ func Next(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNext, v))
|
||||
}
|
||||
|
||||
// Room applies equality check predicate on the "room" field. It's identical to RoomEQ.
|
||||
func Room(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldRoom, v))
|
||||
}
|
||||
|
||||
// UsernameEQ applies the EQ predicate on the "username" field.
|
||||
func UsernameEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUsername, v))
|
||||
@ -805,6 +815,56 @@ func RaidAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldRaidAt))
|
||||
}
|
||||
|
||||
// ServerAtEQ applies the EQ predicate on the "server_at" field.
|
||||
func ServerAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// ServerAtNEQ applies the NEQ predicate on the "server_at" field.
|
||||
func ServerAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// ServerAtIn applies the In predicate on the "server_at" field.
|
||||
func ServerAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldServerAt, vs...))
|
||||
}
|
||||
|
||||
// ServerAtNotIn applies the NotIn predicate on the "server_at" field.
|
||||
func ServerAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldServerAt, vs...))
|
||||
}
|
||||
|
||||
// ServerAtGT applies the GT predicate on the "server_at" field.
|
||||
func ServerAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// ServerAtGTE applies the GTE predicate on the "server_at" field.
|
||||
func ServerAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// ServerAtLT applies the LT predicate on the "server_at" field.
|
||||
func ServerAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// ServerAtLTE applies the LTE predicate on the "server_at" field.
|
||||
func ServerAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldServerAt, v))
|
||||
}
|
||||
|
||||
// ServerAtIsNil applies the IsNil predicate on the "server_at" field.
|
||||
func ServerAtIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldServerAt))
|
||||
}
|
||||
|
||||
// ServerAtNotNil applies the NotNil predicate on the "server_at" field.
|
||||
func ServerAtNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldServerAt))
|
||||
}
|
||||
|
||||
// EggAtEQ applies the EQ predicate on the "egg_at" field.
|
||||
func EggAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldEggAt, v))
|
||||
@ -1750,6 +1810,56 @@ func NextContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldNext, v))
|
||||
}
|
||||
|
||||
// RoomEQ applies the EQ predicate on the "room" field.
|
||||
func RoomEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldRoom, v))
|
||||
}
|
||||
|
||||
// RoomNEQ applies the NEQ predicate on the "room" field.
|
||||
func RoomNEQ(v int) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldRoom, v))
|
||||
}
|
||||
|
||||
// RoomIn applies the In predicate on the "room" field.
|
||||
func RoomIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldRoom, vs...))
|
||||
}
|
||||
|
||||
// RoomNotIn applies the NotIn predicate on the "room" field.
|
||||
func RoomNotIn(vs ...int) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldRoom, vs...))
|
||||
}
|
||||
|
||||
// RoomGT applies the GT predicate on the "room" field.
|
||||
func RoomGT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldRoom, v))
|
||||
}
|
||||
|
||||
// RoomGTE applies the GTE predicate on the "room" field.
|
||||
func RoomGTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldRoom, v))
|
||||
}
|
||||
|
||||
// RoomLT applies the LT predicate on the "room" field.
|
||||
func RoomLT(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldRoom, v))
|
||||
}
|
||||
|
||||
// RoomLTE applies the LTE predicate on the "room" field.
|
||||
func RoomLTE(v int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldRoom, v))
|
||||
}
|
||||
|
||||
// RoomIsNil applies the IsNil predicate on the "room" field.
|
||||
func RoomIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldRoom))
|
||||
}
|
||||
|
||||
// RoomNotNil applies the NotNil predicate on the "room" field.
|
||||
func RoomNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldRoom))
|
||||
}
|
||||
|
||||
// HasCard applies the HasEdge predicate on the "card" edge.
|
||||
func HasCard() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
|
@ -215,6 +215,20 @@ func (uc *UserCreate) SetNillableRaidAt(t *time.Time) *UserCreate {
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetServerAt sets the "server_at" field.
|
||||
func (uc *UserCreate) SetServerAt(t time.Time) *UserCreate {
|
||||
uc.mutation.SetServerAt(t)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableServerAt sets the "server_at" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableServerAt(t *time.Time) *UserCreate {
|
||||
if t != nil {
|
||||
uc.SetServerAt(*t)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetEggAt sets the "egg_at" field.
|
||||
func (uc *UserCreate) SetEggAt(t time.Time) *UserCreate {
|
||||
uc.mutation.SetEggAt(t)
|
||||
@ -453,6 +467,20 @@ func (uc *UserCreate) SetNillableNext(s *string) *UserCreate {
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetRoom sets the "room" field.
|
||||
func (uc *UserCreate) SetRoom(i int) *UserCreate {
|
||||
uc.mutation.SetRoom(i)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableRoom sets the "room" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableRoom(i *int) *UserCreate {
|
||||
if i != nil {
|
||||
uc.SetRoom(*i)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// AddCardIDs adds the "card" edge to the Card entity by IDs.
|
||||
func (uc *UserCreate) AddCardIDs(ids ...int) *UserCreate {
|
||||
uc.mutation.AddCardIDs(ids...)
|
||||
@ -547,6 +575,10 @@ func (uc *UserCreate) defaults() {
|
||||
v := user.DefaultRaidAt()
|
||||
uc.mutation.SetRaidAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.ServerAt(); !ok {
|
||||
v := user.DefaultServerAt()
|
||||
uc.mutation.SetServerAt(v)
|
||||
}
|
||||
if _, ok := uc.mutation.EggAt(); !ok {
|
||||
v := user.DefaultEggAt()
|
||||
uc.mutation.SetEggAt(v)
|
||||
@ -673,6 +705,10 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(user.FieldRaidAt, field.TypeTime, value)
|
||||
_node.RaidAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.ServerAt(); ok {
|
||||
_spec.SetField(user.FieldServerAt, field.TypeTime, value)
|
||||
_node.ServerAt = value
|
||||
}
|
||||
if value, ok := uc.mutation.EggAt(); ok {
|
||||
_spec.SetField(user.FieldEggAt, field.TypeTime, value)
|
||||
_node.EggAt = value
|
||||
@ -741,6 +777,10 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(user.FieldNext, field.TypeString, value)
|
||||
_node.Next = value
|
||||
}
|
||||
if value, ok := uc.mutation.Room(); ok {
|
||||
_spec.SetField(user.FieldRoom, field.TypeInt, value)
|
||||
_node.Room = value
|
||||
}
|
||||
if nodes := uc.mutation.CardIDs(); len(nodes) > 0 {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
|
@ -269,6 +269,26 @@ func (uu *UserUpdate) ClearRaidAt() *UserUpdate {
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetServerAt sets the "server_at" field.
|
||||
func (uu *UserUpdate) SetServerAt(t time.Time) *UserUpdate {
|
||||
uu.mutation.SetServerAt(t)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableServerAt sets the "server_at" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableServerAt(t *time.Time) *UserUpdate {
|
||||
if t != nil {
|
||||
uu.SetServerAt(*t)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearServerAt clears the value of the "server_at" field.
|
||||
func (uu *UserUpdate) ClearServerAt() *UserUpdate {
|
||||
uu.mutation.ClearServerAt()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetEggAt sets the "egg_at" field.
|
||||
func (uu *UserUpdate) SetEggAt(t time.Time) *UserUpdate {
|
||||
uu.mutation.SetEggAt(t)
|
||||
@ -658,6 +678,33 @@ func (uu *UserUpdate) ClearNext() *UserUpdate {
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetRoom sets the "room" field.
|
||||
func (uu *UserUpdate) SetRoom(i int) *UserUpdate {
|
||||
uu.mutation.ResetRoom()
|
||||
uu.mutation.SetRoom(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableRoom sets the "room" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableRoom(i *int) *UserUpdate {
|
||||
if i != nil {
|
||||
uu.SetRoom(*i)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddRoom adds i to the "room" field.
|
||||
func (uu *UserUpdate) AddRoom(i int) *UserUpdate {
|
||||
uu.mutation.AddRoom(i)
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearRoom clears the value of the "room" field.
|
||||
func (uu *UserUpdate) ClearRoom() *UserUpdate {
|
||||
uu.mutation.ClearRoom()
|
||||
return uu
|
||||
}
|
||||
|
||||
// AddCardIDs adds the "card" edge to the Card entity by IDs.
|
||||
func (uu *UserUpdate) AddCardIDs(ids ...int) *UserUpdate {
|
||||
uu.mutation.AddCardIDs(ids...)
|
||||
@ -810,6 +857,12 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if uu.mutation.RaidAtCleared() {
|
||||
_spec.ClearField(user.FieldRaidAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.ServerAt(); ok {
|
||||
_spec.SetField(user.FieldServerAt, field.TypeTime, value)
|
||||
}
|
||||
if uu.mutation.ServerAtCleared() {
|
||||
_spec.ClearField(user.FieldServerAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uu.mutation.EggAt(); ok {
|
||||
_spec.SetField(user.FieldEggAt, field.TypeTime, value)
|
||||
}
|
||||
@ -933,6 +986,15 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if uu.mutation.NextCleared() {
|
||||
_spec.ClearField(user.FieldNext, field.TypeString)
|
||||
}
|
||||
if value, ok := uu.mutation.Room(); ok {
|
||||
_spec.SetField(user.FieldRoom, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uu.mutation.AddedRoom(); ok {
|
||||
_spec.AddField(user.FieldRoom, field.TypeInt, value)
|
||||
}
|
||||
if uu.mutation.RoomCleared() {
|
||||
_spec.ClearField(user.FieldRoom, field.TypeInt)
|
||||
}
|
||||
if uu.mutation.CardCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
@ -1238,6 +1300,26 @@ func (uuo *UserUpdateOne) ClearRaidAt() *UserUpdateOne {
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetServerAt sets the "server_at" field.
|
||||
func (uuo *UserUpdateOne) SetServerAt(t time.Time) *UserUpdateOne {
|
||||
uuo.mutation.SetServerAt(t)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableServerAt sets the "server_at" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableServerAt(t *time.Time) *UserUpdateOne {
|
||||
if t != nil {
|
||||
uuo.SetServerAt(*t)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearServerAt clears the value of the "server_at" field.
|
||||
func (uuo *UserUpdateOne) ClearServerAt() *UserUpdateOne {
|
||||
uuo.mutation.ClearServerAt()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetEggAt sets the "egg_at" field.
|
||||
func (uuo *UserUpdateOne) SetEggAt(t time.Time) *UserUpdateOne {
|
||||
uuo.mutation.SetEggAt(t)
|
||||
@ -1627,6 +1709,33 @@ func (uuo *UserUpdateOne) ClearNext() *UserUpdateOne {
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetRoom sets the "room" field.
|
||||
func (uuo *UserUpdateOne) SetRoom(i int) *UserUpdateOne {
|
||||
uuo.mutation.ResetRoom()
|
||||
uuo.mutation.SetRoom(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableRoom sets the "room" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableRoom(i *int) *UserUpdateOne {
|
||||
if i != nil {
|
||||
uuo.SetRoom(*i)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddRoom adds i to the "room" field.
|
||||
func (uuo *UserUpdateOne) AddRoom(i int) *UserUpdateOne {
|
||||
uuo.mutation.AddRoom(i)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearRoom clears the value of the "room" field.
|
||||
func (uuo *UserUpdateOne) ClearRoom() *UserUpdateOne {
|
||||
uuo.mutation.ClearRoom()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// AddCardIDs adds the "card" edge to the Card entity by IDs.
|
||||
func (uuo *UserUpdateOne) AddCardIDs(ids ...int) *UserUpdateOne {
|
||||
uuo.mutation.AddCardIDs(ids...)
|
||||
@ -1809,6 +1918,12 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
|
||||
if uuo.mutation.RaidAtCleared() {
|
||||
_spec.ClearField(user.FieldRaidAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.ServerAt(); ok {
|
||||
_spec.SetField(user.FieldServerAt, field.TypeTime, value)
|
||||
}
|
||||
if uuo.mutation.ServerAtCleared() {
|
||||
_spec.ClearField(user.FieldServerAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := uuo.mutation.EggAt(); ok {
|
||||
_spec.SetField(user.FieldEggAt, field.TypeTime, value)
|
||||
}
|
||||
@ -1932,6 +2047,15 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
|
||||
if uuo.mutation.NextCleared() {
|
||||
_spec.ClearField(user.FieldNext, field.TypeString)
|
||||
}
|
||||
if value, ok := uuo.mutation.Room(); ok {
|
||||
_spec.SetField(user.FieldRoom, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := uuo.mutation.AddedRoom(); ok {
|
||||
_spec.AddField(user.FieldRoom, field.TypeInt, value)
|
||||
}
|
||||
if uuo.mutation.RoomCleared() {
|
||||
_spec.ClearField(user.FieldRoom, field.TypeInt)
|
||||
}
|
||||
if uuo.mutation.CardCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
|
@ -19,5 +19,7 @@ id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")
|
||||
card=$2
|
||||
cp=$3
|
||||
s=normal
|
||||
skill=ten
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\"}" -sL $host/cards
|
||||
skill=normal
|
||||
count=1
|
||||
author=ai
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\",\"count\":$count,\"author\":\"$author\"}" -sL $host/cards
|
||||
|
@ -9,8 +9,8 @@ fi
|
||||
echo username
|
||||
read
|
||||
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
|
||||
card=16
|
||||
cp=0
|
||||
s=super
|
||||
skill=badge
|
||||
card=2
|
||||
cp=$(($RANDOM % 500 + 300))
|
||||
s=3d
|
||||
skill=3d
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\"}" -sL $host/cards
|
||||
|
28
tmp/card_author_first.zsh
Executable file
28
tmp/card_author_first.zsh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/zsh
|
||||
|
||||
case $OSTYPE in
|
||||
darwin*)
|
||||
alias date="/opt/homebrew/bin/gdate"
|
||||
;;
|
||||
esac
|
||||
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"`
|
||||
|
||||
n=`echo $data|jq length`
|
||||
n=$((n - 1))
|
||||
|
||||
count=1
|
||||
for ((i=0;i<=$n;i++))
|
||||
do
|
||||
username=`echo $data|jq ".[$i]"|jq -r .username`
|
||||
uid=`echo $data|jq ".[$i]"|jq -r .id`
|
||||
acard=`curl -sL "$host/users/$uid/card?itemsPerPage=3000"|jq ".[0]"`
|
||||
cid=`echo $acard|jq -r .id`
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"author\":\"$username\", \"count\":$count,\"token\":\"$token\"}" $host/cards/$cid
|
||||
done
|
@ -22,7 +22,7 @@ if [ -n "$1" ];then
|
||||
if [ "ai" = "$1" ] || [ "yui" = "$1" ];then
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\",\"ten_at\":\"$updated_at_n\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"ten_kai\":0,\"ten\": false}" -s $host/users/$id
|
||||
else
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"ten_at\":\"$updated_at_n\", \"token\": \"$token\"}" -s $host/users/$id
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"ten_at\":\"$updated_at_n\", \"token\": \"$token\", \"raid_at\":\"$raid_at_n\"}" -s $host/users/$id
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"luck_at\": \"$updated_at_n\",\"egg_at\": \"$updated_at_n\", \"token\": \"$token\"}" -s $host/users/$id
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"luck_at\": \"$updated_at_n\", \"ten_at\": \"$updated_at_n\",\"token\": \"$token\"}" -s $host/users/$id
|
||||
fi
|
||||
@ -37,8 +37,6 @@ do
|
||||
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 "{\"egg_at\":\"$raid_at_n\", \"raid_at\":\"$raid_at_n\",\"token\": \"$token\"}" -s $host/users/$id
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"luck_at\": \"$now_at\",\"ten_at\":\"$updated_at_n\", \"token\": \"$token\"}" -s $host/users/$id
|
||||
#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
|
||||
|
@ -29,11 +29,15 @@ curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id}" $host/card
|
||||
echo "\ntest select card (no password)"
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":0,\"status\":\"normal\",\"cp\":1}" $host/cards
|
||||
|
||||
echo "\ntest select card (yes password)"
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":0,\"status\":\"normal\",\"cp\":1,\"password\":\"$pass\"}" $host/cards
|
||||
|
||||
## token
|
||||
echo "\ntest token (no token)"
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"1\"}" -s $host/users/$id
|
||||
echo "\ntest token (yes token)"
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\",\"token\":\"$token\"}" -s $host/users/$id
|
||||
exit
|
||||
|
||||
read
|
||||
|
||||
|
@ -506,6 +506,13 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
|
||||
b.SetPassword(req.Password)
|
||||
|
||||
if v, ok := req.ServerAt.Get(); ok {
|
||||
b.SetServerAt(v)
|
||||
}
|
||||
|
||||
if v, ok := req.Room.Get(); ok {
|
||||
b.SetRoom(v)
|
||||
}
|
||||
if v, ok := req.Fav.Get(); ok {
|
||||
b.SetFav(v)
|
||||
}
|
||||
@ -663,6 +670,12 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v == token {
|
||||
b.SetToken(v)
|
||||
|
||||
if v, ok := req.ServerAt.Get(); ok {
|
||||
b.SetServerAt(v)
|
||||
}
|
||||
if v, ok := req.Room.Get(); ok {
|
||||
b.SetRoom(v)
|
||||
}
|
||||
if v, ok := req.Fav.Get(); ok {
|
||||
b.SetFav(v)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user