-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathCollectionRepo.go
777 lines (639 loc) · 32.8 KB
/
CollectionRepo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
// Code generated by mockery v2.43.0. DO NOT EDIT.
package mocks
import (
collections "github.com/bangumi/server/internal/collections"
collection "github.com/bangumi/server/internal/collections/domain/collection"
context "context"
mock "github.com/stretchr/testify/mock"
model "github.com/bangumi/server/internal/model"
query "github.com/bangumi/server/dal/query"
time "time"
)
// CollectionRepo is an autogenerated mock type for the Repo type
type CollectionRepo struct {
mock.Mock
}
type CollectionRepo_Expecter struct {
mock *mock.Mock
}
func (_m *CollectionRepo) EXPECT() *CollectionRepo_Expecter {
return &CollectionRepo_Expecter{mock: &_m.Mock}
}
// AddPersonCollection provides a mock function with given fields: ctx, userID, cat, targetID
func (_m *CollectionRepo) AddPersonCollection(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, targetID uint32) error {
ret := _m.Called(ctx, userID, cat, targetID)
if len(ret) == 0 {
panic("no return value specified for AddPersonCollection")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory, uint32) error); ok {
r0 = rf(ctx, userID, cat, targetID)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionRepo_AddPersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPersonCollection'
type CollectionRepo_AddPersonCollection_Call struct {
*mock.Call
}
// AddPersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - cat collection.PersonCollectCategory
// - targetID uint32
func (_e *CollectionRepo_Expecter) AddPersonCollection(ctx interface{}, userID interface{}, cat interface{}, targetID interface{}) *CollectionRepo_AddPersonCollection_Call {
return &CollectionRepo_AddPersonCollection_Call{Call: _e.mock.On("AddPersonCollection", ctx, userID, cat, targetID)}
}
func (_c *CollectionRepo_AddPersonCollection_Call) Run(run func(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, targetID uint32)) *CollectionRepo_AddPersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(collection.PersonCollectCategory), args[3].(uint32))
})
return _c
}
func (_c *CollectionRepo_AddPersonCollection_Call) Return(_a0 error) *CollectionRepo_AddPersonCollection_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CollectionRepo_AddPersonCollection_Call) RunAndReturn(run func(context.Context, uint32, collection.PersonCollectCategory, uint32) error) *CollectionRepo_AddPersonCollection_Call {
_c.Call.Return(run)
return _c
}
// CountPersonCollections provides a mock function with given fields: ctx, userID, cat
func (_m *CollectionRepo) CountPersonCollections(ctx context.Context, userID uint32, cat collection.PersonCollectCategory) (int64, error) {
ret := _m.Called(ctx, userID, cat)
if len(ret) == 0 {
panic("no return value specified for CountPersonCollections")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory) (int64, error)); ok {
return rf(ctx, userID, cat)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory) int64); ok {
r0 = rf(ctx, userID, cat)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, collection.PersonCollectCategory) error); ok {
r1 = rf(ctx, userID, cat)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_CountPersonCollections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountPersonCollections'
type CollectionRepo_CountPersonCollections_Call struct {
*mock.Call
}
// CountPersonCollections is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - cat collection.PersonCollectCategory
func (_e *CollectionRepo_Expecter) CountPersonCollections(ctx interface{}, userID interface{}, cat interface{}) *CollectionRepo_CountPersonCollections_Call {
return &CollectionRepo_CountPersonCollections_Call{Call: _e.mock.On("CountPersonCollections", ctx, userID, cat)}
}
func (_c *CollectionRepo_CountPersonCollections_Call) Run(run func(ctx context.Context, userID uint32, cat collection.PersonCollectCategory)) *CollectionRepo_CountPersonCollections_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(collection.PersonCollectCategory))
})
return _c
}
func (_c *CollectionRepo_CountPersonCollections_Call) Return(_a0 int64, _a1 error) *CollectionRepo_CountPersonCollections_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_CountPersonCollections_Call) RunAndReturn(run func(context.Context, uint32, collection.PersonCollectCategory) (int64, error)) *CollectionRepo_CountPersonCollections_Call {
_c.Call.Return(run)
return _c
}
// CountSubjectCollections provides a mock function with given fields: ctx, userID, subjectType, collectionType, showPrivate
func (_m *CollectionRepo) CountSubjectCollections(ctx context.Context, userID uint32, subjectType uint8, collectionType collection.SubjectCollection, showPrivate bool) (int64, error) {
ret := _m.Called(ctx, userID, subjectType, collectionType, showPrivate)
if len(ret) == 0 {
panic("no return value specified for CountSubjectCollections")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8, collection.SubjectCollection, bool) (int64, error)); ok {
return rf(ctx, userID, subjectType, collectionType, showPrivate)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8, collection.SubjectCollection, bool) int64); ok {
r0 = rf(ctx, userID, subjectType, collectionType, showPrivate)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint8, collection.SubjectCollection, bool) error); ok {
r1 = rf(ctx, userID, subjectType, collectionType, showPrivate)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_CountSubjectCollections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountSubjectCollections'
type CollectionRepo_CountSubjectCollections_Call struct {
*mock.Call
}
// CountSubjectCollections is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subjectType uint8
// - collectionType collection.SubjectCollection
// - showPrivate bool
func (_e *CollectionRepo_Expecter) CountSubjectCollections(ctx interface{}, userID interface{}, subjectType interface{}, collectionType interface{}, showPrivate interface{}) *CollectionRepo_CountSubjectCollections_Call {
return &CollectionRepo_CountSubjectCollections_Call{Call: _e.mock.On("CountSubjectCollections", ctx, userID, subjectType, collectionType, showPrivate)}
}
func (_c *CollectionRepo_CountSubjectCollections_Call) Run(run func(ctx context.Context, userID uint32, subjectType uint8, collectionType collection.SubjectCollection, showPrivate bool)) *CollectionRepo_CountSubjectCollections_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint8), args[3].(collection.SubjectCollection), args[4].(bool))
})
return _c
}
func (_c *CollectionRepo_CountSubjectCollections_Call) Return(_a0 int64, _a1 error) *CollectionRepo_CountSubjectCollections_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_CountSubjectCollections_Call) RunAndReturn(run func(context.Context, uint32, uint8, collection.SubjectCollection, bool) (int64, error)) *CollectionRepo_CountSubjectCollections_Call {
_c.Call.Return(run)
return _c
}
// GetPersonCollection provides a mock function with given fields: ctx, userID, cat, targetID
func (_m *CollectionRepo) GetPersonCollection(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, targetID uint32) (collection.UserPersonCollection, error) {
ret := _m.Called(ctx, userID, cat, targetID)
if len(ret) == 0 {
panic("no return value specified for GetPersonCollection")
}
var r0 collection.UserPersonCollection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory, uint32) (collection.UserPersonCollection, error)); ok {
return rf(ctx, userID, cat, targetID)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory, uint32) collection.UserPersonCollection); ok {
r0 = rf(ctx, userID, cat, targetID)
} else {
r0 = ret.Get(0).(collection.UserPersonCollection)
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, collection.PersonCollectCategory, uint32) error); ok {
r1 = rf(ctx, userID, cat, targetID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_GetPersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPersonCollection'
type CollectionRepo_GetPersonCollection_Call struct {
*mock.Call
}
// GetPersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - cat collection.PersonCollectCategory
// - targetID uint32
func (_e *CollectionRepo_Expecter) GetPersonCollection(ctx interface{}, userID interface{}, cat interface{}, targetID interface{}) *CollectionRepo_GetPersonCollection_Call {
return &CollectionRepo_GetPersonCollection_Call{Call: _e.mock.On("GetPersonCollection", ctx, userID, cat, targetID)}
}
func (_c *CollectionRepo_GetPersonCollection_Call) Run(run func(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, targetID uint32)) *CollectionRepo_GetPersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(collection.PersonCollectCategory), args[3].(uint32))
})
return _c
}
func (_c *CollectionRepo_GetPersonCollection_Call) Return(_a0 collection.UserPersonCollection, _a1 error) *CollectionRepo_GetPersonCollection_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_GetPersonCollection_Call) RunAndReturn(run func(context.Context, uint32, collection.PersonCollectCategory, uint32) (collection.UserPersonCollection, error)) *CollectionRepo_GetPersonCollection_Call {
_c.Call.Return(run)
return _c
}
// GetSubjectCollection provides a mock function with given fields: ctx, userID, subjectID
func (_m *CollectionRepo) GetSubjectCollection(ctx context.Context, userID uint32, subjectID uint32) (collection.UserSubjectCollection, error) {
ret := _m.Called(ctx, userID, subjectID)
if len(ret) == 0 {
panic("no return value specified for GetSubjectCollection")
}
var r0 collection.UserSubjectCollection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) (collection.UserSubjectCollection, error)); ok {
return rf(ctx, userID, subjectID)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) collection.UserSubjectCollection); ok {
r0 = rf(ctx, userID, subjectID)
} else {
r0 = ret.Get(0).(collection.UserSubjectCollection)
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint32) error); ok {
r1 = rf(ctx, userID, subjectID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_GetSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectCollection'
type CollectionRepo_GetSubjectCollection_Call struct {
*mock.Call
}
// GetSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subjectID uint32
func (_e *CollectionRepo_Expecter) GetSubjectCollection(ctx interface{}, userID interface{}, subjectID interface{}) *CollectionRepo_GetSubjectCollection_Call {
return &CollectionRepo_GetSubjectCollection_Call{Call: _e.mock.On("GetSubjectCollection", ctx, userID, subjectID)}
}
func (_c *CollectionRepo_GetSubjectCollection_Call) Run(run func(ctx context.Context, userID uint32, subjectID uint32)) *CollectionRepo_GetSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32))
})
return _c
}
func (_c *CollectionRepo_GetSubjectCollection_Call) Return(_a0 collection.UserSubjectCollection, _a1 error) *CollectionRepo_GetSubjectCollection_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_GetSubjectCollection_Call) RunAndReturn(run func(context.Context, uint32, uint32) (collection.UserSubjectCollection, error)) *CollectionRepo_GetSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// GetSubjectEpisodesCollection provides a mock function with given fields: ctx, userID, subjectID
func (_m *CollectionRepo) GetSubjectEpisodesCollection(ctx context.Context, userID uint32, subjectID uint32) (collection.UserSubjectEpisodesCollection, error) {
ret := _m.Called(ctx, userID, subjectID)
if len(ret) == 0 {
panic("no return value specified for GetSubjectEpisodesCollection")
}
var r0 collection.UserSubjectEpisodesCollection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) (collection.UserSubjectEpisodesCollection, error)); ok {
return rf(ctx, userID, subjectID)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) collection.UserSubjectEpisodesCollection); ok {
r0 = rf(ctx, userID, subjectID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(collection.UserSubjectEpisodesCollection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint32) error); ok {
r1 = rf(ctx, userID, subjectID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_GetSubjectEpisodesCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectEpisodesCollection'
type CollectionRepo_GetSubjectEpisodesCollection_Call struct {
*mock.Call
}
// GetSubjectEpisodesCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subjectID uint32
func (_e *CollectionRepo_Expecter) GetSubjectEpisodesCollection(ctx interface{}, userID interface{}, subjectID interface{}) *CollectionRepo_GetSubjectEpisodesCollection_Call {
return &CollectionRepo_GetSubjectEpisodesCollection_Call{Call: _e.mock.On("GetSubjectEpisodesCollection", ctx, userID, subjectID)}
}
func (_c *CollectionRepo_GetSubjectEpisodesCollection_Call) Run(run func(ctx context.Context, userID uint32, subjectID uint32)) *CollectionRepo_GetSubjectEpisodesCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32))
})
return _c
}
func (_c *CollectionRepo_GetSubjectEpisodesCollection_Call) Return(_a0 collection.UserSubjectEpisodesCollection, _a1 error) *CollectionRepo_GetSubjectEpisodesCollection_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_GetSubjectEpisodesCollection_Call) RunAndReturn(run func(context.Context, uint32, uint32) (collection.UserSubjectEpisodesCollection, error)) *CollectionRepo_GetSubjectEpisodesCollection_Call {
_c.Call.Return(run)
return _c
}
// ListPersonCollection provides a mock function with given fields: ctx, userID, cat, limit, offset
func (_m *CollectionRepo) ListPersonCollection(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, limit int, offset int) ([]collection.UserPersonCollection, error) {
ret := _m.Called(ctx, userID, cat, limit, offset)
if len(ret) == 0 {
panic("no return value specified for ListPersonCollection")
}
var r0 []collection.UserPersonCollection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory, int, int) ([]collection.UserPersonCollection, error)); ok {
return rf(ctx, userID, cat, limit, offset)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory, int, int) []collection.UserPersonCollection); ok {
r0 = rf(ctx, userID, cat, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]collection.UserPersonCollection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, collection.PersonCollectCategory, int, int) error); ok {
r1 = rf(ctx, userID, cat, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_ListPersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPersonCollection'
type CollectionRepo_ListPersonCollection_Call struct {
*mock.Call
}
// ListPersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - cat collection.PersonCollectCategory
// - limit int
// - offset int
func (_e *CollectionRepo_Expecter) ListPersonCollection(ctx interface{}, userID interface{}, cat interface{}, limit interface{}, offset interface{}) *CollectionRepo_ListPersonCollection_Call {
return &CollectionRepo_ListPersonCollection_Call{Call: _e.mock.On("ListPersonCollection", ctx, userID, cat, limit, offset)}
}
func (_c *CollectionRepo_ListPersonCollection_Call) Run(run func(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, limit int, offset int)) *CollectionRepo_ListPersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(collection.PersonCollectCategory), args[3].(int), args[4].(int))
})
return _c
}
func (_c *CollectionRepo_ListPersonCollection_Call) Return(_a0 []collection.UserPersonCollection, _a1 error) *CollectionRepo_ListPersonCollection_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_ListPersonCollection_Call) RunAndReturn(run func(context.Context, uint32, collection.PersonCollectCategory, int, int) ([]collection.UserPersonCollection, error)) *CollectionRepo_ListPersonCollection_Call {
_c.Call.Return(run)
return _c
}
// ListSubjectCollection provides a mock function with given fields: ctx, userID, subjectType, collectionType, showPrivate, limit, offset
func (_m *CollectionRepo) ListSubjectCollection(ctx context.Context, userID uint32, subjectType uint8, collectionType collection.SubjectCollection, showPrivate bool, limit int, offset int) ([]collection.UserSubjectCollection, error) {
ret := _m.Called(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
if len(ret) == 0 {
panic("no return value specified for ListSubjectCollection")
}
var r0 []collection.UserSubjectCollection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8, collection.SubjectCollection, bool, int, int) ([]collection.UserSubjectCollection, error)); ok {
return rf(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8, collection.SubjectCollection, bool, int, int) []collection.UserSubjectCollection); ok {
r0 = rf(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]collection.UserSubjectCollection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint8, collection.SubjectCollection, bool, int, int) error); ok {
r1 = rf(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_ListSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubjectCollection'
type CollectionRepo_ListSubjectCollection_Call struct {
*mock.Call
}
// ListSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subjectType uint8
// - collectionType collection.SubjectCollection
// - showPrivate bool
// - limit int
// - offset int
func (_e *CollectionRepo_Expecter) ListSubjectCollection(ctx interface{}, userID interface{}, subjectType interface{}, collectionType interface{}, showPrivate interface{}, limit interface{}, offset interface{}) *CollectionRepo_ListSubjectCollection_Call {
return &CollectionRepo_ListSubjectCollection_Call{Call: _e.mock.On("ListSubjectCollection", ctx, userID, subjectType, collectionType, showPrivate, limit, offset)}
}
func (_c *CollectionRepo_ListSubjectCollection_Call) Run(run func(ctx context.Context, userID uint32, subjectType uint8, collectionType collection.SubjectCollection, showPrivate bool, limit int, offset int)) *CollectionRepo_ListSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint8), args[3].(collection.SubjectCollection), args[4].(bool), args[5].(int), args[6].(int))
})
return _c
}
func (_c *CollectionRepo_ListSubjectCollection_Call) Return(_a0 []collection.UserSubjectCollection, _a1 error) *CollectionRepo_ListSubjectCollection_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_ListSubjectCollection_Call) RunAndReturn(run func(context.Context, uint32, uint8, collection.SubjectCollection, bool, int, int) ([]collection.UserSubjectCollection, error)) *CollectionRepo_ListSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// RemovePersonCollection provides a mock function with given fields: ctx, userID, cat, targetID
func (_m *CollectionRepo) RemovePersonCollection(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, targetID uint32) error {
ret := _m.Called(ctx, userID, cat, targetID)
if len(ret) == 0 {
panic("no return value specified for RemovePersonCollection")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, collection.PersonCollectCategory, uint32) error); ok {
r0 = rf(ctx, userID, cat, targetID)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionRepo_RemovePersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemovePersonCollection'
type CollectionRepo_RemovePersonCollection_Call struct {
*mock.Call
}
// RemovePersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - cat collection.PersonCollectCategory
// - targetID uint32
func (_e *CollectionRepo_Expecter) RemovePersonCollection(ctx interface{}, userID interface{}, cat interface{}, targetID interface{}) *CollectionRepo_RemovePersonCollection_Call {
return &CollectionRepo_RemovePersonCollection_Call{Call: _e.mock.On("RemovePersonCollection", ctx, userID, cat, targetID)}
}
func (_c *CollectionRepo_RemovePersonCollection_Call) Run(run func(ctx context.Context, userID uint32, cat collection.PersonCollectCategory, targetID uint32)) *CollectionRepo_RemovePersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(collection.PersonCollectCategory), args[3].(uint32))
})
return _c
}
func (_c *CollectionRepo_RemovePersonCollection_Call) Return(_a0 error) *CollectionRepo_RemovePersonCollection_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CollectionRepo_RemovePersonCollection_Call) RunAndReturn(run func(context.Context, uint32, collection.PersonCollectCategory, uint32) error) *CollectionRepo_RemovePersonCollection_Call {
_c.Call.Return(run)
return _c
}
// UpdateEpisodeCollection provides a mock function with given fields: ctx, userID, subjectID, episodeIDs, _a4, at
func (_m *CollectionRepo) UpdateEpisodeCollection(ctx context.Context, userID uint32, subjectID uint32, episodeIDs []uint32, _a4 collection.EpisodeCollection, at time.Time) (collection.UserSubjectEpisodesCollection, error) {
ret := _m.Called(ctx, userID, subjectID, episodeIDs, _a4, at)
if len(ret) == 0 {
panic("no return value specified for UpdateEpisodeCollection")
}
var r0 collection.UserSubjectEpisodesCollection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32, []uint32, collection.EpisodeCollection, time.Time) (collection.UserSubjectEpisodesCollection, error)); ok {
return rf(ctx, userID, subjectID, episodeIDs, _a4, at)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32, []uint32, collection.EpisodeCollection, time.Time) collection.UserSubjectEpisodesCollection); ok {
r0 = rf(ctx, userID, subjectID, episodeIDs, _a4, at)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(collection.UserSubjectEpisodesCollection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint32, []uint32, collection.EpisodeCollection, time.Time) error); ok {
r1 = rf(ctx, userID, subjectID, episodeIDs, _a4, at)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionRepo_UpdateEpisodeCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEpisodeCollection'
type CollectionRepo_UpdateEpisodeCollection_Call struct {
*mock.Call
}
// UpdateEpisodeCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subjectID uint32
// - episodeIDs []uint32
// - _a4 collection.EpisodeCollection
// - at time.Time
func (_e *CollectionRepo_Expecter) UpdateEpisodeCollection(ctx interface{}, userID interface{}, subjectID interface{}, episodeIDs interface{}, _a4 interface{}, at interface{}) *CollectionRepo_UpdateEpisodeCollection_Call {
return &CollectionRepo_UpdateEpisodeCollection_Call{Call: _e.mock.On("UpdateEpisodeCollection", ctx, userID, subjectID, episodeIDs, _a4, at)}
}
func (_c *CollectionRepo_UpdateEpisodeCollection_Call) Run(run func(ctx context.Context, userID uint32, subjectID uint32, episodeIDs []uint32, _a4 collection.EpisodeCollection, at time.Time)) *CollectionRepo_UpdateEpisodeCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32), args[3].([]uint32), args[4].(collection.EpisodeCollection), args[5].(time.Time))
})
return _c
}
func (_c *CollectionRepo_UpdateEpisodeCollection_Call) Return(_a0 collection.UserSubjectEpisodesCollection, _a1 error) *CollectionRepo_UpdateEpisodeCollection_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CollectionRepo_UpdateEpisodeCollection_Call) RunAndReturn(run func(context.Context, uint32, uint32, []uint32, collection.EpisodeCollection, time.Time) (collection.UserSubjectEpisodesCollection, error)) *CollectionRepo_UpdateEpisodeCollection_Call {
_c.Call.Return(run)
return _c
}
// UpdateOrCreateSubjectCollection provides a mock function with given fields: ctx, userID, subject, at, ip, update
func (_m *CollectionRepo) UpdateOrCreateSubjectCollection(ctx context.Context, userID uint32, subject model.Subject, at time.Time, ip string, update func(context.Context, *collection.Subject) (*collection.Subject, error)) error {
ret := _m.Called(ctx, userID, subject, at, ip, update)
if len(ret) == 0 {
panic("no return value specified for UpdateOrCreateSubjectCollection")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, model.Subject, time.Time, string, func(context.Context, *collection.Subject) (*collection.Subject, error)) error); ok {
r0 = rf(ctx, userID, subject, at, ip, update)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionRepo_UpdateOrCreateSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrCreateSubjectCollection'
type CollectionRepo_UpdateOrCreateSubjectCollection_Call struct {
*mock.Call
}
// UpdateOrCreateSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subject model.Subject
// - at time.Time
// - ip string
// - update func(context.Context , *collection.Subject)(*collection.Subject , error)
func (_e *CollectionRepo_Expecter) UpdateOrCreateSubjectCollection(ctx interface{}, userID interface{}, subject interface{}, at interface{}, ip interface{}, update interface{}) *CollectionRepo_UpdateOrCreateSubjectCollection_Call {
return &CollectionRepo_UpdateOrCreateSubjectCollection_Call{Call: _e.mock.On("UpdateOrCreateSubjectCollection", ctx, userID, subject, at, ip, update)}
}
func (_c *CollectionRepo_UpdateOrCreateSubjectCollection_Call) Run(run func(ctx context.Context, userID uint32, subject model.Subject, at time.Time, ip string, update func(context.Context, *collection.Subject) (*collection.Subject, error))) *CollectionRepo_UpdateOrCreateSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(model.Subject), args[3].(time.Time), args[4].(string), args[5].(func(context.Context, *collection.Subject) (*collection.Subject, error)))
})
return _c
}
func (_c *CollectionRepo_UpdateOrCreateSubjectCollection_Call) Return(_a0 error) *CollectionRepo_UpdateOrCreateSubjectCollection_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CollectionRepo_UpdateOrCreateSubjectCollection_Call) RunAndReturn(run func(context.Context, uint32, model.Subject, time.Time, string, func(context.Context, *collection.Subject) (*collection.Subject, error)) error) *CollectionRepo_UpdateOrCreateSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// UpdateSubjectCollection provides a mock function with given fields: ctx, userID, subject, at, ip, update
func (_m *CollectionRepo) UpdateSubjectCollection(ctx context.Context, userID uint32, subject model.Subject, at time.Time, ip string, update func(context.Context, *collection.Subject) (*collection.Subject, error)) error {
ret := _m.Called(ctx, userID, subject, at, ip, update)
if len(ret) == 0 {
panic("no return value specified for UpdateSubjectCollection")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, model.Subject, time.Time, string, func(context.Context, *collection.Subject) (*collection.Subject, error)) error); ok {
r0 = rf(ctx, userID, subject, at, ip, update)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionRepo_UpdateSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSubjectCollection'
type CollectionRepo_UpdateSubjectCollection_Call struct {
*mock.Call
}
// UpdateSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID uint32
// - subject model.Subject
// - at time.Time
// - ip string
// - update func(context.Context , *collection.Subject)(*collection.Subject , error)
func (_e *CollectionRepo_Expecter) UpdateSubjectCollection(ctx interface{}, userID interface{}, subject interface{}, at interface{}, ip interface{}, update interface{}) *CollectionRepo_UpdateSubjectCollection_Call {
return &CollectionRepo_UpdateSubjectCollection_Call{Call: _e.mock.On("UpdateSubjectCollection", ctx, userID, subject, at, ip, update)}
}
func (_c *CollectionRepo_UpdateSubjectCollection_Call) Run(run func(ctx context.Context, userID uint32, subject model.Subject, at time.Time, ip string, update func(context.Context, *collection.Subject) (*collection.Subject, error))) *CollectionRepo_UpdateSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(model.Subject), args[3].(time.Time), args[4].(string), args[5].(func(context.Context, *collection.Subject) (*collection.Subject, error)))
})
return _c
}
func (_c *CollectionRepo_UpdateSubjectCollection_Call) Return(_a0 error) *CollectionRepo_UpdateSubjectCollection_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CollectionRepo_UpdateSubjectCollection_Call) RunAndReturn(run func(context.Context, uint32, model.Subject, time.Time, string, func(context.Context, *collection.Subject) (*collection.Subject, error)) error) *CollectionRepo_UpdateSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// WithQuery provides a mock function with given fields: _a0
func (_m *CollectionRepo) WithQuery(_a0 *query.Query) collections.Repo {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for WithQuery")
}
var r0 collections.Repo
if rf, ok := ret.Get(0).(func(*query.Query) collections.Repo); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(collections.Repo)
}
}
return r0
}
// CollectionRepo_WithQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithQuery'
type CollectionRepo_WithQuery_Call struct {
*mock.Call
}
// WithQuery is a helper method to define mock.On call
// - _a0 *query.Query
func (_e *CollectionRepo_Expecter) WithQuery(_a0 interface{}) *CollectionRepo_WithQuery_Call {
return &CollectionRepo_WithQuery_Call{Call: _e.mock.On("WithQuery", _a0)}
}
func (_c *CollectionRepo_WithQuery_Call) Run(run func(_a0 *query.Query)) *CollectionRepo_WithQuery_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*query.Query))
})
return _c
}
func (_c *CollectionRepo_WithQuery_Call) Return(_a0 collections.Repo) *CollectionRepo_WithQuery_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CollectionRepo_WithQuery_Call) RunAndReturn(run func(*query.Query) collections.Repo) *CollectionRepo_WithQuery_Call {
_c.Call.Return(run)
return _c
}
// NewCollectionRepo creates a new instance of CollectionRepo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewCollectionRepo(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionRepo {
mock := &CollectionRepo{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}