1818package ru .mystamps .web .feature .series ;
1919
2020import lombok .RequiredArgsConstructor ;
21- import org .apache .commons .lang3 .StringUtils ;
2221import org .springframework .http .ResponseEntity ;
2322import org .springframework .security .core .annotation .AuthenticationPrincipal ;
2423import org .springframework .validation .annotation .Validated ;
3635import javax .validation .constraints .NotEmpty ;
3736import java .io .IOException ;
3837import java .util .List ;
39- import java .util .Locale ;
4038
4139@ Validated
4240@ RestController
@@ -77,19 +75,6 @@ public ResponseEntity<Void> updateSeries(
7775 case "/release_year" :
7876 seriesService .addReleaseYear (seriesId , patch .integerValue (), currentUserId );
7977 break ;
80- case "/michel_price" :
81- case "/scott_price" :
82- case "/yvert_price" :
83- case "/gibbons_price" :
84- case "/solovyov_price" :
85- case "/zagorski_price" :
86- seriesService .addCatalogPrice (
87- extractCatalog (path ),
88- seriesId ,
89- patch .bigDecimalValue (),
90- currentUserId
91- );
92- break ;
9378 default :
9479 // @todo #785 Update series: properly fail on invalid path
9580 break ;
@@ -116,12 +101,5 @@ public ResponseEntity<Void> modifySeriesImage(
116101 return ResponseEntity .noContent ().build ();
117102 }
118103
119- private static StampsCatalog extractCatalog (String path ) {
120- // "/catalog_something" => "catalog" => "CATALOG"
121- String catalogName = StringUtils .substringBetween (path , "/" , "_" )
122- .toUpperCase (Locale .ENGLISH );
123- return StampsCatalog .valueOf (catalogName );
124- }
125-
126104}
127105
0 commit comments