File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
src/main/java/dmu/dasom/api/global/admin/controller Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ package dmu .dasom .api .global .admin .controller ;
2+
3+ import dmu .dasom .api .global .generation .service .GenerationService ;
4+ import io .swagger .v3 .oas .annotations .Operation ;
5+ import io .swagger .v3 .oas .annotations .Parameter ;
6+ import lombok .RequiredArgsConstructor ;
7+ import org .springframework .http .ResponseEntity ;
8+ import org .springframework .web .bind .annotation .*;
9+
10+ @ RestController
11+ @ RequestMapping ("/api/admin" )
12+ @ RequiredArgsConstructor
13+ public class AdminGenerationController {
14+
15+ private final GenerationService generationService ;
16+
17+ // 기수 조회
18+ @ Operation (summary = "현재 저장된 기수 조회" )
19+ @ GetMapping ("/generation" )
20+ public ResponseEntity <String > getCurrentGeneration () {
21+ String currentGeneration = generationService .getCurrentGeneration ();
22+ return ResponseEntity .ok (currentGeneration );
23+ }
24+
25+ // 기수 수정
26+ @ Operation (summary = "기수 수정" )
27+ @ PatchMapping ("/generation" )
28+ public ResponseEntity <Void > updateGeneration (
29+ @ RequestParam @ Parameter (description = "새로운 기수 (예: '1기')" ) String generationValue
30+ ) {
31+ generationService .saveOrUpdateGeneration (generationValue );
32+ return ResponseEntity .ok ().build ();
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments