Compare commits
	
		
			3 Commits
		
	
	
		
			7dff7ac4e0
			...
			3d1c1d7538
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 3d1c1d7538 | |
|  | 645d38f7ce | |
|  | 29157b2530 | 
|  | @ -7,6 +7,8 @@ import ( | |||
| 	"go.mongodb.org/mongo-driver/mongo/options" | ||||
| ) | ||||
| 
 | ||||
| const maxLimit = 500 | ||||
| 
 | ||||
| // CommonQuery ...
 | ||||
| type CommonQuery struct { | ||||
| 	Page    int64 | ||||
|  | @ -78,9 +80,12 @@ func (q *CommonQuery) GetFindOptionsUsingPage() *options.FindOptions { | |||
| 
 | ||||
| // SetDefaultLimit ...
 | ||||
| func (q *CommonQuery) SetDefaultLimit() { | ||||
| 	if q.Limit <= 0 || q.Limit > 20 { | ||||
| 	if q.Limit <= 0 { | ||||
| 		q.Limit = 20 | ||||
| 	} | ||||
| 	if q.Limit > maxLimit { | ||||
| 		q.Limit = 500 | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // AssignOther ...
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue