|
@@ -0,0 +1,34 @@
|
|
|
+package com.qmth.demo.api.controller;
|
|
|
+
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
+import com.qmth.boot.api.constant.ApiConstant;
|
|
|
+import com.qmth.boot.core.security.service.EncryptService;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/encrypt")
|
|
|
+@Aac(strict = false, auth = false)
|
|
|
+public class EncryptController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private EncryptService encryptService;
|
|
|
+
|
|
|
+ @RequestMapping("/encrypt")
|
|
|
+ public Object encrypt(@RequestParam String text) {
|
|
|
+ return encryptService.encrypt(text);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/decrypt")
|
|
|
+ public Object decrypt(@RequestParam String text) {
|
|
|
+ return encryptService.decrypt(text);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/hash")
|
|
|
+ public Object hash(@RequestParam String text) {
|
|
|
+ return encryptService.hash(text);
|
|
|
+ }
|
|
|
+}
|