This commit is contained in:
parent
11e0059631
commit
b33f6c2af7
8 changed files with 3609 additions and 7 deletions
|
@ -19,13 +19,17 @@ var (
|
|||
Q = new(Query)
|
||||
AccessToken *accessToken
|
||||
Emote *emote
|
||||
Feed *feed
|
||||
LoginProcessToken *loginProcessToken
|
||||
MediaMetadata *mediaMetadata
|
||||
Note *note
|
||||
NoteTag *noteTag
|
||||
NoteToAttachment *noteToAttachment
|
||||
NoteToBoost *noteToBoost
|
||||
NoteToEmote *noteToEmote
|
||||
NoteToFeed *noteToFeed
|
||||
NoteToPing *noteToPing
|
||||
Notification *notification
|
||||
Reaction *reaction
|
||||
RemoteServer *remoteServer
|
||||
Role *role
|
||||
|
@ -44,13 +48,17 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
|
|||
*Q = *Use(db, opts...)
|
||||
AccessToken = &Q.AccessToken
|
||||
Emote = &Q.Emote
|
||||
Feed = &Q.Feed
|
||||
LoginProcessToken = &Q.LoginProcessToken
|
||||
MediaMetadata = &Q.MediaMetadata
|
||||
Note = &Q.Note
|
||||
NoteTag = &Q.NoteTag
|
||||
NoteToAttachment = &Q.NoteToAttachment
|
||||
NoteToBoost = &Q.NoteToBoost
|
||||
NoteToEmote = &Q.NoteToEmote
|
||||
NoteToFeed = &Q.NoteToFeed
|
||||
NoteToPing = &Q.NoteToPing
|
||||
Notification = &Q.Notification
|
||||
Reaction = &Q.Reaction
|
||||
RemoteServer = &Q.RemoteServer
|
||||
Role = &Q.Role
|
||||
|
@ -70,13 +78,17 @@ func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
|
|||
db: db,
|
||||
AccessToken: newAccessToken(db, opts...),
|
||||
Emote: newEmote(db, opts...),
|
||||
Feed: newFeed(db, opts...),
|
||||
LoginProcessToken: newLoginProcessToken(db, opts...),
|
||||
MediaMetadata: newMediaMetadata(db, opts...),
|
||||
Note: newNote(db, opts...),
|
||||
NoteTag: newNoteTag(db, opts...),
|
||||
NoteToAttachment: newNoteToAttachment(db, opts...),
|
||||
NoteToBoost: newNoteToBoost(db, opts...),
|
||||
NoteToEmote: newNoteToEmote(db, opts...),
|
||||
NoteToFeed: newNoteToFeed(db, opts...),
|
||||
NoteToPing: newNoteToPing(db, opts...),
|
||||
Notification: newNotification(db, opts...),
|
||||
Reaction: newReaction(db, opts...),
|
||||
RemoteServer: newRemoteServer(db, opts...),
|
||||
Role: newRole(db, opts...),
|
||||
|
@ -97,13 +109,17 @@ type Query struct {
|
|||
|
||||
AccessToken accessToken
|
||||
Emote emote
|
||||
Feed feed
|
||||
LoginProcessToken loginProcessToken
|
||||
MediaMetadata mediaMetadata
|
||||
Note note
|
||||
NoteTag noteTag
|
||||
NoteToAttachment noteToAttachment
|
||||
NoteToBoost noteToBoost
|
||||
NoteToEmote noteToEmote
|
||||
NoteToFeed noteToFeed
|
||||
NoteToPing noteToPing
|
||||
Notification notification
|
||||
Reaction reaction
|
||||
RemoteServer remoteServer
|
||||
Role role
|
||||
|
@ -125,13 +141,17 @@ func (q *Query) clone(db *gorm.DB) *Query {
|
|||
db: db,
|
||||
AccessToken: q.AccessToken.clone(db),
|
||||
Emote: q.Emote.clone(db),
|
||||
Feed: q.Feed.clone(db),
|
||||
LoginProcessToken: q.LoginProcessToken.clone(db),
|
||||
MediaMetadata: q.MediaMetadata.clone(db),
|
||||
Note: q.Note.clone(db),
|
||||
NoteTag: q.NoteTag.clone(db),
|
||||
NoteToAttachment: q.NoteToAttachment.clone(db),
|
||||
NoteToBoost: q.NoteToBoost.clone(db),
|
||||
NoteToEmote: q.NoteToEmote.clone(db),
|
||||
NoteToFeed: q.NoteToFeed.clone(db),
|
||||
NoteToPing: q.NoteToPing.clone(db),
|
||||
Notification: q.Notification.clone(db),
|
||||
Reaction: q.Reaction.clone(db),
|
||||
RemoteServer: q.RemoteServer.clone(db),
|
||||
Role: q.Role.clone(db),
|
||||
|
@ -160,13 +180,17 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query {
|
|||
db: db,
|
||||
AccessToken: q.AccessToken.replaceDB(db),
|
||||
Emote: q.Emote.replaceDB(db),
|
||||
Feed: q.Feed.replaceDB(db),
|
||||
LoginProcessToken: q.LoginProcessToken.replaceDB(db),
|
||||
MediaMetadata: q.MediaMetadata.replaceDB(db),
|
||||
Note: q.Note.replaceDB(db),
|
||||
NoteTag: q.NoteTag.replaceDB(db),
|
||||
NoteToAttachment: q.NoteToAttachment.replaceDB(db),
|
||||
NoteToBoost: q.NoteToBoost.replaceDB(db),
|
||||
NoteToEmote: q.NoteToEmote.replaceDB(db),
|
||||
NoteToFeed: q.NoteToFeed.replaceDB(db),
|
||||
NoteToPing: q.NoteToPing.replaceDB(db),
|
||||
Notification: q.Notification.replaceDB(db),
|
||||
Reaction: q.Reaction.replaceDB(db),
|
||||
RemoteServer: q.RemoteServer.replaceDB(db),
|
||||
Role: q.Role.replaceDB(db),
|
||||
|
@ -185,13 +209,17 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query {
|
|||
type queryCtx struct {
|
||||
AccessToken IAccessTokenDo
|
||||
Emote IEmoteDo
|
||||
Feed IFeedDo
|
||||
LoginProcessToken ILoginProcessTokenDo
|
||||
MediaMetadata IMediaMetadataDo
|
||||
Note INoteDo
|
||||
NoteTag INoteTagDo
|
||||
NoteToAttachment INoteToAttachmentDo
|
||||
NoteToBoost INoteToBoostDo
|
||||
NoteToEmote INoteToEmoteDo
|
||||
NoteToFeed INoteToFeedDo
|
||||
NoteToPing INoteToPingDo
|
||||
Notification INotificationDo
|
||||
Reaction IReactionDo
|
||||
RemoteServer IRemoteServerDo
|
||||
Role IRoleDo
|
||||
|
@ -210,13 +238,17 @@ func (q *Query) WithContext(ctx context.Context) *queryCtx {
|
|||
return &queryCtx{
|
||||
AccessToken: q.AccessToken.WithContext(ctx),
|
||||
Emote: q.Emote.WithContext(ctx),
|
||||
Feed: q.Feed.WithContext(ctx),
|
||||
LoginProcessToken: q.LoginProcessToken.WithContext(ctx),
|
||||
MediaMetadata: q.MediaMetadata.WithContext(ctx),
|
||||
Note: q.Note.WithContext(ctx),
|
||||
NoteTag: q.NoteTag.WithContext(ctx),
|
||||
NoteToAttachment: q.NoteToAttachment.WithContext(ctx),
|
||||
NoteToBoost: q.NoteToBoost.WithContext(ctx),
|
||||
NoteToEmote: q.NoteToEmote.WithContext(ctx),
|
||||
NoteToFeed: q.NoteToFeed.WithContext(ctx),
|
||||
NoteToPing: q.NoteToPing.WithContext(ctx),
|
||||
Notification: q.Notification.WithContext(ctx),
|
||||
Reaction: q.Reaction.WithContext(ctx),
|
||||
RemoteServer: q.RemoteServer.WithContext(ctx),
|
||||
Role: q.Role.WithContext(ctx),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue