Package com.plannaplan.controllers
Class ConfigController
java.lang.Object
com.plannaplan.controllers.ConfigController
@RestController
@CrossOrigin
@RequestMapping("/api/v1/configurator")
@EnableGlobalMethodSecurity(prePostEnabled=true)
public class ConfigController
extends java.lang.Object
Rest controller to Config related endpoints. More detailed api docs is
available via swagger
-
Constructor Summary
Constructors Constructor Description ConfigController()
-
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<java.lang.String>
configApp(org.springframework.web.multipart.MultipartFile file, java.util.Date firstTourBegin, java.util.Date firstTourEnd, java.util.Date secondTourBegin, java.util.Date secondTourEnd)
org.springframework.http.ResponseEntity<java.lang.String>
configAppChangeCources(org.springframework.web.multipart.MultipartFile file)
org.springframework.http.ResponseEntity<java.lang.String>
configToursApp(java.util.Date firstTourBegin, java.util.Date firstTourEnd, java.util.Date secondTourBegin, java.util.Date secondTourEnd)
org.springframework.http.ResponseEntity<ConfigTourResponse>
getCurrentTourDate()
org.springframework.http.ResponseEntity<ConfigTourResponse>
getTourDate()
Deprecated.org.springframework.http.ResponseEntity<java.lang.String>
initAdmin(java.lang.String ticket)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ConfigController
public ConfigController()
-
-
Method Details
-
configApp
@PostMapping(path="/config", consumes="multipart/form-data") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<java.lang.String> configApp(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam("firstTourBegin") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date firstTourBegin, @RequestParam("firstTourEnd") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date firstTourEnd, @RequestParam("secondTourBegin") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date secondTourBegin, @RequestParam("secondTourEnd") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date secondTourEnd)- Parameters:
file
- file .xlsx that contains courses and groups with apoinnted rulesfirstTourBegin
- formated string dd.MM.yyyyfirstTourEnd
- formated string dd.MM.yyyysecondTourBegin
- formated string dd.MM.yyyysecondTourEnd
- formated string dd.MM.yyyy- Returns:
- was config success
-
configToursApp
@PostMapping(path="/config/tours") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<java.lang.String> configToursApp(@RequestParam("firstTourBegin") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date firstTourBegin, @RequestParam("firstTourEnd") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date firstTourEnd, @RequestParam("secondTourBegin") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date secondTourBegin, @RequestParam("secondTourEnd") @DateTimeFormat(pattern="dd.MM.yyyy") java.util.Date secondTourEnd)- Parameters:
firstTourBegin
- formated string dd.MM.yyyyfirstTourEnd
- formated string dd.MM.yyyysecondTourBegin
- formated string dd.MM.yyyysecondTourEnd
- formated string dd.MM.yyyy- Returns:
- was operation successful
-
configAppChangeCources
@PostMapping(path="/config/courses", consumes="multipart/form-data") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<java.lang.String> configAppChangeCources(@RequestParam("file") org.springframework.web.multipart.MultipartFile file)- Parameters:
file
- file .xlsx that contains courses and groups with- Returns:
- was operation successfull
-
initAdmin
@PostMapping(path="/admin/init") public org.springframework.http.ResponseEntity<java.lang.String> initAdmin(@RequestParam("ticket") java.lang.String ticket)- Parameters:
ticket
- CAS ticket to get user wuthority- Returns:
- was admin created
-
getCurrentTourDate
@GetMapping(path="/config/tour") public org.springframework.http.ResponseEntity<ConfigTourResponse> getCurrentTourDate()- Returns:
- api response entity
-
getTourDate
@Deprecated @GetMapping(path="/admin/tour") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<ConfigTourResponse> getTourDate()Deprecated.- Returns:
- api response entity
-