|
@@ -28,6 +28,9 @@ import java.io.*;
|
|
|
@Controller
|
|
@Controller
|
|
|
public class SystemController {
|
|
public class SystemController {
|
|
|
|
|
|
|
|
|
|
+ public static final int CONFIG_TYPE_DOOR = 1;
|
|
|
|
|
+ public static final int CONFIG_TYPE_WALK = 2;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
FeedbackRepository feedbackRepository;
|
|
FeedbackRepository feedbackRepository;
|
|
|
|
|
|
|
@@ -112,7 +115,7 @@ public class SystemController {
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping(value = "/api/setApiConfig", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
|
|
@RequestMapping(value = "/api/setApiConfig", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- public String setApiConfig(@RequestHeader HttpHeaders header, boolean isApiVipOnly) {
|
|
|
|
|
|
|
+ public String setApiConfig(@RequestHeader HttpHeaders header, boolean booleanValue, int configType) {
|
|
|
ResponseResult<String> responseResult = new ResponseResult<String>();
|
|
ResponseResult<String> responseResult = new ResponseResult<String>();
|
|
|
responseResult.setMessage("设置失败");
|
|
responseResult.setMessage("设置失败");
|
|
|
if (!RequestTool.isRequestAdminValid(header, userRepository)) {
|
|
if (!RequestTool.isRequestAdminValid(header, userRepository)) {
|
|
@@ -124,7 +127,17 @@ public class SystemController {
|
|
|
if (systemBean == null) {
|
|
if (systemBean == null) {
|
|
|
systemBean = new SystemBean();
|
|
systemBean = new SystemBean();
|
|
|
}
|
|
}
|
|
|
- systemBean.isVipLimit = isApiVipOnly;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ switch (configType) {
|
|
|
|
|
+ case CONFIG_TYPE_DOOR:
|
|
|
|
|
+ systemBean.isVipLimit = booleanValue;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case CONFIG_TYPE_WALK:
|
|
|
|
|
+ systemBean.isWalking = booleanValue;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
systemRepository.save(systemBean);
|
|
systemRepository.save(systemBean);
|
|
|
|
|
|
|
|
responseResult.setCode(ResultCode.SUCCESS);
|
|
responseResult.setCode(ResultCode.SUCCESS);
|