詹子聪 vor 5 Jahren
Ursprung
Commit
bc5b585869

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

@@ -29,4 +29,11 @@ public class SystemBean {
     @Basic
     @Column(name = "isWalking", nullable = false, insertable = true, updatable = true)
     public Boolean isWalking = false;
+
+    /**
+     * 支付宝账号 text没有默认值
+     */
+    @Basic
+    @Column(columnDefinition = "MEDIUMTEXT", name = "zfb", nullable = false, insertable = true, updatable = true)
+    public String zfb = "https://qr.alipay.com/fkx18482hw01dsf3rauxk9b";
 }

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

@@ -30,6 +30,7 @@ public class SystemController {
 
     public static final int CONFIG_TYPE_DOOR = 1;
     public static final int CONFIG_TYPE_WALK = 2;
+    public static final int CONFIG_TYPE_ZFB = 3;
 
     @Autowired
     FeedbackRepository feedbackRepository;
@@ -115,7 +116,7 @@ public class SystemController {
      */
     @RequestMapping(value = "/api/setApiConfig", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
     @ResponseBody
-    public String setApiConfig(@RequestHeader HttpHeaders header, boolean booleanValue, int configType) {
+    public String setApiConfig(@RequestHeader HttpHeaders header, int configType, boolean booleanValue, String newZFB) {
         ResponseResult<String> responseResult = new ResponseResult<String>();
         responseResult.setMessage("设置失败");
         if (!RequestTool.isRequestAdminValid(header, userRepository)) {
@@ -135,6 +136,9 @@ public class SystemController {
             case CONFIG_TYPE_WALK:
                 systemBean.isWalking = booleanValue;
                 break;
+            case CONFIG_TYPE_ZFB:
+                systemBean.zfb = newZFB;
+                break;
             default:
                 break;
         }