Ver Fonte

VIP模式重命名为休息模式

詹子聪 há 5 anos atrás
pai
commit
85fb70807d

+ 2 - 2
src/main/java/com/miekir/shibei/bean/db/SystemBean.java

@@ -20,8 +20,8 @@ public class SystemBean {
      * 是否有VIP限制,true表示必须要VIP才能使用特殊服务,false表示免费开放中...
      */
     @Basic
-    @Column(name = "isVipLimit", nullable = false, insertable = true, updatable = true)
-    public Boolean isVipLimit = false;
+    @Column(name = "isRestMode", nullable = false, insertable = true, updatable = true)
+    public Boolean isRestMode = false;
 
     /**
      * 是否开放爬虫

+ 1 - 3
src/main/java/com/miekir/shibei/controller/api/CouponController.java

@@ -11,8 +11,6 @@ import com.miekir.shibei.repository.UserRepository;
 import com.miekir.shibei.tool.RequestTool;
 import com.miekir.shibei.tool.web.FileTool;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Sort;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -47,7 +45,7 @@ public class CouponController {
 
         // 关闭通道
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (systemBean != null && systemBean.isVipLimit) {
+        if (systemBean != null && systemBean.isRestMode) {
             responseResult.setMessage("休息时间到");
             return JSON.toJSONString(responseResult);
         }

+ 1 - 1
src/main/java/com/miekir/shibei/controller/api/FavController.java

@@ -97,7 +97,7 @@ public class FavController {
 
         // 关闭通道
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (systemBean != null && systemBean.isVipLimit) {
+        if (systemBean != null && systemBean.isRestMode) {
             responseResult.setMessage("休息时间到");
             return JSON.toJSONString(responseResult);
         }

+ 4 - 4
src/main/java/com/miekir/shibei/controller/api/GoodsController.java

@@ -196,7 +196,7 @@ public class GoodsController {
 
         // 关闭通道
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (systemBean != null && systemBean.isVipLimit) {
+        if (systemBean != null && systemBean.isRestMode) {
             responseResult.setMessage("休息时间到");
             return JSON.toJSONString(responseResult);
         }
@@ -257,7 +257,7 @@ public class GoodsController {
 
         // 关闭通道
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (systemBean != null && systemBean.isVipLimit) {
+        if (systemBean != null && systemBean.isRestMode) {
             responseResult.setMessage("休息时间到");
             return JSON.toJSONString(responseResult);
         }
@@ -346,7 +346,7 @@ public class GoodsController {
 
         // 关闭通道
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (systemBean != null && systemBean.isVipLimit) {
+        if (systemBean != null && systemBean.isRestMode) {
             responseResult.setMessage("休息时间到");
             return JSON.toJSONString(responseResult);
         }
@@ -405,7 +405,7 @@ public class GoodsController {
 
         // 关闭通道
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (systemBean != null && systemBean.isVipLimit) {
+        if (systemBean != null && systemBean.isRestMode) {
             return null;
         }
 

+ 2 - 2
src/main/java/com/miekir/shibei/controller/api/JsonController.java

@@ -52,7 +52,7 @@ public class JsonController {
 
         SystemBean systemBean = systemRepository.findSystemBean();
         // 以后收费
-        if (systemBean != null && systemBean.isVipLimit && !dbUserBean.isVip()) {
+        if (systemBean != null && systemBean.isRestMode && !dbUserBean.isVip()) {
             return "请更新客户端并开通服务后重试";
         }
         WebTool.getWeatherInfo(weatherBean, cityUtf8);
@@ -78,7 +78,7 @@ public class JsonController {
 
         SystemBean systemBean = systemRepository.findSystemBean();
         // 以后收费
-        if (systemBean != null && systemBean.isVipLimit && !dbUserBean.isVip()) {
+        if (systemBean != null && systemBean.isRestMode && !dbUserBean.isVip()) {
             return "请更新客户端并开通服务后重试";
         }
 

+ 5 - 5
src/main/java/com/miekir/shibei/controller/api/SystemController.java

@@ -28,7 +28,7 @@ import java.io.*;
 @Controller
 public class SystemController {
 
-    public static final int CONFIG_TYPE_DOOR = 1;
+    public static final int CONFIG_TYPE_REST = 1;
     public static final int CONFIG_TYPE_WALK = 2;
     public static final int CONFIG_TYPE_ZFB = 3;
 
@@ -61,9 +61,9 @@ public class SystemController {
     /**
      * 设置API是否为会员专属
      */
-    @RequestMapping(value = "/api/setApiConfig", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
+    @RequestMapping(value = "/api/setSystemConfig", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
     @ResponseBody
-    public String setApiConfig(@RequestHeader HttpHeaders header, int configType, boolean booleanValue, String newZFB) {
+    public String setSystemConfig(@RequestHeader HttpHeaders header, int configType, boolean booleanValue, String newZFB) {
         ResponseResult<String> responseResult = new ResponseResult<String>();
         responseResult.setMessage("设置失败");
         if (!RequestTool.isRequestAdminValid(header, userRepository)) {
@@ -77,8 +77,8 @@ public class SystemController {
         }
 
         switch (configType) {
-            case CONFIG_TYPE_DOOR:
-                systemBean.isVipLimit = booleanValue;
+            case CONFIG_TYPE_REST:
+                systemBean.isRestMode = booleanValue;
                 break;
             case CONFIG_TYPE_WALK:
                 systemBean.isWalking = booleanValue;