Package co.mastermindcms.modules.rest
Class i18NextController
- java.lang.Object
-
- co.mastermindcms.modules.rest.i18NextController
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@RestController public class i18NextController extends java.lang.Object implements org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description private LanguageRepository
languageRepository
private TranslationService
translationService
-
Constructor Summary
Constructors Constructor Description i18NextController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
private org.springframework.http.ResponseEntity<?>
handleTranslationsUpload(org.springframework.web.multipart.MultipartFile file, java.lang.String payload)
org.springframework.http.ResponseEntity<?>
translationHandler(java.lang.String lang)
org.springframework.http.ResponseEntity<?>
uploadHandler(org.springframework.web.multipart.MultipartFile file, java.lang.String payload, javax.servlet.http.HttpServletResponse response)
-
-
-
Field Detail
-
translationService
@Autowired private TranslationService translationService
-
languageRepository
@Autowired private LanguageRepository languageRepository
-
-
Method Detail
-
translationHandler
@CrossOrigin(origins="*", allowCredentials="false") @GetMapping("/api/v1/locales/{lang}") @ResponseBody public org.springframework.http.ResponseEntity<?> translationHandler(@PathVariable("lang") java.lang.String lang)
-
uploadHandler
@PostMapping("/api/v1/uploadTranslations") @ResponseBody public org.springframework.http.ResponseEntity<?> uploadHandler(@RequestParam org.springframework.web.multipart.MultipartFile file, @RequestParam(value="payload",required=false) java.lang.String payload, javax.servlet.http.HttpServletResponse response)
-
handleTranslationsUpload
private org.springframework.http.ResponseEntity<?> handleTranslationsUpload(org.springframework.web.multipart.MultipartFile file, java.lang.String payload) throws java.lang.Exception
- Throws:
java.lang.Exception
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
-