File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/main/java/club/dnd5/portal/controller/api/tools Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ public Collection<NameValueApi> getItems() {
3939
4040 @ PostMapping ("/api/v1/tools/madness" )
4141 public Collection <MadnessApi > getItems (@ RequestBody RequestMadnessApi request ) {
42+ if (request .getCount () > 99 ) {
43+ return Collections .emptyList ();
44+ }
4245 MadnessType madnessType ;
4346 if (request .getType () == null )
4447 {
Original file line number Diff line number Diff line change 1212import org .springframework .web .bind .annotation .RequestBody ;
1313import org .springframework .web .bind .annotation .RestController ;
1414
15- import java .util .ArrayList ;
16- import java .util .Collection ;
17- import java .util .List ;
18- import java .util .Random ;
15+ import java .util .*;
1916import java .util .stream .Collectors ;
2017
2118@ Tag (name = "Утилиты" , description = "Api для генерация дикой магии" )
@@ -33,6 +30,9 @@ public Collection<SourceApi> getItems() {
3330
3431 @ PostMapping ("/api/v1/tools/wildmagic" )
3532 public Collection <WildMagicApi > getItems (@ RequestBody RequestWildMagicApi request ) {
33+ if (request .getCount () > 99 ) {
34+ return Collections .emptyList ();
35+ }
3636 Collection <WildMagicApi > wildMagics = new ArrayList <>(request .getCount ());
3737 List <WildMagic > items = wildMagicRepository .findAllByBook (request .getSources ());
3838 for (int i = 0 ; i < request .getCount (); i ++) {
You can’t perform that action at this time.
0 commit comments