|
@@ -1,9 +1,11 @@
|
|
package com.citu.module.menduner.system.controller.app.common.test;
|
|
package com.citu.module.menduner.system.controller.app.common.test;
|
|
|
|
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.context.MessageSource;
|
|
import org.springframework.context.MessageSource;
|
|
|
|
+import org.springframework.security.crypto.password.PasswordEncoder;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -24,6 +26,9 @@ public class TestController {
|
|
@Resource
|
|
@Resource
|
|
MessageSource messageSource;
|
|
MessageSource messageSource;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private PasswordEncoder passwordEncoder;
|
|
|
|
+
|
|
|
|
|
|
@PostMapping("/validation")
|
|
@PostMapping("/validation")
|
|
public CommonResult<String> test(@RequestBody @Valid TestReqVO reqVO) {
|
|
public CommonResult<String> test(@RequestBody @Valid TestReqVO reqVO) {
|
|
@@ -36,4 +41,10 @@ public class TestController {
|
|
// return messageSource.getMessage("person.name", null, LocaleContextHolder.getLocale());
|
|
// return messageSource.getMessage("person.name", null, LocaleContextHolder.getLocale());
|
|
return messageSource.getMessage("1_100_001_001", null, locale);
|
|
return messageSource.getMessage("1_100_001_001", null, locale);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Operation(summary = "生成密文密码")
|
|
|
|
+ @GetMapping("/generate/password")
|
|
|
|
+ public String hello(@RequestParam("password") String password) {
|
|
|
|
+ return passwordEncoder.encode(password);
|
|
|
|
+ }
|
|
}
|
|
}
|