|
|
@ -8,13 +8,16 @@ import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
import au.com.royalpay.payment.tools.env.SysConfigManager;
|
|
|
|
import au.com.royalpay.payment.tools.env.SysConfigManager;
|
|
|
|
import au.com.royalpay.payment.tools.http.HttpUtils;
|
|
|
|
import au.com.royalpay.payment.tools.http.HttpUtils;
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.EmailPasswordDecryptUtils;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Created by yixian on 2017-01-06.
|
|
|
|
* Created by yixian on 2017-01-06.
|
|
|
@ -22,6 +25,8 @@ import java.util.List;
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/sysconfig")
|
|
|
|
@RequestMapping("/sysconfig")
|
|
|
|
public class SysConfigController {
|
|
|
|
public class SysConfigController {
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private EmailPasswordDecryptUtils emailPasswordDecryptUtils;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private SysConfigManager sysConfigManager;
|
|
|
|
private SysConfigManager sysConfigManager;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
@ -30,8 +35,15 @@ public class SysConfigController {
|
|
|
|
private SysPaymentConfig sysPaymentConfig;
|
|
|
|
private SysPaymentConfig sysPaymentConfig;
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/base", method = RequestMethod.GET)
|
|
|
|
@ManagerMapping(value = "/base", method = RequestMethod.GET)
|
|
|
|
public JSONObject getBaseConfig() {
|
|
|
|
public Map<String, Object> getBaseConfig() {
|
|
|
|
return sysConfigManager.getSysConfig();
|
|
|
|
JSONObject config = sysConfigManager.getSysConfig();
|
|
|
|
|
|
|
|
return config.entrySet().stream()
|
|
|
|
|
|
|
|
.peek(entry -> {
|
|
|
|
|
|
|
|
if (emailPasswordDecryptUtils.checkPrefix(entry.getKey())) {
|
|
|
|
|
|
|
|
String decrypted = emailPasswordDecryptUtils.decoding(entry.getKey(), entry.getValue().toString());
|
|
|
|
|
|
|
|
entry.setValue(decrypted);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).collect(HashMap::new,(map,entry)->map.put(entry.getKey(),entry.getValue()), Map::putAll);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/base", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER)
|
|
|
|
@ManagerMapping(value = "/base", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER)
|
|
|
|