فهرست منبع

新增广告模式

詹子聪 5 سال پیش
والد
کامیت
f83a983800

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

@@ -17,7 +17,7 @@ public class SystemBean {
     public Integer id;
 
     /**
-     * 是否有VIP限制,true表示必须要VIP才能使用特殊服务,false表示免费开放中...
+     * 是否限制数据访问
      */
     @Basic
     @Column(name = "isRestMode", nullable = false, insertable = true, updatable = true)
@@ -36,4 +36,11 @@ public class SystemBean {
     @Basic
     @Column(columnDefinition = "MEDIUMTEXT", name = "zfb", nullable = false, insertable = true, updatable = true)
     public String zfb = "https://qr.alipay.com/fkx18482hw01dsf3rauxk9b";
+
+    /**
+     * 是否启用广告模式
+     */
+    @Basic
+    @Column(name = "isAdMode", nullable = false, insertable = true, updatable = true)
+    public Boolean isAdMode = false;
 }

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

@@ -31,6 +31,7 @@ public class SystemController {
     public static final int CONFIG_TYPE_REST = 1;
     public static final int CONFIG_TYPE_WALK = 2;
     public static final int CONFIG_TYPE_ZFB = 3;
+    public static final int CONFIG_TYPE_AD = 4;
 
     @Autowired
     FeedbackRepository feedbackRepository;
@@ -86,6 +87,9 @@ public class SystemController {
             case CONFIG_TYPE_ZFB:
                 systemBean.zfb = newZFB;
                 break;
+            case CONFIG_TYPE_AD:
+                systemBean.isAdMode = booleanValue;
+                break;
             default:
                 break;
         }