add member
This commit is contained in:
parent
dc01c83e9d
commit
1615c253ba
@ -28,6 +28,33 @@ func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate {
|
||||
return cu
|
||||
}
|
||||
|
||||
// SetCard sets the "card" field.
|
||||
func (cu *CardUpdate) SetCard(i int) *CardUpdate {
|
||||
cu.mutation.ResetCard()
|
||||
cu.mutation.SetCard(i)
|
||||
return cu
|
||||
}
|
||||
|
||||
// SetNillableCard sets the "card" field if the given value is not nil.
|
||||
func (cu *CardUpdate) SetNillableCard(i *int) *CardUpdate {
|
||||
if i != nil {
|
||||
cu.SetCard(*i)
|
||||
}
|
||||
return cu
|
||||
}
|
||||
|
||||
// AddCard adds i to the "card" field.
|
||||
func (cu *CardUpdate) AddCard(i int) *CardUpdate {
|
||||
cu.mutation.AddCard(i)
|
||||
return cu
|
||||
}
|
||||
|
||||
// ClearCard clears the value of the "card" field.
|
||||
func (cu *CardUpdate) ClearCard() *CardUpdate {
|
||||
cu.mutation.ClearCard()
|
||||
return cu
|
||||
}
|
||||
|
||||
// SetSkill sets the "skill" field.
|
||||
func (cu *CardUpdate) SetSkill(s string) *CardUpdate {
|
||||
cu.mutation.SetSkill(s)
|
||||
@ -184,6 +211,12 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if value, ok := cu.mutation.Card(); ok {
|
||||
_spec.SetField(card.FieldCard, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := cu.mutation.AddedCard(); ok {
|
||||
_spec.AddField(card.FieldCard, field.TypeInt, value)
|
||||
}
|
||||
if cu.mutation.CardCleared() {
|
||||
_spec.ClearField(card.FieldCard, field.TypeInt)
|
||||
}
|
||||
@ -269,6 +302,33 @@ type CardUpdateOne struct {
|
||||
mutation *CardMutation
|
||||
}
|
||||
|
||||
// SetCard sets the "card" field.
|
||||
func (cuo *CardUpdateOne) SetCard(i int) *CardUpdateOne {
|
||||
cuo.mutation.ResetCard()
|
||||
cuo.mutation.SetCard(i)
|
||||
return cuo
|
||||
}
|
||||
|
||||
// SetNillableCard sets the "card" field if the given value is not nil.
|
||||
func (cuo *CardUpdateOne) SetNillableCard(i *int) *CardUpdateOne {
|
||||
if i != nil {
|
||||
cuo.SetCard(*i)
|
||||
}
|
||||
return cuo
|
||||
}
|
||||
|
||||
// AddCard adds i to the "card" field.
|
||||
func (cuo *CardUpdateOne) AddCard(i int) *CardUpdateOne {
|
||||
cuo.mutation.AddCard(i)
|
||||
return cuo
|
||||
}
|
||||
|
||||
// ClearCard clears the value of the "card" field.
|
||||
func (cuo *CardUpdateOne) ClearCard() *CardUpdateOne {
|
||||
cuo.mutation.ClearCard()
|
||||
return cuo
|
||||
}
|
||||
|
||||
// SetSkill sets the "skill" field.
|
||||
func (cuo *CardUpdateOne) SetSkill(s string) *CardUpdateOne {
|
||||
cuo.mutation.SetSkill(s)
|
||||
@ -455,6 +515,12 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (_node *Card, err error)
|
||||
}
|
||||
}
|
||||
}
|
||||
if value, ok := cuo.mutation.Card(); ok {
|
||||
_spec.SetField(card.FieldCard, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := cuo.mutation.AddedCard(); ok {
|
||||
_spec.AddField(card.FieldCard, field.TypeInt, value)
|
||||
}
|
||||
if cuo.mutation.CardCleared() {
|
||||
_spec.ClearField(card.FieldCard, field.TypeInt)
|
||||
}
|
||||
|
@ -59,6 +59,10 @@ 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: "member", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{Name: "book", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{Name: "manga", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{Name: "badge", Type: field.TypeBool, Nullable: true, Default: false},
|
||||
{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},
|
||||
@ -83,7 +87,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: "20230710"},
|
||||
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20230720"},
|
||||
{Name: "group_users", Type: field.TypeInt, Nullable: true},
|
||||
}
|
||||
// UsersTable holds the schema information for the "users" table.
|
||||
@ -94,7 +98,7 @@ var (
|
||||
ForeignKeys: []*schema.ForeignKey{
|
||||
{
|
||||
Symbol: "users_groups_users",
|
||||
Columns: []*schema.Column{UsersColumns[28]},
|
||||
Columns: []*schema.Column{UsersColumns[32]},
|
||||
RefColumns: []*schema.Column{GroupsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
|
294
ent/mutation.go
294
ent/mutation.go
@ -1490,6 +1490,10 @@ type UserMutation struct {
|
||||
id *int
|
||||
username *string
|
||||
did *string
|
||||
member *bool
|
||||
book *bool
|
||||
manga *bool
|
||||
badge *bool
|
||||
bsky *bool
|
||||
mastodon *bool
|
||||
delete *bool
|
||||
@ -1714,6 +1718,202 @@ func (m *UserMutation) ResetDid() {
|
||||
delete(m.clearedFields, user.FieldDid)
|
||||
}
|
||||
|
||||
// SetMember sets the "member" field.
|
||||
func (m *UserMutation) SetMember(b bool) {
|
||||
m.member = &b
|
||||
}
|
||||
|
||||
// Member returns the value of the "member" field in the mutation.
|
||||
func (m *UserMutation) Member() (r bool, exists bool) {
|
||||
v := m.member
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldMember returns the old "member" 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) OldMember(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldMember is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldMember requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldMember: %w", err)
|
||||
}
|
||||
return oldValue.Member, nil
|
||||
}
|
||||
|
||||
// ClearMember clears the value of the "member" field.
|
||||
func (m *UserMutation) ClearMember() {
|
||||
m.member = nil
|
||||
m.clearedFields[user.FieldMember] = struct{}{}
|
||||
}
|
||||
|
||||
// MemberCleared returns if the "member" field was cleared in this mutation.
|
||||
func (m *UserMutation) MemberCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldMember]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetMember resets all changes to the "member" field.
|
||||
func (m *UserMutation) ResetMember() {
|
||||
m.member = nil
|
||||
delete(m.clearedFields, user.FieldMember)
|
||||
}
|
||||
|
||||
// SetBook sets the "book" field.
|
||||
func (m *UserMutation) SetBook(b bool) {
|
||||
m.book = &b
|
||||
}
|
||||
|
||||
// Book returns the value of the "book" field in the mutation.
|
||||
func (m *UserMutation) Book() (r bool, exists bool) {
|
||||
v := m.book
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBook returns the old "book" 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) OldBook(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldBook is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldBook requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBook: %w", err)
|
||||
}
|
||||
return oldValue.Book, nil
|
||||
}
|
||||
|
||||
// ClearBook clears the value of the "book" field.
|
||||
func (m *UserMutation) ClearBook() {
|
||||
m.book = nil
|
||||
m.clearedFields[user.FieldBook] = struct{}{}
|
||||
}
|
||||
|
||||
// BookCleared returns if the "book" field was cleared in this mutation.
|
||||
func (m *UserMutation) BookCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldBook]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBook resets all changes to the "book" field.
|
||||
func (m *UserMutation) ResetBook() {
|
||||
m.book = nil
|
||||
delete(m.clearedFields, user.FieldBook)
|
||||
}
|
||||
|
||||
// SetManga sets the "manga" field.
|
||||
func (m *UserMutation) SetManga(b bool) {
|
||||
m.manga = &b
|
||||
}
|
||||
|
||||
// Manga returns the value of the "manga" field in the mutation.
|
||||
func (m *UserMutation) Manga() (r bool, exists bool) {
|
||||
v := m.manga
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldManga returns the old "manga" 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) OldManga(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldManga is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldManga requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldManga: %w", err)
|
||||
}
|
||||
return oldValue.Manga, nil
|
||||
}
|
||||
|
||||
// ClearManga clears the value of the "manga" field.
|
||||
func (m *UserMutation) ClearManga() {
|
||||
m.manga = nil
|
||||
m.clearedFields[user.FieldManga] = struct{}{}
|
||||
}
|
||||
|
||||
// MangaCleared returns if the "manga" field was cleared in this mutation.
|
||||
func (m *UserMutation) MangaCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldManga]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetManga resets all changes to the "manga" field.
|
||||
func (m *UserMutation) ResetManga() {
|
||||
m.manga = nil
|
||||
delete(m.clearedFields, user.FieldManga)
|
||||
}
|
||||
|
||||
// SetBadge sets the "badge" field.
|
||||
func (m *UserMutation) SetBadge(b bool) {
|
||||
m.badge = &b
|
||||
}
|
||||
|
||||
// Badge returns the value of the "badge" field in the mutation.
|
||||
func (m *UserMutation) Badge() (r bool, exists bool) {
|
||||
v := m.badge
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBadge returns the old "badge" 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) OldBadge(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldBadge is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldBadge requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBadge: %w", err)
|
||||
}
|
||||
return oldValue.Badge, nil
|
||||
}
|
||||
|
||||
// ClearBadge clears the value of the "badge" field.
|
||||
func (m *UserMutation) ClearBadge() {
|
||||
m.badge = nil
|
||||
m.clearedFields[user.FieldBadge] = struct{}{}
|
||||
}
|
||||
|
||||
// BadgeCleared returns if the "badge" field was cleared in this mutation.
|
||||
func (m *UserMutation) BadgeCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldBadge]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBadge resets all changes to the "badge" field.
|
||||
func (m *UserMutation) ResetBadge() {
|
||||
m.badge = nil
|
||||
delete(m.clearedFields, user.FieldBadge)
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (m *UserMutation) SetBsky(b bool) {
|
||||
m.bsky = &b
|
||||
@ -3161,13 +3361,25 @@ 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, 27)
|
||||
fields := make([]string, 0, 31)
|
||||
if m.username != nil {
|
||||
fields = append(fields, user.FieldUsername)
|
||||
}
|
||||
if m.did != nil {
|
||||
fields = append(fields, user.FieldDid)
|
||||
}
|
||||
if m.member != nil {
|
||||
fields = append(fields, user.FieldMember)
|
||||
}
|
||||
if m.book != nil {
|
||||
fields = append(fields, user.FieldBook)
|
||||
}
|
||||
if m.manga != nil {
|
||||
fields = append(fields, user.FieldManga)
|
||||
}
|
||||
if m.badge != nil {
|
||||
fields = append(fields, user.FieldBadge)
|
||||
}
|
||||
if m.bsky != nil {
|
||||
fields = append(fields, user.FieldBsky)
|
||||
}
|
||||
@ -3255,6 +3467,14 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.Username()
|
||||
case user.FieldDid:
|
||||
return m.Did()
|
||||
case user.FieldMember:
|
||||
return m.Member()
|
||||
case user.FieldBook:
|
||||
return m.Book()
|
||||
case user.FieldManga:
|
||||
return m.Manga()
|
||||
case user.FieldBadge:
|
||||
return m.Badge()
|
||||
case user.FieldBsky:
|
||||
return m.Bsky()
|
||||
case user.FieldMastodon:
|
||||
@ -3318,6 +3538,14 @@ 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.FieldMember:
|
||||
return m.OldMember(ctx)
|
||||
case user.FieldBook:
|
||||
return m.OldBook(ctx)
|
||||
case user.FieldManga:
|
||||
return m.OldManga(ctx)
|
||||
case user.FieldBadge:
|
||||
return m.OldBadge(ctx)
|
||||
case user.FieldBsky:
|
||||
return m.OldBsky(ctx)
|
||||
case user.FieldMastodon:
|
||||
@ -3391,6 +3619,34 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetDid(v)
|
||||
return nil
|
||||
case user.FieldMember:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetMember(v)
|
||||
return nil
|
||||
case user.FieldBook:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBook(v)
|
||||
return nil
|
||||
case user.FieldManga:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetManga(v)
|
||||
return nil
|
||||
case user.FieldBadge:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBadge(v)
|
||||
return nil
|
||||
case user.FieldBsky:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
@ -3686,6 +3942,18 @@ func (m *UserMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(user.FieldDid) {
|
||||
fields = append(fields, user.FieldDid)
|
||||
}
|
||||
if m.FieldCleared(user.FieldMember) {
|
||||
fields = append(fields, user.FieldMember)
|
||||
}
|
||||
if m.FieldCleared(user.FieldBook) {
|
||||
fields = append(fields, user.FieldBook)
|
||||
}
|
||||
if m.FieldCleared(user.FieldManga) {
|
||||
fields = append(fields, user.FieldManga)
|
||||
}
|
||||
if m.FieldCleared(user.FieldBadge) {
|
||||
fields = append(fields, user.FieldBadge)
|
||||
}
|
||||
if m.FieldCleared(user.FieldBsky) {
|
||||
fields = append(fields, user.FieldBsky)
|
||||
}
|
||||
@ -3775,6 +4043,18 @@ func (m *UserMutation) ClearField(name string) error {
|
||||
case user.FieldDid:
|
||||
m.ClearDid()
|
||||
return nil
|
||||
case user.FieldMember:
|
||||
m.ClearMember()
|
||||
return nil
|
||||
case user.FieldBook:
|
||||
m.ClearBook()
|
||||
return nil
|
||||
case user.FieldManga:
|
||||
m.ClearManga()
|
||||
return nil
|
||||
case user.FieldBadge:
|
||||
m.ClearBadge()
|
||||
return nil
|
||||
case user.FieldBsky:
|
||||
m.ClearBsky()
|
||||
return nil
|
||||
@ -3861,6 +4141,18 @@ func (m *UserMutation) ResetField(name string) error {
|
||||
case user.FieldDid:
|
||||
m.ResetDid()
|
||||
return nil
|
||||
case user.FieldMember:
|
||||
m.ResetMember()
|
||||
return nil
|
||||
case user.FieldBook:
|
||||
m.ResetBook()
|
||||
return nil
|
||||
case user.FieldManga:
|
||||
m.ResetManga()
|
||||
return nil
|
||||
case user.FieldBadge:
|
||||
m.ResetBadge()
|
||||
return nil
|
||||
case user.FieldBsky:
|
||||
m.ResetBsky()
|
||||
return nil
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -177,6 +177,10 @@ type CardOwnerRead struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -217,6 +221,26 @@ func (s *CardOwnerRead) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *CardOwnerRead) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *CardOwnerRead) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *CardOwnerRead) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *CardOwnerRead) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *CardOwnerRead) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -347,6 +371,26 @@ func (s *CardOwnerRead) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *CardOwnerRead) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *CardOwnerRead) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *CardOwnerRead) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *CardOwnerRead) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *CardOwnerRead) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -771,6 +815,10 @@ func (s *CreateGroupReq) SetUsers(val []int) {
|
||||
type CreateUserReq struct {
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -809,6 +857,26 @@ func (s *CreateUserReq) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *CreateUserReq) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *CreateUserReq) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *CreateUserReq) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *CreateUserReq) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *CreateUserReq) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -949,6 +1017,26 @@ func (s *CreateUserReq) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *CreateUserReq) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *CreateUserReq) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *CreateUserReq) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *CreateUserReq) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *CreateUserReq) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -1215,6 +1303,10 @@ type GroupUsersList struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -1255,6 +1347,26 @@ func (s *GroupUsersList) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *GroupUsersList) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *GroupUsersList) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *GroupUsersList) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *GroupUsersList) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *GroupUsersList) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -1385,6 +1497,26 @@ func (s *GroupUsersList) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *GroupUsersList) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *GroupUsersList) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *GroupUsersList) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *GroupUsersList) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *GroupUsersList) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -1922,6 +2054,7 @@ func (*R500) updateGroupRes() {}
|
||||
func (*R500) updateUserRes() {}
|
||||
|
||||
type UpdateCardReq struct {
|
||||
Card OptInt `json:"card"`
|
||||
Skill OptString `json:"skill"`
|
||||
Status OptString `json:"status"`
|
||||
Token OptString `json:"token"`
|
||||
@ -1929,6 +2062,11 @@ type UpdateCardReq struct {
|
||||
Owner OptInt `json:"owner"`
|
||||
}
|
||||
|
||||
// GetCard returns the value of Card.
|
||||
func (s *UpdateCardReq) GetCard() OptInt {
|
||||
return s.Card
|
||||
}
|
||||
|
||||
// GetSkill returns the value of Skill.
|
||||
func (s *UpdateCardReq) GetSkill() OptString {
|
||||
return s.Skill
|
||||
@ -1954,6 +2092,11 @@ func (s *UpdateCardReq) GetOwner() OptInt {
|
||||
return s.Owner
|
||||
}
|
||||
|
||||
// SetCard sets the value of Card.
|
||||
func (s *UpdateCardReq) SetCard(val OptInt) {
|
||||
s.Card = val
|
||||
}
|
||||
|
||||
// SetSkill sets the value of Skill.
|
||||
func (s *UpdateCardReq) SetSkill(val OptString) {
|
||||
s.Skill = val
|
||||
@ -2006,6 +2149,10 @@ func (s *UpdateGroupReq) SetUsers(val []int) {
|
||||
|
||||
type UpdateUserReq struct {
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -2037,6 +2184,26 @@ func (s *UpdateUserReq) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *UpdateUserReq) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *UpdateUserReq) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *UpdateUserReq) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *UpdateUserReq) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UpdateUserReq) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -2162,6 +2329,26 @@ func (s *UpdateUserReq) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *UpdateUserReq) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *UpdateUserReq) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *UpdateUserReq) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *UpdateUserReq) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UpdateUserReq) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -2368,6 +2555,10 @@ type UserCreate struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -2408,6 +2599,26 @@ func (s *UserCreate) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *UserCreate) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *UserCreate) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *UserCreate) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *UserCreate) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserCreate) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -2538,6 +2749,26 @@ func (s *UserCreate) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *UserCreate) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *UserCreate) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *UserCreate) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *UserCreate) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserCreate) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -2660,6 +2891,10 @@ type UserList struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -2700,6 +2935,26 @@ func (s *UserList) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *UserList) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *UserList) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *UserList) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *UserList) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserList) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -2830,6 +3085,26 @@ func (s *UserList) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *UserList) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *UserList) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *UserList) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *UserList) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserList) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -2950,6 +3225,10 @@ type UserRead struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -2990,6 +3269,26 @@ func (s *UserRead) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *UserRead) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *UserRead) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *UserRead) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *UserRead) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserRead) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -3120,6 +3419,26 @@ func (s *UserRead) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *UserRead) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *UserRead) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *UserRead) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *UserRead) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserRead) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
@ -3242,6 +3561,10 @@ type UserUpdate struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Did OptString `json:"did"`
|
||||
Member OptBool `json:"member"`
|
||||
Book OptBool `json:"book"`
|
||||
Manga OptBool `json:"manga"`
|
||||
Badge OptBool `json:"badge"`
|
||||
Bsky OptBool `json:"bsky"`
|
||||
Mastodon OptBool `json:"mastodon"`
|
||||
Delete OptBool `json:"delete"`
|
||||
@ -3282,6 +3605,26 @@ func (s *UserUpdate) GetDid() OptString {
|
||||
return s.Did
|
||||
}
|
||||
|
||||
// GetMember returns the value of Member.
|
||||
func (s *UserUpdate) GetMember() OptBool {
|
||||
return s.Member
|
||||
}
|
||||
|
||||
// GetBook returns the value of Book.
|
||||
func (s *UserUpdate) GetBook() OptBool {
|
||||
return s.Book
|
||||
}
|
||||
|
||||
// GetManga returns the value of Manga.
|
||||
func (s *UserUpdate) GetManga() OptBool {
|
||||
return s.Manga
|
||||
}
|
||||
|
||||
// GetBadge returns the value of Badge.
|
||||
func (s *UserUpdate) GetBadge() OptBool {
|
||||
return s.Badge
|
||||
}
|
||||
|
||||
// GetBsky returns the value of Bsky.
|
||||
func (s *UserUpdate) GetBsky() OptBool {
|
||||
return s.Bsky
|
||||
@ -3412,6 +3755,26 @@ func (s *UserUpdate) SetDid(val OptString) {
|
||||
s.Did = val
|
||||
}
|
||||
|
||||
// SetMember sets the value of Member.
|
||||
func (s *UserUpdate) SetMember(val OptBool) {
|
||||
s.Member = val
|
||||
}
|
||||
|
||||
// SetBook sets the value of Book.
|
||||
func (s *UserUpdate) SetBook(val OptBool) {
|
||||
s.Book = val
|
||||
}
|
||||
|
||||
// SetManga sets the value of Manga.
|
||||
func (s *UserUpdate) SetManga(val OptBool) {
|
||||
s.Manga = val
|
||||
}
|
||||
|
||||
// SetBadge sets the value of Badge.
|
||||
func (s *UserUpdate) SetBadge(val OptBool) {
|
||||
s.Badge = val
|
||||
}
|
||||
|
||||
// SetBsky sets the value of Bsky.
|
||||
func (s *UserUpdate) SetBsky(val OptBool) {
|
||||
s.Bsky = val
|
||||
|
@ -140,6 +140,9 @@ func (h *OgentHandler) UpdateCard(ctx context.Context, req *UpdateCardReq, param
|
||||
if v, ok := req.Cp.Get(); ok {
|
||||
b.SetCp(v)
|
||||
}
|
||||
if v, ok := req.Card.Get(); ok {
|
||||
b.SetCard(v)
|
||||
}
|
||||
if v, ok := req.Owner.Get(); ok {
|
||||
b.SetOwnerID(v)
|
||||
}
|
||||
@ -499,7 +502,18 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
if v, ok := req.Mastodon.Get(); ok {
|
||||
b.SetMastodon(v)
|
||||
}
|
||||
|
||||
if v, ok := req.Member.Get(); ok {
|
||||
b.SetMember(v)
|
||||
}
|
||||
if v, ok := req.Book.Get(); ok {
|
||||
b.SetBook(v)
|
||||
}
|
||||
if v, ok := req.Manga.Get(); ok {
|
||||
b.SetManga(v)
|
||||
}
|
||||
if v, ok := req.Badge.Get(); ok {
|
||||
b.SetBadge(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
@ -636,6 +650,18 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Member.Get(); ok {
|
||||
b.SetMember(v)
|
||||
}
|
||||
if v, ok := req.Book.Get(); ok {
|
||||
b.SetBook(v)
|
||||
}
|
||||
if v, ok := req.Manga.Get(); ok {
|
||||
b.SetManga(v)
|
||||
}
|
||||
if v, ok := req.Badge.Get(); ok {
|
||||
b.SetBadge(v)
|
||||
}
|
||||
if v, ok := req.Bsky.Get(); ok {
|
||||
b.SetBsky(v)
|
||||
}
|
||||
|
@ -144,6 +144,10 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Member = NewOptBool(e.Member)
|
||||
ret.Book = NewOptBool(e.Book)
|
||||
ret.Manga = NewOptBool(e.Manga)
|
||||
ret.Badge = NewOptBool(e.Badge)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
@ -308,6 +312,10 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Member = NewOptBool(e.Member)
|
||||
ret.Book = NewOptBool(e.Book)
|
||||
ret.Manga = NewOptBool(e.Manga)
|
||||
ret.Badge = NewOptBool(e.Badge)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
@ -360,6 +368,10 @@ func NewUserCreate(e *ent.User) *UserCreate {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Member = NewOptBool(e.Member)
|
||||
ret.Book = NewOptBool(e.Book)
|
||||
ret.Manga = NewOptBool(e.Manga)
|
||||
ret.Badge = NewOptBool(e.Badge)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
@ -412,6 +424,10 @@ func NewUserList(e *ent.User) *UserList {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Member = NewOptBool(e.Member)
|
||||
ret.Book = NewOptBool(e.Book)
|
||||
ret.Manga = NewOptBool(e.Manga)
|
||||
ret.Badge = NewOptBool(e.Badge)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
@ -464,6 +480,10 @@ func NewUserRead(e *ent.User) *UserRead {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Member = NewOptBool(e.Member)
|
||||
ret.Book = NewOptBool(e.Book)
|
||||
ret.Manga = NewOptBool(e.Manga)
|
||||
ret.Badge = NewOptBool(e.Badge)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
@ -516,6 +536,10 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
|
||||
ret.ID = e.ID
|
||||
ret.Username = e.Username
|
||||
ret.Did = NewOptString(e.Did)
|
||||
ret.Member = NewOptBool(e.Member)
|
||||
ret.Book = NewOptBool(e.Book)
|
||||
ret.Manga = NewOptBool(e.Manga)
|
||||
ret.Badge = NewOptBool(e.Badge)
|
||||
ret.Bsky = NewOptBool(e.Bsky)
|
||||
ret.Mastodon = NewOptBool(e.Mastodon)
|
||||
ret.Delete = NewOptBool(e.Delete)
|
||||
|
111
ent/openapi.json
111
ent/openapi.json
@ -243,6 +243,9 @@
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"card": {
|
||||
"type": "integer"
|
||||
},
|
||||
"skill": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -763,6 +766,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -991,6 +1006,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1368,6 +1395,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1546,6 +1585,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1639,6 +1690,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1745,6 +1808,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1838,6 +1913,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -1931,6 +2018,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -2024,6 +2123,18 @@
|
||||
"did": {
|
||||
"type": "string"
|
||||
},
|
||||
"member": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"book": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manga": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"badge": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bsky": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
@ -70,52 +70,68 @@ func init() {
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// userDescMember is the schema descriptor for member field.
|
||||
userDescMember := userFields[2].Descriptor()
|
||||
// user.DefaultMember holds the default value on creation for the member field.
|
||||
user.DefaultMember = userDescMember.Default.(bool)
|
||||
// userDescBook is the schema descriptor for book field.
|
||||
userDescBook := userFields[3].Descriptor()
|
||||
// user.DefaultBook holds the default value on creation for the book field.
|
||||
user.DefaultBook = userDescBook.Default.(bool)
|
||||
// userDescManga is the schema descriptor for manga field.
|
||||
userDescManga := userFields[4].Descriptor()
|
||||
// user.DefaultManga holds the default value on creation for the manga field.
|
||||
user.DefaultManga = userDescManga.Default.(bool)
|
||||
// userDescBadge is the schema descriptor for badge field.
|
||||
userDescBadge := userFields[5].Descriptor()
|
||||
// user.DefaultBadge holds the default value on creation for the badge field.
|
||||
user.DefaultBadge = userDescBadge.Default.(bool)
|
||||
// userDescBsky is the schema descriptor for bsky field.
|
||||
userDescBsky := userFields[2].Descriptor()
|
||||
userDescBsky := userFields[6].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()
|
||||
userDescMastodon := userFields[7].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[4].Descriptor()
|
||||
userDescDelete := userFields[8].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[5].Descriptor()
|
||||
userDescHandle := userFields[9].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[7].Descriptor()
|
||||
userDescPassword := userFields[11].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[8].Descriptor()
|
||||
userDescCreatedAt := userFields[12].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[9].Descriptor()
|
||||
userDescUpdatedAt := userFields[13].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[10].Descriptor()
|
||||
userDescRaidAt := userFields[14].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[12].Descriptor()
|
||||
userDescLuckAt := userFields[16].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[15].Descriptor()
|
||||
userDescLikeAt := userFields[19].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[25].Descriptor()
|
||||
userDescTenAt := userFields[29].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[26].Descriptor()
|
||||
userDescNext := userFields[30].Descriptor()
|
||||
// user.DefaultNext holds the default value on creation for the next field.
|
||||
user.DefaultNext = userDescNext.Default.(string)
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ func (Card) Fields() []ent.Field {
|
||||
Sensitive(),
|
||||
|
||||
field.Int("card").
|
||||
Immutable().
|
||||
DefaultFunc(func() int {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
var a = rand.Intn(10)
|
||||
|
@ -38,6 +38,22 @@ func (User) Fields() []ent.Field {
|
||||
field.String("did").
|
||||
Optional(),
|
||||
|
||||
field.Bool("member").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
||||
field.Bool("book").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
||||
field.Bool("manga").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
||||
field.Bool("badge").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
||||
field.Bool("bsky").
|
||||
Default(false).
|
||||
Optional(),
|
||||
|
46
ent/user.go
46
ent/user.go
@ -20,6 +20,14 @@ type User struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
// Did holds the value of the "did" field.
|
||||
Did string `json:"did,omitempty"`
|
||||
// Member holds the value of the "member" field.
|
||||
Member bool `json:"member,omitempty"`
|
||||
// Book holds the value of the "book" field.
|
||||
Book bool `json:"book,omitempty"`
|
||||
// Manga holds the value of the "manga" field.
|
||||
Manga bool `json:"manga,omitempty"`
|
||||
// Badge holds the value of the "badge" field.
|
||||
Badge bool `json:"badge,omitempty"`
|
||||
// Bsky holds the value of the "bsky" field.
|
||||
Bsky bool `json:"bsky,omitempty"`
|
||||
// Mastodon holds the value of the "mastodon" field.
|
||||
@ -99,7 +107,7 @@ func (*User) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case user.FieldBsky, user.FieldMastodon, user.FieldDelete, user.FieldHandle, user.FieldTen:
|
||||
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:
|
||||
values[i] = new(sql.NullInt64)
|
||||
@ -142,6 +150,30 @@ func (u *User) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
u.Did = value.String
|
||||
}
|
||||
case user.FieldMember:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field member", values[i])
|
||||
} else if value.Valid {
|
||||
u.Member = value.Bool
|
||||
}
|
||||
case user.FieldBook:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field book", values[i])
|
||||
} else if value.Valid {
|
||||
u.Book = value.Bool
|
||||
}
|
||||
case user.FieldManga:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field manga", values[i])
|
||||
} else if value.Valid {
|
||||
u.Manga = value.Bool
|
||||
}
|
||||
case user.FieldBadge:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field badge", values[i])
|
||||
} else if value.Valid {
|
||||
u.Badge = value.Bool
|
||||
}
|
||||
case user.FieldBsky:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field bsky", values[i])
|
||||
@ -338,6 +370,18 @@ func (u *User) String() string {
|
||||
builder.WriteString("did=")
|
||||
builder.WriteString(u.Did)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("member=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Member))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("book=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Book))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("manga=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Manga))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("badge=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Badge))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("bsky=")
|
||||
builder.WriteString(fmt.Sprintf("%v", u.Bsky))
|
||||
builder.WriteString(", ")
|
||||
|
@ -15,6 +15,14 @@ const (
|
||||
FieldUsername = "username"
|
||||
// FieldDid holds the string denoting the did field in the database.
|
||||
FieldDid = "did"
|
||||
// FieldMember holds the string denoting the member field in the database.
|
||||
FieldMember = "member"
|
||||
// FieldBook holds the string denoting the book field in the database.
|
||||
FieldBook = "book"
|
||||
// FieldManga holds the string denoting the manga field in the database.
|
||||
FieldManga = "manga"
|
||||
// FieldBadge holds the string denoting the badge field in the database.
|
||||
FieldBadge = "badge"
|
||||
// FieldBsky holds the string denoting the bsky field in the database.
|
||||
FieldBsky = "bsky"
|
||||
// FieldMastodon holds the string denoting the mastodon field in the database.
|
||||
@ -83,6 +91,10 @@ var Columns = []string{
|
||||
FieldID,
|
||||
FieldUsername,
|
||||
FieldDid,
|
||||
FieldMember,
|
||||
FieldBook,
|
||||
FieldManga,
|
||||
FieldBadge,
|
||||
FieldBsky,
|
||||
FieldMastodon,
|
||||
FieldDelete,
|
||||
@ -134,6 +146,14 @@ 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
|
||||
// DefaultMember holds the default value on creation for the "member" field.
|
||||
DefaultMember bool
|
||||
// DefaultBook holds the default value on creation for the "book" field.
|
||||
DefaultBook bool
|
||||
// DefaultManga holds the default value on creation for the "manga" field.
|
||||
DefaultManga bool
|
||||
// DefaultBadge holds the default value on creation for the "badge" field.
|
||||
DefaultBadge bool
|
||||
// DefaultBsky holds the default value on creation for the "bsky" field.
|
||||
DefaultBsky bool
|
||||
// DefaultMastodon holds the default value on creation for the "mastodon" field.
|
||||
|
@ -65,6 +65,26 @@ func Did(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldDid, v))
|
||||
}
|
||||
|
||||
// Member applies equality check predicate on the "member" field. It's identical to MemberEQ.
|
||||
func Member(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldMember, v))
|
||||
}
|
||||
|
||||
// Book applies equality check predicate on the "book" field. It's identical to BookEQ.
|
||||
func Book(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBook, v))
|
||||
}
|
||||
|
||||
// Manga applies equality check predicate on the "manga" field. It's identical to MangaEQ.
|
||||
func Manga(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldManga, v))
|
||||
}
|
||||
|
||||
// Badge applies equality check predicate on the "badge" field. It's identical to BadgeEQ.
|
||||
func Badge(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBadge, 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))
|
||||
@ -330,6 +350,86 @@ func DidContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldDid, v))
|
||||
}
|
||||
|
||||
// MemberEQ applies the EQ predicate on the "member" field.
|
||||
func MemberEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldMember, v))
|
||||
}
|
||||
|
||||
// MemberNEQ applies the NEQ predicate on the "member" field.
|
||||
func MemberNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldMember, v))
|
||||
}
|
||||
|
||||
// MemberIsNil applies the IsNil predicate on the "member" field.
|
||||
func MemberIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldMember))
|
||||
}
|
||||
|
||||
// MemberNotNil applies the NotNil predicate on the "member" field.
|
||||
func MemberNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldMember))
|
||||
}
|
||||
|
||||
// BookEQ applies the EQ predicate on the "book" field.
|
||||
func BookEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBook, v))
|
||||
}
|
||||
|
||||
// BookNEQ applies the NEQ predicate on the "book" field.
|
||||
func BookNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldBook, v))
|
||||
}
|
||||
|
||||
// BookIsNil applies the IsNil predicate on the "book" field.
|
||||
func BookIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldBook))
|
||||
}
|
||||
|
||||
// BookNotNil applies the NotNil predicate on the "book" field.
|
||||
func BookNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldBook))
|
||||
}
|
||||
|
||||
// MangaEQ applies the EQ predicate on the "manga" field.
|
||||
func MangaEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldManga, v))
|
||||
}
|
||||
|
||||
// MangaNEQ applies the NEQ predicate on the "manga" field.
|
||||
func MangaNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldManga, v))
|
||||
}
|
||||
|
||||
// MangaIsNil applies the IsNil predicate on the "manga" field.
|
||||
func MangaIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldManga))
|
||||
}
|
||||
|
||||
// MangaNotNil applies the NotNil predicate on the "manga" field.
|
||||
func MangaNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldManga))
|
||||
}
|
||||
|
||||
// BadgeEQ applies the EQ predicate on the "badge" field.
|
||||
func BadgeEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBadge, v))
|
||||
}
|
||||
|
||||
// BadgeNEQ applies the NEQ predicate on the "badge" field.
|
||||
func BadgeNEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldBadge, v))
|
||||
}
|
||||
|
||||
// BadgeIsNil applies the IsNil predicate on the "badge" field.
|
||||
func BadgeIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldBadge))
|
||||
}
|
||||
|
||||
// BadgeNotNil applies the NotNil predicate on the "badge" field.
|
||||
func BadgeNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldBadge))
|
||||
}
|
||||
|
||||
// BskyEQ applies the EQ predicate on the "bsky" field.
|
||||
func BskyEQ(v bool) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldBsky, v))
|
||||
|
@ -41,6 +41,62 @@ func (uc *UserCreate) SetNillableDid(s *string) *UserCreate {
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetMember sets the "member" field.
|
||||
func (uc *UserCreate) SetMember(b bool) *UserCreate {
|
||||
uc.mutation.SetMember(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableMember sets the "member" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableMember(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetMember(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetBook sets the "book" field.
|
||||
func (uc *UserCreate) SetBook(b bool) *UserCreate {
|
||||
uc.mutation.SetBook(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableBook sets the "book" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableBook(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetBook(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetManga sets the "manga" field.
|
||||
func (uc *UserCreate) SetManga(b bool) *UserCreate {
|
||||
uc.mutation.SetManga(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableManga sets the "manga" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableManga(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetManga(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetBadge sets the "badge" field.
|
||||
func (uc *UserCreate) SetBadge(b bool) *UserCreate {
|
||||
uc.mutation.SetBadge(b)
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetNillableBadge sets the "badge" field if the given value is not nil.
|
||||
func (uc *UserCreate) SetNillableBadge(b *bool) *UserCreate {
|
||||
if b != nil {
|
||||
uc.SetBadge(*b)
|
||||
}
|
||||
return uc
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (uc *UserCreate) SetBsky(b bool) *UserCreate {
|
||||
uc.mutation.SetBsky(b)
|
||||
@ -433,6 +489,22 @@ 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.Member(); !ok {
|
||||
v := user.DefaultMember
|
||||
uc.mutation.SetMember(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Book(); !ok {
|
||||
v := user.DefaultBook
|
||||
uc.mutation.SetBook(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Manga(); !ok {
|
||||
v := user.DefaultManga
|
||||
uc.mutation.SetManga(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Badge(); !ok {
|
||||
v := user.DefaultBadge
|
||||
uc.mutation.SetBadge(v)
|
||||
}
|
||||
if _, ok := uc.mutation.Bsky(); !ok {
|
||||
v := user.DefaultBsky
|
||||
uc.mutation.SetBsky(v)
|
||||
@ -531,6 +603,22 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(user.FieldDid, field.TypeString, value)
|
||||
_node.Did = value
|
||||
}
|
||||
if value, ok := uc.mutation.Member(); ok {
|
||||
_spec.SetField(user.FieldMember, field.TypeBool, value)
|
||||
_node.Member = value
|
||||
}
|
||||
if value, ok := uc.mutation.Book(); ok {
|
||||
_spec.SetField(user.FieldBook, field.TypeBool, value)
|
||||
_node.Book = value
|
||||
}
|
||||
if value, ok := uc.mutation.Manga(); ok {
|
||||
_spec.SetField(user.FieldManga, field.TypeBool, value)
|
||||
_node.Manga = value
|
||||
}
|
||||
if value, ok := uc.mutation.Badge(); ok {
|
||||
_spec.SetField(user.FieldBadge, field.TypeBool, value)
|
||||
_node.Badge = value
|
||||
}
|
||||
if value, ok := uc.mutation.Bsky(); ok {
|
||||
_spec.SetField(user.FieldBsky, field.TypeBool, value)
|
||||
_node.Bsky = value
|
||||
|
@ -49,6 +49,86 @@ func (uu *UserUpdate) ClearDid() *UserUpdate {
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetMember sets the "member" field.
|
||||
func (uu *UserUpdate) SetMember(b bool) *UserUpdate {
|
||||
uu.mutation.SetMember(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableMember sets the "member" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableMember(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetMember(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearMember clears the value of the "member" field.
|
||||
func (uu *UserUpdate) ClearMember() *UserUpdate {
|
||||
uu.mutation.ClearMember()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetBook sets the "book" field.
|
||||
func (uu *UserUpdate) SetBook(b bool) *UserUpdate {
|
||||
uu.mutation.SetBook(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableBook sets the "book" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableBook(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetBook(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearBook clears the value of the "book" field.
|
||||
func (uu *UserUpdate) ClearBook() *UserUpdate {
|
||||
uu.mutation.ClearBook()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetManga sets the "manga" field.
|
||||
func (uu *UserUpdate) SetManga(b bool) *UserUpdate {
|
||||
uu.mutation.SetManga(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableManga sets the "manga" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableManga(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetManga(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearManga clears the value of the "manga" field.
|
||||
func (uu *UserUpdate) ClearManga() *UserUpdate {
|
||||
uu.mutation.ClearManga()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetBadge sets the "badge" field.
|
||||
func (uu *UserUpdate) SetBadge(b bool) *UserUpdate {
|
||||
uu.mutation.SetBadge(b)
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetNillableBadge sets the "badge" field if the given value is not nil.
|
||||
func (uu *UserUpdate) SetNillableBadge(b *bool) *UserUpdate {
|
||||
if b != nil {
|
||||
uu.SetBadge(*b)
|
||||
}
|
||||
return uu
|
||||
}
|
||||
|
||||
// ClearBadge clears the value of the "badge" field.
|
||||
func (uu *UserUpdate) ClearBadge() *UserUpdate {
|
||||
uu.mutation.ClearBadge()
|
||||
return uu
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (uu *UserUpdate) SetBsky(b bool) *UserUpdate {
|
||||
uu.mutation.SetBsky(b)
|
||||
@ -641,6 +721,30 @@ 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.Member(); ok {
|
||||
_spec.SetField(user.FieldMember, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.MemberCleared() {
|
||||
_spec.ClearField(user.FieldMember, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.Book(); ok {
|
||||
_spec.SetField(user.FieldBook, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.BookCleared() {
|
||||
_spec.ClearField(user.FieldBook, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.Manga(); ok {
|
||||
_spec.SetField(user.FieldManga, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.MangaCleared() {
|
||||
_spec.ClearField(user.FieldManga, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.Badge(); ok {
|
||||
_spec.SetField(user.FieldBadge, field.TypeBool, value)
|
||||
}
|
||||
if uu.mutation.BadgeCleared() {
|
||||
_spec.ClearField(user.FieldBadge, field.TypeBool)
|
||||
}
|
||||
if value, ok := uu.mutation.Bsky(); ok {
|
||||
_spec.SetField(user.FieldBsky, field.TypeBool, value)
|
||||
}
|
||||
@ -888,6 +992,86 @@ func (uuo *UserUpdateOne) ClearDid() *UserUpdateOne {
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetMember sets the "member" field.
|
||||
func (uuo *UserUpdateOne) SetMember(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetMember(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableMember sets the "member" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableMember(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetMember(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearMember clears the value of the "member" field.
|
||||
func (uuo *UserUpdateOne) ClearMember() *UserUpdateOne {
|
||||
uuo.mutation.ClearMember()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetBook sets the "book" field.
|
||||
func (uuo *UserUpdateOne) SetBook(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetBook(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableBook sets the "book" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableBook(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetBook(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearBook clears the value of the "book" field.
|
||||
func (uuo *UserUpdateOne) ClearBook() *UserUpdateOne {
|
||||
uuo.mutation.ClearBook()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetManga sets the "manga" field.
|
||||
func (uuo *UserUpdateOne) SetManga(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetManga(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableManga sets the "manga" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableManga(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetManga(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearManga clears the value of the "manga" field.
|
||||
func (uuo *UserUpdateOne) ClearManga() *UserUpdateOne {
|
||||
uuo.mutation.ClearManga()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetBadge sets the "badge" field.
|
||||
func (uuo *UserUpdateOne) SetBadge(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetBadge(b)
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetNillableBadge sets the "badge" field if the given value is not nil.
|
||||
func (uuo *UserUpdateOne) SetNillableBadge(b *bool) *UserUpdateOne {
|
||||
if b != nil {
|
||||
uuo.SetBadge(*b)
|
||||
}
|
||||
return uuo
|
||||
}
|
||||
|
||||
// ClearBadge clears the value of the "badge" field.
|
||||
func (uuo *UserUpdateOne) ClearBadge() *UserUpdateOne {
|
||||
uuo.mutation.ClearBadge()
|
||||
return uuo
|
||||
}
|
||||
|
||||
// SetBsky sets the "bsky" field.
|
||||
func (uuo *UserUpdateOne) SetBsky(b bool) *UserUpdateOne {
|
||||
uuo.mutation.SetBsky(b)
|
||||
@ -1510,6 +1694,30 @@ 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.Member(); ok {
|
||||
_spec.SetField(user.FieldMember, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.MemberCleared() {
|
||||
_spec.ClearField(user.FieldMember, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.Book(); ok {
|
||||
_spec.SetField(user.FieldBook, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.BookCleared() {
|
||||
_spec.ClearField(user.FieldBook, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.Manga(); ok {
|
||||
_spec.SetField(user.FieldManga, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.MangaCleared() {
|
||||
_spec.ClearField(user.FieldManga, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.Badge(); ok {
|
||||
_spec.SetField(user.FieldBadge, field.TypeBool, value)
|
||||
}
|
||||
if uuo.mutation.BadgeCleared() {
|
||||
_spec.ClearField(user.FieldBadge, field.TypeBool)
|
||||
}
|
||||
if value, ok := uuo.mutation.Bsky(); ok {
|
||||
_spec.SetField(user.FieldBsky, field.TypeBool, value)
|
||||
}
|
||||
|
@ -30,3 +30,7 @@ do
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
aki3
|
||||
|
||||
967
|
||||
|
@ -22,7 +22,8 @@ if [ -n "$1" ];then
|
||||
if [ "ai" = "$1" ] || [ "yui" = "$1" ];then
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"token\":\"$token\", \"luck_at\": \"$now_at\", \"luck\": 7, \"like\":0,\"aiten\":1000}" -s $host/users/$id
|
||||
else
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"next\":\"$nd\", \"updated_at\":\"$updated_at_n\", \"raid_at\":\"$raid_at_n\", \"luck_at\": \"$updated_at_n\", \"ten_at\": \"$updated_at_n\",\"token\": \"$token\"}" -s $host/users/$id
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"raid_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
|
||||
exit
|
||||
fi
|
||||
@ -35,6 +36,7 @@ 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 "{\"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
|
||||
curl -X PATCH -H "Content-Type: application/json" -d "{\"raid_at\":\"$raid_at_n\",\"token\": \"$token\", \"ten_at\": \"$updated_at_n\"}" -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
|
||||
|
@ -140,6 +140,9 @@ func (h *OgentHandler) UpdateCard(ctx context.Context, req *UpdateCardReq, param
|
||||
if v, ok := req.Cp.Get(); ok {
|
||||
b.SetCp(v)
|
||||
}
|
||||
if v, ok := req.Card.Get(); ok {
|
||||
b.SetCard(v)
|
||||
}
|
||||
if v, ok := req.Owner.Get(); ok {
|
||||
b.SetOwnerID(v)
|
||||
}
|
||||
@ -499,7 +502,18 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
|
||||
if v, ok := req.Mastodon.Get(); ok {
|
||||
b.SetMastodon(v)
|
||||
}
|
||||
|
||||
if v, ok := req.Member.Get(); ok {
|
||||
b.SetMember(v)
|
||||
}
|
||||
if v, ok := req.Book.Get(); ok {
|
||||
b.SetBook(v)
|
||||
}
|
||||
if v, ok := req.Manga.Get(); ok {
|
||||
b.SetManga(v)
|
||||
}
|
||||
if v, ok := req.Badge.Get(); ok {
|
||||
b.SetBadge(v)
|
||||
}
|
||||
if v, ok := req.Delete.Get(); ok {
|
||||
b.SetDelete(v)
|
||||
}
|
||||
@ -636,6 +650,18 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
|
||||
if v, ok := req.Did.Get(); ok {
|
||||
b.SetDid(v)
|
||||
}
|
||||
if v, ok := req.Member.Get(); ok {
|
||||
b.SetMember(v)
|
||||
}
|
||||
if v, ok := req.Book.Get(); ok {
|
||||
b.SetBook(v)
|
||||
}
|
||||
if v, ok := req.Manga.Get(); ok {
|
||||
b.SetManga(v)
|
||||
}
|
||||
if v, ok := req.Badge.Get(); ok {
|
||||
b.SetBadge(v)
|
||||
}
|
||||
if v, ok := req.Bsky.Get(); ok {
|
||||
b.SetBsky(v)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user