You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.6 KiB
Java
66 lines
1.6 KiB
Java
package externalsystem.cleanparking.web;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import cokr.xit.base.crypto.bean.XitAria;
|
|
import cokr.xit.foundation.web.AbstractController;
|
|
import externalsystem.cleanparking.ConfUtil;
|
|
@Controller
|
|
@RequestMapping(name="클린파킹", value="/cleanparking")
|
|
public class CpController extends AbstractController {
|
|
|
|
|
|
@RequestMapping(name="설정읽기", value="/confRead")
|
|
@ResponseBody
|
|
public String confRead(HttpServletRequest req, @RequestBody HashMap<String, Object> map) {
|
|
String returnStr = "";
|
|
|
|
|
|
String filePath = map.get("filePath").toString();
|
|
String dec = ConfUtil.read(filePath);
|
|
System.out.println(dec);
|
|
|
|
returnStr = dec;
|
|
|
|
return returnStr;
|
|
}
|
|
|
|
@RequestMapping(name="설정암호화", value="/confEnc")
|
|
@ResponseBody
|
|
public String confEnc(HttpServletRequest req, @RequestBody HashMap<String, Object> map) {
|
|
String returnStr = "";
|
|
|
|
|
|
String filePath = map.get("filePath").toString();
|
|
String dec = ConfUtil.enc(filePath);
|
|
System.out.println(dec);
|
|
|
|
returnStr = dec;
|
|
|
|
return returnStr;
|
|
}
|
|
|
|
@RequestMapping(name="문자열암호화", value="/strEnc")
|
|
@ResponseBody
|
|
public String confEnc(HttpServletRequest req) {
|
|
String returnStr = "";
|
|
|
|
XitAria xa = new XitAria("xit-aria");
|
|
|
|
String str = req.getParameter("str");
|
|
String enc = xa.encrypt(str);
|
|
|
|
returnStr = enc;
|
|
|
|
return returnStr;
|
|
}
|
|
|
|
}
|