add mastodon
This commit is contained in:
parent
c3bd20d90b
commit
dc01c83e9d
@ -7,8 +7,5 @@ su=4000
|
||||
go generate ./...
|
||||
sed -i '' "s/255/$su/g" $d/ent/ogent/oas_parameters_gen.go
|
||||
sed -i '' "s/255/$su/g" $d/ent/openapi.json
|
||||
cp -rf $d/ent/ogent/oas_parameters_gen.go $d/tmp/ogent/oas_parameters_gen.go
|
||||
cp -rf $d/ent/ogent/openapi.json $d/tmp/openapi.json
|
||||
|
||||
cp -rf $d/tmp/ogent ent/
|
||||
cp -rf $d/tmp/openapi.json ent/
|
||||
|
@ -59,6 +59,8 @@ var (
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "username", Type: field.TypeString, Unique: true, Size: 100},
|
||||
{Name: "did", Type: field.TypeString, Nullable: true},
|
||||
{Name: "bsky", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{Name: "mastodon", Type: field.TypeBool, Nullable: true, Default: true},
|
||||
{Name: "delete", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{Name: "handle", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{Name: "token", Type: field.TypeString, Nullable: true},
|
||||
@ -81,7 +83,7 @@ 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: "20230708"},
|
||||
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20230710"},
|
||||
{Name: "group_users", Type: field.TypeInt, Nullable: true},
|
||||
}
|
||||
// UsersTable holds the schema information for the "users" table.
|
||||
@ -92,7 +94,7 @@ var (
|
||||
ForeignKeys: []*schema.ForeignKey{
|
||||
{
|
||||
Symbol: "users_groups_users",
|
||||
Columns: []*schema.Column{UsersColumns[26]},
|
||||
Columns: []*schema.Column{UsersColumns[28]},
|
||||
RefColumns: []*schema.Column{GroupsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
|
148
ent/mutation.go
148
ent/mutation.go
@ -1490,6 +1490,8 @@ type UserMutation struct {
|
||||
id *int
|
||||
username *string
|
||||
did *string
|
||||
bsky *bool
|
||||
mastodon *bool
|
||||
delete *bool
|
||||
handle *bool
|
||||
token *string
|
||||
@ -1712,6 +1714,104 @@ func (m *UserMutation) ResetDid() {
|
||||
delete(m.clearedFields, user.FieldDid)
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (m *UserMutation) SetBsky(b bool) {
|
||||
m.bsky = &b
|
||||
}
|
||||
|
||||
// Bsky returns the value of the "bsky" field in the mutation.
|
||||
func (m *UserMutation) Bsky() (r bool, exists bool) {
|
||||
v := m.bsky
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBsky returns the old "bsky" 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) OldBsky(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldBsky is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldBsky requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBsky: %w", err)
|
||||
}
|
||||
return oldValue.Bsky, nil
|
||||
}
|
||||
|
||||
// ClearBsky clears the value of the "bsky" field.
|
||||
func (m *UserMutation) ClearBsky() {
|
||||
m.bsky = nil
|
||||
m.clearedFields[user.FieldBsky] = struct{}{}
|
||||
}
|
||||
|
||||
// BskyCleared returns if the "bsky" field was cleared in this mutation.
|
||||
func (m *UserMutation) BskyCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldBsky]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBsky resets all changes to the "bsky" field.
|
||||
func (m *UserMutation) ResetBsky() {
|
||||
m.bsky = nil
|
||||
delete(m.clearedFields, user.FieldBsky)
|
||||
}
|
||||
|
||||
// SetMastodon sets the "mastodon" field.
|
||||
func (m *UserMutation) SetMastodon(b bool) {
|
||||
m.mastodon = &b
|
||||
}
|
||||
|
||||
// Mastodon returns the value of the "mastodon" field in the mutation.
|
||||
func (m *UserMutation) Mastodon() (r bool, exists bool) {
|
||||
v := m.mastodon
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldMastodon returns the old "mastodon" 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) OldMastodon(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldMastodon is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldMastodon requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldMastodon: %w", err)
|
||||
}
|
||||
return oldValue.Mastodon, nil
|
||||
}
|
||||
|
||||
// ClearMastodon clears the value of the "mastodon" field.
|
||||
func (m *UserMutation) ClearMastodon() {
|
||||
m.mastodon = nil
|
||||
m.clearedFields[user.FieldMastodon] = struct{}{}
|
||||
}
|
||||
|
||||
// MastodonCleared returns if the "mastodon" field was cleared in this mutation.
|
||||
func (m *UserMutation) MastodonCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldMastodon]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetMastodon resets all changes to the "mastodon" field.
|
||||
func (m *UserMutation) ResetMastodon() {
|
||||
m.mastodon = nil
|
||||
delete(m.clearedFields, user.FieldMastodon)
|
||||
}
|
||||
|
||||
// SetDelete sets the "delete" field.
|
||||
func (m *UserMutation) SetDelete(b bool) {
|
||||
m.delete = &b
|
||||
@ -3061,13 +3161,19 @@ 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, 25)
|
||||
fields := make([]string, 0, 27)
|
||||
if m.username != nil {
|
||||
fields = append(fields, user.FieldUsername)
|
||||
}
|
||||
if m.did != nil {
|
||||
fields = append(fields, user.FieldDid)
|
||||
}
|
||||
if m.bsky != nil {
|
||||
fields = append(fields, user.FieldBsky)
|
||||
}
|
||||
if m.mastodon != nil {
|
||||
fields = append(fields, user.FieldMastodon)
|
||||
}
|
||||
if m.delete != nil {
|
||||
fields = append(fields, user.FieldDelete)
|
||||
}
|
||||
@ -3149,6 +3255,10 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.Username()
|
||||
case user.FieldDid:
|
||||
return m.Did()
|
||||
case user.FieldBsky:
|
||||
return m.Bsky()
|
||||
case user.FieldMastodon:
|
||||
return m.Mastodon()
|
||||
case user.FieldDelete:
|
||||
return m.Delete()
|
||||
case user.FieldHandle:
|
||||
@ -3208,6 +3318,10 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er
|
||||
return m.OldUsername(ctx)
|
||||
case user.FieldDid:
|
||||
return m.OldDid(ctx)
|
||||
case user.FieldBsky:
|
||||
return m.OldBsky(ctx)
|
||||
case user.FieldMastodon:
|
||||
return m.OldMastodon(ctx)
|
||||
case user.FieldDelete:
|
||||
return m.OldDelete(ctx)
|
||||
case user.FieldHandle:
|
||||
@ -3277,6 +3391,20 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetDid(v)
|
||||
return nil
|
||||
case user.FieldBsky:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBsky(v)
|
||||
return nil
|
||||
case user.FieldMastodon:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetMastodon(v)
|
||||
return nil
|
||||
case user.FieldDelete:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
@ -3558,6 +3686,12 @@ func (m *UserMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(user.FieldDid) {
|
||||
fields = append(fields, user.FieldDid)
|
||||
}
|
||||
if m.FieldCleared(user.FieldBsky) {
|
||||
fields = append(fields, user.FieldBsky)
|
||||
}
|
||||
if m.FieldCleared(user.FieldMastodon) {
|
||||
fields = append(fields, user.FieldMastodon)
|
||||
}
|
||||
if m.FieldCleared(user.FieldDelete) {
|
||||
fields = append(fields, user.FieldDelete)
|
||||
}
|
||||
@ -3641,6 +3775,12 @@ func (m *UserMutation) ClearField(name string) error {
|
||||
case user.FieldDid:
|
||||
m.ClearDid()
|
||||
return nil
|
||||
case user.FieldBsky:
|
||||
m.ClearBsky()
|
||||
return nil
|
||||
case user.FieldMastodon:
|
||||
m.ClearMastodon()
|
||||
return nil
|
||||
case user.FieldDelete:
|
||||
m.ClearDelete()
|
||||
return nil
|
||||
@ -3721,6 +3861,12 @@ func (m *UserMutation) ResetField(name string) error {
|
||||
case user.FieldDid:
|
||||
m.ResetDid()
|
||||
return nil
|
||||
case user.FieldBsky:
|
||||
m.ResetBsky()
|
||||
return nil
|
||||
case user.FieldMastodon:
|
||||
m.ResetMastodon()
|
||||
return nil
|
||||
case user.FieldDelete:
|
||||
m.ResetDelete()
|
||||
return nil
|
||||
|
@ -437,6 +437,18 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -565,31 +577,33 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfCardOwnerRead = [24]string{
|
||||
var jsonFieldsNameOfCardOwnerRead = [26]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "created_at",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
3: "bsky",
|
||||
4: "mastodon",
|
||||
5: "delete",
|
||||
6: "handle",
|
||||
7: "created_at",
|
||||
8: "updated_at",
|
||||
9: "raid_at",
|
||||
10: "luck",
|
||||
11: "luck_at",
|
||||
12: "like",
|
||||
13: "like_rank",
|
||||
14: "like_at",
|
||||
15: "fav",
|
||||
16: "ten",
|
||||
17: "ten_su",
|
||||
18: "ten_kai",
|
||||
19: "aiten",
|
||||
20: "ten_card",
|
||||
21: "ten_delete",
|
||||
22: "ten_post",
|
||||
23: "ten_get",
|
||||
24: "ten_at",
|
||||
25: "next",
|
||||
}
|
||||
|
||||
// Decode decodes CardOwnerRead from json.
|
||||
@ -597,7 +611,7 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode CardOwnerRead to nil")
|
||||
}
|
||||
var requiredBitSet [3]uint8
|
||||
var requiredBitSet [4]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -635,6 +649,26 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -854,10 +888,11 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [3]uint8{
|
||||
for i, mask := range [4]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -1701,6 +1736,18 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -1850,33 +1897,35 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfCreateUserReq = [26]string{
|
||||
var jsonFieldsNameOfCreateUserReq = [28]string{
|
||||
0: "username",
|
||||
1: "did",
|
||||
2: "delete",
|
||||
3: "handle",
|
||||
4: "token",
|
||||
5: "password",
|
||||
6: "created_at",
|
||||
7: "updated_at",
|
||||
8: "raid_at",
|
||||
9: "luck",
|
||||
10: "luck_at",
|
||||
11: "like",
|
||||
12: "like_rank",
|
||||
13: "like_at",
|
||||
14: "fav",
|
||||
15: "ten",
|
||||
16: "ten_su",
|
||||
17: "ten_kai",
|
||||
18: "aiten",
|
||||
19: "ten_card",
|
||||
20: "ten_delete",
|
||||
21: "ten_post",
|
||||
22: "ten_get",
|
||||
23: "ten_at",
|
||||
24: "next",
|
||||
25: "card",
|
||||
2: "bsky",
|
||||
3: "mastodon",
|
||||
4: "delete",
|
||||
5: "handle",
|
||||
6: "token",
|
||||
7: "password",
|
||||
8: "created_at",
|
||||
9: "updated_at",
|
||||
10: "raid_at",
|
||||
11: "luck",
|
||||
12: "luck_at",
|
||||
13: "like",
|
||||
14: "like_rank",
|
||||
15: "like_at",
|
||||
16: "fav",
|
||||
17: "ten",
|
||||
18: "ten_su",
|
||||
19: "ten_kai",
|
||||
20: "aiten",
|
||||
21: "ten_card",
|
||||
22: "ten_delete",
|
||||
23: "ten_post",
|
||||
24: "ten_get",
|
||||
25: "ten_at",
|
||||
26: "next",
|
||||
27: "card",
|
||||
}
|
||||
|
||||
// Decode decodes CreateUserReq from json.
|
||||
@ -1910,6 +1959,26 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -1941,7 +2010,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error {
|
||||
return errors.Wrap(err, "decode field \"token\"")
|
||||
}
|
||||
case "password":
|
||||
requiredBitSet[0] |= 1 << 5
|
||||
requiredBitSet[0] |= 1 << 7
|
||||
if err := func() error {
|
||||
v, err := d.Str()
|
||||
s.Password = string(v)
|
||||
@ -2171,7 +2240,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error {
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [4]uint8{
|
||||
0b00100001,
|
||||
0b10000001,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
@ -2705,6 +2774,18 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -2833,31 +2914,33 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfGroupUsersList = [24]string{
|
||||
var jsonFieldsNameOfGroupUsersList = [26]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "created_at",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
3: "bsky",
|
||||
4: "mastodon",
|
||||
5: "delete",
|
||||
6: "handle",
|
||||
7: "created_at",
|
||||
8: "updated_at",
|
||||
9: "raid_at",
|
||||
10: "luck",
|
||||
11: "luck_at",
|
||||
12: "like",
|
||||
13: "like_rank",
|
||||
14: "like_at",
|
||||
15: "fav",
|
||||
16: "ten",
|
||||
17: "ten_su",
|
||||
18: "ten_kai",
|
||||
19: "aiten",
|
||||
20: "ten_card",
|
||||
21: "ten_delete",
|
||||
22: "ten_post",
|
||||
23: "ten_get",
|
||||
24: "ten_at",
|
||||
25: "next",
|
||||
}
|
||||
|
||||
// Decode decodes GroupUsersList from json.
|
||||
@ -2865,7 +2948,7 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode GroupUsersList to nil")
|
||||
}
|
||||
var requiredBitSet [3]uint8
|
||||
var requiredBitSet [4]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -2903,6 +2986,26 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -3122,10 +3225,11 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [3]uint8{
|
||||
for i, mask := range [4]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -4336,6 +4440,18 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -4474,30 +4590,32 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUpdateUserReq = [23]string{
|
||||
var jsonFieldsNameOfUpdateUserReq = [25]string{
|
||||
0: "did",
|
||||
1: "delete",
|
||||
2: "handle",
|
||||
3: "token",
|
||||
4: "updated_at",
|
||||
5: "raid_at",
|
||||
6: "luck",
|
||||
7: "luck_at",
|
||||
8: "like",
|
||||
9: "like_rank",
|
||||
10: "like_at",
|
||||
11: "fav",
|
||||
12: "ten",
|
||||
13: "ten_su",
|
||||
14: "ten_kai",
|
||||
15: "aiten",
|
||||
16: "ten_card",
|
||||
17: "ten_delete",
|
||||
18: "ten_post",
|
||||
19: "ten_get",
|
||||
20: "ten_at",
|
||||
21: "next",
|
||||
22: "card",
|
||||
1: "bsky",
|
||||
2: "mastodon",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "token",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
24: "card",
|
||||
}
|
||||
|
||||
// Decode decodes UpdateUserReq from json.
|
||||
@ -4518,6 +4636,26 @@ func (s *UpdateUserReq) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -4995,6 +5133,18 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -5123,31 +5273,33 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserCreate = [24]string{
|
||||
var jsonFieldsNameOfUserCreate = [26]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "created_at",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
3: "bsky",
|
||||
4: "mastodon",
|
||||
5: "delete",
|
||||
6: "handle",
|
||||
7: "created_at",
|
||||
8: "updated_at",
|
||||
9: "raid_at",
|
||||
10: "luck",
|
||||
11: "luck_at",
|
||||
12: "like",
|
||||
13: "like_rank",
|
||||
14: "like_at",
|
||||
15: "fav",
|
||||
16: "ten",
|
||||
17: "ten_su",
|
||||
18: "ten_kai",
|
||||
19: "aiten",
|
||||
20: "ten_card",
|
||||
21: "ten_delete",
|
||||
22: "ten_post",
|
||||
23: "ten_get",
|
||||
24: "ten_at",
|
||||
25: "next",
|
||||
}
|
||||
|
||||
// Decode decodes UserCreate from json.
|
||||
@ -5155,7 +5307,7 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserCreate to nil")
|
||||
}
|
||||
var requiredBitSet [3]uint8
|
||||
var requiredBitSet [4]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -5193,6 +5345,26 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -5412,10 +5584,11 @@ func (s *UserCreate) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [3]uint8{
|
||||
for i, mask := range [4]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -5486,6 +5659,18 @@ func (s *UserList) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -5614,31 +5799,33 @@ func (s *UserList) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserList = [24]string{
|
||||
var jsonFieldsNameOfUserList = [26]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "created_at",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
3: "bsky",
|
||||
4: "mastodon",
|
||||
5: "delete",
|
||||
6: "handle",
|
||||
7: "created_at",
|
||||
8: "updated_at",
|
||||
9: "raid_at",
|
||||
10: "luck",
|
||||
11: "luck_at",
|
||||
12: "like",
|
||||
13: "like_rank",
|
||||
14: "like_at",
|
||||
15: "fav",
|
||||
16: "ten",
|
||||
17: "ten_su",
|
||||
18: "ten_kai",
|
||||
19: "aiten",
|
||||
20: "ten_card",
|
||||
21: "ten_delete",
|
||||
22: "ten_post",
|
||||
23: "ten_get",
|
||||
24: "ten_at",
|
||||
25: "next",
|
||||
}
|
||||
|
||||
// Decode decodes UserList from json.
|
||||
@ -5646,7 +5833,7 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserList to nil")
|
||||
}
|
||||
var requiredBitSet [3]uint8
|
||||
var requiredBitSet [4]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -5684,6 +5871,26 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -5903,10 +6110,11 @@ func (s *UserList) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [3]uint8{
|
||||
for i, mask := range [4]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -5977,6 +6185,18 @@ func (s *UserRead) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -6105,31 +6325,33 @@ func (s *UserRead) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserRead = [24]string{
|
||||
var jsonFieldsNameOfUserRead = [26]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "created_at",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
3: "bsky",
|
||||
4: "mastodon",
|
||||
5: "delete",
|
||||
6: "handle",
|
||||
7: "created_at",
|
||||
8: "updated_at",
|
||||
9: "raid_at",
|
||||
10: "luck",
|
||||
11: "luck_at",
|
||||
12: "like",
|
||||
13: "like_rank",
|
||||
14: "like_at",
|
||||
15: "fav",
|
||||
16: "ten",
|
||||
17: "ten_su",
|
||||
18: "ten_kai",
|
||||
19: "aiten",
|
||||
20: "ten_card",
|
||||
21: "ten_delete",
|
||||
22: "ten_post",
|
||||
23: "ten_get",
|
||||
24: "ten_at",
|
||||
25: "next",
|
||||
}
|
||||
|
||||
// Decode decodes UserRead from json.
|
||||
@ -6137,7 +6359,7 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserRead to nil")
|
||||
}
|
||||
var requiredBitSet [3]uint8
|
||||
var requiredBitSet [4]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -6175,6 +6397,26 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -6394,10 +6636,11 @@ func (s *UserRead) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [3]uint8{
|
||||
for i, mask := range [4]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
@ -6468,6 +6711,18 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) {
|
||||
s.Did.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Bsky.Set {
|
||||
e.FieldStart("bsky")
|
||||
s.Bsky.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Mastodon.Set {
|
||||
e.FieldStart("mastodon")
|
||||
s.Mastodon.Encode(e)
|
||||
}
|
||||
}
|
||||
{
|
||||
if s.Delete.Set {
|
||||
e.FieldStart("delete")
|
||||
@ -6596,31 +6851,33 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) {
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfUserUpdate = [24]string{
|
||||
var jsonFieldsNameOfUserUpdate = [26]string{
|
||||
0: "id",
|
||||
1: "username",
|
||||
2: "did",
|
||||
3: "delete",
|
||||
4: "handle",
|
||||
5: "created_at",
|
||||
6: "updated_at",
|
||||
7: "raid_at",
|
||||
8: "luck",
|
||||
9: "luck_at",
|
||||
10: "like",
|
||||
11: "like_rank",
|
||||
12: "like_at",
|
||||
13: "fav",
|
||||
14: "ten",
|
||||
15: "ten_su",
|
||||
16: "ten_kai",
|
||||
17: "aiten",
|
||||
18: "ten_card",
|
||||
19: "ten_delete",
|
||||
20: "ten_post",
|
||||
21: "ten_get",
|
||||
22: "ten_at",
|
||||
23: "next",
|
||||
3: "bsky",
|
||||
4: "mastodon",
|
||||
5: "delete",
|
||||
6: "handle",
|
||||
7: "created_at",
|
||||
8: "updated_at",
|
||||
9: "raid_at",
|
||||
10: "luck",
|
||||
11: "luck_at",
|
||||
12: "like",
|
||||
13: "like_rank",
|
||||
14: "like_at",
|
||||
15: "fav",
|
||||
16: "ten",
|
||||
17: "ten_su",
|
||||
18: "ten_kai",
|
||||
19: "aiten",
|
||||
20: "ten_card",
|
||||
21: "ten_delete",
|
||||
22: "ten_post",
|
||||
23: "ten_get",
|
||||
24: "ten_at",
|
||||
25: "next",
|
||||
}
|
||||
|
||||
// Decode decodes UserUpdate from json.
|
||||
@ -6628,7 +6885,7 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode UserUpdate to nil")
|
||||
}
|
||||
var requiredBitSet [3]uint8
|
||||
var requiredBitSet [4]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@ -6666,6 +6923,26 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"did\"")
|
||||
}
|
||||
case "bsky":
|
||||
if err := func() error {
|
||||
s.Bsky.Reset()
|
||||
if err := s.Bsky.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"bsky\"")
|
||||
}
|
||||
case "mastodon":
|
||||
if err := func() error {
|
||||
s.Mastodon.Reset()
|
||||
if err := s.Mastodon.Decode(d); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"mastodon\"")
|
||||
}
|
||||
case "delete":
|
||||
if err := func() error {
|
||||
s.Delete.Reset()
|
||||
@ -6885,10 +7162,11 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [3]uint8{
|
||||
for i, mask := range [4]uint8{
|
||||
0b00000011,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
0b00000000,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
|
@ -177,6 +177,8 @@ type CardOwnerRead struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
@ -215,6 +217,16 @@ func (s *CardOwnerRead) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *CardOwnerRead) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *CardOwnerRead) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *CardOwnerRead) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -335,6 +347,16 @@ func (s *CardOwnerRead) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *CardOwnerRead) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *CardOwnerRead) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *CardOwnerRead) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -749,6 +771,8 @@ func (s *CreateGroupReq) SetUsers(val []int) {
|
||||
type CreateUserReq struct {
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
Token OptString `json:"token"`
|
||||
@ -785,6 +809,16 @@ func (s *CreateUserReq) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *CreateUserReq) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *CreateUserReq) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *CreateUserReq) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -915,6 +949,16 @@ func (s *CreateUserReq) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *CreateUserReq) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *CreateUserReq) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *CreateUserReq) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -1171,6 +1215,8 @@ type GroupUsersList struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
@ -1209,6 +1255,16 @@ func (s *GroupUsersList) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *GroupUsersList) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *GroupUsersList) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *GroupUsersList) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -1329,6 +1385,16 @@ func (s *GroupUsersList) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *GroupUsersList) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *GroupUsersList) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *GroupUsersList) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -1940,6 +2006,8 @@ func (s *UpdateGroupReq) SetUsers(val []int) {
|
||||
|
||||
type UpdateUserReq struct {
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
Token OptString `json:"token"`
|
||||
@ -1969,6 +2037,16 @@ func (s *UpdateUserReq) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UpdateUserReq) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *UpdateUserReq) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *UpdateUserReq) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -2084,6 +2162,16 @@ func (s *UpdateUserReq) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UpdateUserReq) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *UpdateUserReq) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *UpdateUserReq) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -2280,6 +2368,8 @@ type UserCreate struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
@ -2318,6 +2408,16 @@ func (s *UserCreate) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserCreate) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *UserCreate) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *UserCreate) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -2438,6 +2538,16 @@ func (s *UserCreate) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserCreate) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *UserCreate) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *UserCreate) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -2550,6 +2660,8 @@ type UserList struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
@ -2588,6 +2700,16 @@ func (s *UserList) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserList) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *UserList) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *UserList) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -2708,6 +2830,16 @@ func (s *UserList) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserList) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *UserList) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *UserList) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -2818,6 +2950,8 @@ type UserRead struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
@ -2856,6 +2990,16 @@ func (s *UserRead) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserRead) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *UserRead) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *UserRead) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -2976,6 +3120,16 @@ func (s *UserRead) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserRead) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *UserRead) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *UserRead) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
@ -3088,6 +3242,8 @@ type UserUpdate struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
Handle OptBool `json:"handle"`
|
||||
CreatedAt OptDateTime `json:"created_at"`
|
||||
@ -3126,6 +3282,16 @@ func (s *UserUpdate) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserUpdate) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
}
|
||||
|
||||
// GetMastodon returns the value of Mastodon.
|
||||
func (s *UserUpdate) GetMastodon() OptBool {
|
||||
return s.Mastodon
|
||||
}
|
||||
|
||||
// GetDelete returns the value of Delete.
|
||||
func (s *UserUpdate) GetDelete() OptBool {
|
||||
return s.Delete
|
||||
@ -3246,6 +3412,16 @@ func (s *UserUpdate) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserUpdate) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
}
|
||||
|
||||
// SetMastodon sets the value of Mastodon.
|
||||
func (s *UserUpdate) SetMastodon(val OptBool) {
|
||||
s.Mastodon = val
|
||||
}
|
||||
|
||||
// SetDelete sets the value of Delete.
|
||||
func (s *UserUpdate) SetDelete(val OptBool) {
|
||||
s.Delete = val
|
||||
|
@ -493,6 +493,13 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Bsky.Get(); ok {
|
||||
b.SetBsky(v)
|
||||
}
|
||||
if v, ok := req.Mastodon.Get(); ok {
|
||||
b.SetMastodon(v)
|
||||
}
|
||||
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
@ -629,6 +636,12 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Bsky.Get(); ok {
|
||||
b.SetBsky(v)
|
||||
}
|
||||
if v, ok := req.Mastodon.Get(); ok {
|
||||
b.SetMastodon(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
|
@ -144,6 +144,8 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.Handle = NewOptBool(e.Handle)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
@ -306,6 +308,8 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.Handle = NewOptBool(e.Handle)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
@ -356,6 +360,8 @@ func NewUserCreate(e *ent.User) *UserCreate {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.Handle = NewOptBool(e.Handle)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
@ -406,6 +412,8 @@ func NewUserList(e *ent.User) *UserList {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.Handle = NewOptBool(e.Handle)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
@ -456,6 +464,8 @@ func NewUserRead(e *ent.User) *UserRead {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.Handle = NewOptBool(e.Handle)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
@ -506,6 +516,8 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
ret.Handle = NewOptBool(e.Handle)
|
||||
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
|
||||
|
158
ent/openapi.json
158
ent/openapi.json
@ -30,7 +30,7 @@
|
||||
"description": "item count to render per page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"maximum": 3000,
|
||||
"maximum": 4000,
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
@ -89,6 +89,9 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"cp": {
|
||||
"type": "integer"
|
||||
},
|
||||
@ -243,6 +246,15 @@
|
||||
"skill": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"cp": {
|
||||
"type": "integer"
|
||||
},
|
||||
"owner": {
|
||||
"type": "integer"
|
||||
}
|
||||
@ -372,7 +384,7 @@
|
||||
"description": "item count to render per page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"maximum": 3000,
|
||||
"maximum": 4000,
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
@ -698,7 +710,7 @@
|
||||
"description": "item count to render per page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"maximum": 3000,
|
||||
"maximum": 4000,
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
@ -751,9 +763,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -789,6 +810,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -798,6 +822,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -964,9 +991,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -995,6 +1031,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1004,6 +1043,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1171,6 +1213,9 @@
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"cp": {
|
||||
"type": "integer"
|
||||
},
|
||||
@ -1323,9 +1368,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1355,6 +1409,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1364,6 +1421,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1486,9 +1546,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1518,6 +1587,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1527,6 +1599,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1564,9 +1639,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1602,6 +1686,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1611,6 +1698,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1655,9 +1745,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1687,6 +1786,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1696,6 +1798,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1733,9 +1838,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1765,6 +1879,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1774,6 +1891,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1811,9 +1931,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1843,6 +1972,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1852,6 +1984,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1889,9 +2024,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mastodon": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"delete": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"handle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -1921,6 +2065,9 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"fav": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1930,6 +2077,9 @@
|
||||
"ten_kai": {
|
||||
"type": "integer"
|
||||
},
|
||||
"aiten": {
|
||||
"type": "integer"
|
||||
},
|
||||
"ten_card": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -2104,4 +2254,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -70,44 +70,52 @@ func init() {
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// userDescBsky is the schema descriptor for bsky field.
|
||||
userDescBsky := userFields[2].Descriptor()
|
||||
// user.DefaultBsky holds the default value on creation for the bsky field.
|
||||
user.DefaultBsky = userDescBsky.Default.(bool)
|
||||
// userDescMastodon is the schema descriptor for mastodon field.
|
||||
userDescMastodon := userFields[3].Descriptor()
|
||||
// user.DefaultMastodon holds the default value on creation for the mastodon field.
|
||||
user.DefaultMastodon = userDescMastodon.Default.(bool)
|
||||
// userDescDelete is the schema descriptor for delete field.
|
||||
userDescDelete := userFields[2].Descriptor()
|
||||
userDescDelete := userFields[4].Descriptor()
|
||||
// user.DefaultDelete holds the default value on creation for the delete field.
|
||||
user.DefaultDelete = userDescDelete.Default.(bool)
|
||||
// userDescHandle is the schema descriptor for handle field.
|
||||
userDescHandle := userFields[3].Descriptor()
|
||||
userDescHandle := userFields[5].Descriptor()
|
||||
// user.DefaultHandle holds the default value on creation for the handle field.
|
||||
user.DefaultHandle = userDescHandle.Default.(bool)
|
||||
// userDescPassword is the schema descriptor for password field.
|
||||
userDescPassword := userFields[5].Descriptor()
|
||||
userDescPassword := userFields[7].Descriptor()
|
||||
// user.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
|
||||
user.PasswordValidator = userDescPassword.Validators[0].(func(string) error)
|
||||
// userDescCreatedAt is the schema descriptor for created_at field.
|
||||
userDescCreatedAt := userFields[6].Descriptor()
|
||||
userDescCreatedAt := userFields[8].Descriptor()
|
||||
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
|
||||
// userDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
userDescUpdatedAt := userFields[7].Descriptor()
|
||||
userDescUpdatedAt := userFields[9].Descriptor()
|
||||
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
||||
// userDescRaidAt is the schema descriptor for raid_at field.
|
||||
userDescRaidAt := userFields[8].Descriptor()
|
||||
userDescRaidAt := userFields[10].Descriptor()
|
||||
// user.DefaultRaidAt holds the default value on creation for the raid_at field.
|
||||
user.DefaultRaidAt = userDescRaidAt.Default.(func() time.Time)
|
||||
// userDescLuckAt is the schema descriptor for luck_at field.
|
||||
userDescLuckAt := userFields[10].Descriptor()
|
||||
userDescLuckAt := userFields[12].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[13].Descriptor()
|
||||
userDescLikeAt := userFields[15].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[23].Descriptor()
|
||||
userDescTenAt := userFields[25].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[24].Descriptor()
|
||||
userDescNext := userFields[26].Descriptor()
|
||||
// user.DefaultNext holds the default value on creation for the next field.
|
||||
user.DefaultNext = userDescNext.Default.(string)
|
||||
}
|
||||
|
@ -38,6 +38,14 @@ func (User) Fields() []ent.Field {
|
||||
field.String("did").
|
||||
Optional(),
|
||||
|
||||
field.Bool("bsky").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
||||
field.Bool("mastodon").
|
||||
Default(true).
|
||||
Optional(),
|
||||
|
||||
field.Bool("delete").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
24
ent/user.go
24
ent/user.go
@ -20,6 +20,10 @@ type User struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
// Did holds the value of the "did" field.
|
||||
Did string `json:"did,omitempty"`
|
||||
// Bsky holds the value of the "bsky" field.
|
||||
Bsky bool `json:"bsky,omitempty"`
|
||||
// Mastodon holds the value of the "mastodon" field.
|
||||
Mastodon bool `json:"mastodon,omitempty"`
|
||||
// Delete holds the value of the "delete" field.
|
||||
Delete bool `json:"delete,omitempty"`
|
||||
// Handle holds the value of the "handle" field.
|
||||
@ -95,7 +99,7 @@ func (*User) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case user.FieldDelete, user.FieldHandle, user.FieldTen:
|
||||
case 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:
|
||||
values[i] = new(sql.NullInt64)
|
||||
@ -138,6 +142,18 @@ func (u *User) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
u.Did = value.String
|
||||
}
|
||||
case user.FieldBsky:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field bsky", values[i])
|
||||
} else if value.Valid {
|
||||
u.Bsky = value.Bool
|
||||
}
|
||||
case user.FieldMastodon:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field mastodon", values[i])
|
||||
} else if value.Valid {
|
||||
u.Mastodon = value.Bool
|
||||
}
|
||||
case user.FieldDelete:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field delete", values[i])
|
||||
@ -322,6 +338,12 @@ func (u *User) String() string {
|
||||
builder.WriteString("did=")
|
||||
builder.WriteString(u.Did)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("bsky=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Bsky))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("mastodon=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Mastodon))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("delete=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Delete))
|
||||
builder.WriteString(", ")
|
||||
|
@ -15,6 +15,10 @@ const (
|
||||
FieldUsername = "username"
|
||||
// FieldDid holds the string denoting the did field in the database.
|
||||
FieldDid = "did"
|
||||
// FieldBsky holds the string denoting the bsky field in the database.
|
||||
FieldBsky = "bsky"
|
||||
// FieldMastodon holds the string denoting the mastodon field in the database.
|
||||
FieldMastodon = "mastodon"
|
||||
// FieldDelete holds the string denoting the delete field in the database.
|
||||
FieldDelete = "delete"
|
||||
// FieldHandle holds the string denoting the handle field in the database.
|
||||
@ -79,6 +83,8 @@ var Columns = []string{
|
||||
FieldID,
|
||||
FieldUsername,
|
||||
FieldDid,
|
||||
FieldBsky,
|
||||
FieldMastodon,
|
||||
FieldDelete,
|
||||
FieldHandle,
|
||||
FieldToken,
|
||||
@ -128,6 +134,10 @@ func ValidColumn(column string) bool {
|
||||
var (
|
||||
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
||||
UsernameValidator func(string) error
|
||||
// DefaultBsky holds the default value on creation for the "bsky" field.
|
||||
DefaultBsky bool
|
||||
// DefaultMastodon holds the default value on creation for the "mastodon" field.
|
||||
DefaultMastodon bool
|
||||
// DefaultDelete holds the default value on creation for the "delete" field.
|
||||
DefaultDelete bool
|
||||
// DefaultHandle holds the default value on creation for the "handle" field.
|
||||
|
@ -65,6 +65,16 @@ func Did(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldDid, v))
|
||||
}
|
||||
|
||||
// Bsky applies equality check predicate on the "bsky" field. It's identical to BskyEQ.
|
||||
func Bsky(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBsky, v))
|
||||
}
|
||||
|
||||
// Mastodon applies equality check predicate on the "mastodon" field. It's identical to MastodonEQ.
|
||||
func Mastodon(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldMastodon, v))
|
||||
}
|
||||
|
||||
// Delete applies equality check predicate on the "delete" field. It's identical to DeleteEQ.
|
||||
func Delete(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldDelete, v))
|
||||
@ -320,6 +330,46 @@ func DidContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldDid, v))
|
||||
}
|
||||
|
||||
// BskyEQ applies the EQ predicate on the "bsky" field.
|
||||
func BskyEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBsky, v))
|
||||
}
|
||||
|
||||
// BskyNEQ applies the NEQ predicate on the "bsky" field.
|
||||
func BskyNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldBsky, v))
|
||||
}
|
||||
|
||||
// BskyIsNil applies the IsNil predicate on the "bsky" field.
|
||||
func BskyIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldBsky))
|
||||
}
|
||||
|
||||
// BskyNotNil applies the NotNil predicate on the "bsky" field.
|
||||
func BskyNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldBsky))
|
||||
}
|
||||
|
||||
// MastodonEQ applies the EQ predicate on the "mastodon" field.
|
||||
func MastodonEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldMastodon, v))
|
||||
}
|
||||
|
||||
// MastodonNEQ applies the NEQ predicate on the "mastodon" field.
|
||||
func MastodonNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldMastodon, v))
|
||||
}
|
||||
|
||||
// MastodonIsNil applies the IsNil predicate on the "mastodon" field.
|
||||
func MastodonIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldMastodon))
|
||||
}
|
||||
|
||||
// MastodonNotNil applies the NotNil predicate on the "mastodon" field.
|
||||
func MastodonNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldMastodon))
|
||||
}
|
||||
|
||||
// DeleteEQ applies the EQ predicate on the "delete" field.
|
||||
func DeleteEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldDelete, v))
|
||||
|
@ -41,6 +41,34 @@ func (uc *UserCreate) SetNillableDid(s *string) *UserCreate {
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (uc *UserCreate) SetBsky(b bool) *UserCreate {
|
||||
uc.mutation.SetBsky(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableBsky sets the "bsky" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableBsky(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetBsky(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetMastodon sets the "mastodon" field.
|
||||
func (uc *UserCreate) SetMastodon(b bool) *UserCreate {
|
||||
uc.mutation.SetMastodon(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableMastodon sets the "mastodon" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableMastodon(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetMastodon(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetDelete sets the "delete" field.
|
||||
func (uc *UserCreate) SetDelete(b bool) *UserCreate {
|
||||
uc.mutation.SetDelete(b)
|
||||
@ -405,6 +433,14 @@ func (uc *UserCreate) ExecX(ctx context.Context) {
|
||||
|
||||
// defaults sets the default values of the builder before save.
|
||||
func (uc *UserCreate) defaults() {
|
||||
if _, ok := uc.mutation.Bsky(); !ok {
|
||||
v := user.DefaultBsky
|
||||
uc.mutation.SetBsky(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Mastodon(); !ok {
|
||||
v := user.DefaultMastodon
|
||||
uc.mutation.SetMastodon(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Delete(); !ok {
|
||||
v := user.DefaultDelete
|
||||
uc.mutation.SetDelete(v)
|
||||
@ -495,6 +531,14 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(user.FieldDid, field.TypeString, value)
|
||||
_node.Did = value
|
||||
}
|
||||
if value, ok := uc.mutation.Bsky(); ok {
|
||||
_spec.SetField(user.FieldBsky, field.TypeBool, value)
|
||||
_node.Bsky = value
|
||||
}
|
||||
if value, ok := uc.mutation.Mastodon(); ok {
|
||||
_spec.SetField(user.FieldMastodon, field.TypeBool, value)
|
||||
_node.Mastodon = value
|
||||
}
|
||||
if value, ok := uc.mutation.Delete(); ok {
|
||||
_spec.SetField(user.FieldDelete, field.TypeBool, value)
|
||||
_node.Delete = value
|
||||
|
@ -49,6 +49,46 @@ func (uu *UserUpdate) ClearDid() *UserUpdate {
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (uu *UserUpdate) SetBsky(b bool) *UserUpdate {
|
||||
uu.mutation.SetBsky(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableBsky sets the "bsky" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableBsky(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetBsky(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearBsky clears the value of the "bsky" field.
|
||||
func (uu *UserUpdate) ClearBsky() *UserUpdate {
|
||||
uu.mutation.ClearBsky()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetMastodon sets the "mastodon" field.
|
||||
func (uu *UserUpdate) SetMastodon(b bool) *UserUpdate {
|
||||
uu.mutation.SetMastodon(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableMastodon sets the "mastodon" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableMastodon(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetMastodon(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearMastodon clears the value of the "mastodon" field.
|
||||
func (uu *UserUpdate) ClearMastodon() *UserUpdate {
|
||||
uu.mutation.ClearMastodon()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetDelete sets the "delete" field.
|
||||
func (uu *UserUpdate) SetDelete(b bool) *UserUpdate {
|
||||
uu.mutation.SetDelete(b)
|
||||
@ -601,6 +641,18 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if uu.mutation.DidCleared() {
|
||||
_spec.ClearField(user.FieldDid, field.TypeString)
|
||||
}
|
||||
if value, ok := uu.mutation.Bsky(); ok {
|
||||
_spec.SetField(user.FieldBsky, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.BskyCleared() {
|
||||
_spec.ClearField(user.FieldBsky, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.Mastodon(); ok {
|
||||
_spec.SetField(user.FieldMastodon, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.MastodonCleared() {
|
||||
_spec.ClearField(user.FieldMastodon, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.Delete(); ok {
|
||||
_spec.SetField(user.FieldDelete, field.TypeBool, value)
|
||||
}
|
||||
@ -836,6 +888,46 @@ func (uuo *UserUpdateOne) ClearDid() *UserUpdateOne {
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (uuo *UserUpdateOne) SetBsky(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetBsky(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableBsky sets the "bsky" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableBsky(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetBsky(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearBsky clears the value of the "bsky" field.
|
||||
func (uuo *UserUpdateOne) ClearBsky() *UserUpdateOne {
|
||||
uuo.mutation.ClearBsky()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetMastodon sets the "mastodon" field.
|
||||
func (uuo *UserUpdateOne) SetMastodon(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetMastodon(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableMastodon sets the "mastodon" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableMastodon(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetMastodon(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearMastodon clears the value of the "mastodon" field.
|
||||
func (uuo *UserUpdateOne) ClearMastodon() *UserUpdateOne {
|
||||
uuo.mutation.ClearMastodon()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetDelete sets the "delete" field.
|
||||
func (uuo *UserUpdateOne) SetDelete(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetDelete(b)
|
||||
@ -1418,6 +1510,18 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
|
||||
if uuo.mutation.DidCleared() {
|
||||
_spec.ClearField(user.FieldDid, field.TypeString)
|
||||
}
|
||||
if value, ok := uuo.mutation.Bsky(); ok {
|
||||
_spec.SetField(user.FieldBsky, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.BskyCleared() {
|
||||
_spec.ClearField(user.FieldBsky, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.Mastodon(); ok {
|
||||
_spec.SetField(user.FieldMastodon, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.MastodonCleared() {
|
||||
_spec.ClearField(user.FieldMastodon, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.Delete(); ok {
|
||||
_spec.SetField(user.FieldDelete, field.TypeBool, value)
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/bin/zsh
|
||||
echo username card cp
|
||||
read
|
||||
|
||||
host=https://api.syui.ai
|
||||
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
|
||||
if [ -z "$1" ];then
|
||||
@ -18,5 +17,6 @@ read
|
||||
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
|
||||
card=$2
|
||||
cp=$3
|
||||
s="normal"
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\"}" -sL $host/cards
|
||||
s=super
|
||||
skill=normal
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\"}" -sL $host/cards
|
||||
|
@ -6,8 +6,8 @@ case $OSTYPE in
|
||||
;;
|
||||
esac
|
||||
|
||||
username=syui
|
||||
id=1
|
||||
username=ai
|
||||
id=2
|
||||
|
||||
host=https://api.syui.ai
|
||||
token=`cat ~/.config/atr/api_card.json|jq -r .token`
|
||||
@ -17,10 +17,24 @@ data=`curl -sL "$host_users"|jq .`
|
||||
nd=`date +"%Y%m%d"`
|
||||
nd=20230101
|
||||
|
||||
title=card_patch
|
||||
echo $title
|
||||
card_id=1
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"cp\":1,\"token\":\"$token\"}" $host/cards/$card_id
|
||||
#title=card_patch
|
||||
#echo $title
|
||||
#card_id=1
|
||||
#curl -X PATCH -H "Content-Type: application/json" -d "{\"cp\":1,\"token\":\"$token\"}" $host/cards/$card_id
|
||||
#read
|
||||
#
|
||||
## card pass
|
||||
echo "\ntest get card (no password)"
|
||||
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id}" $host/cards
|
||||
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
|
||||
|
||||
## 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
|
||||
|
||||
read
|
||||
|
||||
## users
|
||||
@ -35,11 +49,7 @@ read
|
||||
curl -sL "$host/cards?itemsPerPage=2550"|jq .
|
||||
read
|
||||
|
||||
## token
|
||||
echo "\ntest token (no token)"
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\"}" -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
|
||||
|
||||
|
||||
read
|
||||
## delete
|
||||
|
File diff suppressed because it is too large
Load Diff
1184
tmp/ogent/oas_response_encoders_gen.go
Normal file
1184
tmp/ogent/oas_response_encoders_gen.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -493,6 +493,13 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Bsky.Get(); ok {
|
||||
b.SetBsky(v)
|
||||
}
|
||||
if v, ok := req.Mastodon.Get(); ok {
|
||||
b.SetMastodon(v)
|
||||
}
|
||||
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
@ -629,6 +636,12 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Bsky.Get(); ok {
|
||||
b.SetBsky(v)
|
||||
}
|
||||
if v, ok := req.Mastodon.Get(); ok {
|
||||
b.SetMastodon(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
|
24
tmp/t.zsh
Normal file
24
tmp/t.zsh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/zsh
|
||||
host=https://api.syui.ai
|
||||
uid=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
|
||||
did=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .did`
|
||||
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
|
||||
card=36
|
||||
cp=`echo $(($RANDOM % 1000 + 400))`
|
||||
s=$(($RANDOM % 7))
|
||||
if [ $s -eq 1 ];then
|
||||
s=super
|
||||
skill=post
|
||||
plus=$(($RANDOM % 1000 + 300))
|
||||
cp=$((cp + plus))
|
||||
else
|
||||
s=normal
|
||||
skill=ten
|
||||
fi
|
||||
tmp=`curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$uid,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\"}" -sL $host/cards`
|
||||
|
||||
card=`echo $tmp|jq -r .card`
|
||||
cp=`echo $tmp|jq -r .cp`
|
||||
body="[card]\nid : $card\ncp : $cp"
|
||||
|
||||
atr @ $did -p "`echo $body`"
|
Loading…
x
Reference in New Issue
Block a user