TRX vor 1 Jahr
Ursprung
Commit
7685f9ba7a

+ 14 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/config/ProjectUserConfigController.java

@@ -65,4 +65,18 @@ public class ProjectUserConfigController {
         return this.projectUserConfigService.getCurrentUserProjectConfigs();
     }
 
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "标记完成绑定卡片", description = "标记完成绑定卡片")
+    @RequestMapping(value = "isFinishBindCard", method = {RequestMethod.GET})
+    public ResultContent isFinishBindCard() {
+        return this.projectUserConfigService.isFinishBindCard();
+    }
+
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "标记完成开通无感支付", description = "标记完成开通无感支付")
+    @RequestMapping(value = "isOpenUnPay", method = {RequestMethod.GET})
+    public ResultContent isOpenUnPay() {
+        return this.projectUserConfigService.isOpenUnPay();
+    }
+
 }

+ 22 - 5
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/config/ProjectUserConfigService.java

@@ -21,6 +21,8 @@ import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
+ * 用户在项目的配置 管理服务
+ *
  * @author TRX
  * @date 2024/11/26
  */
@@ -62,11 +64,7 @@ public class ProjectUserConfigService extends SuperService {
         List<ProjectUserConfig> list = getUserProjectConfigs(userId, projectId, keys);
         Map<String, Object> tempMap = new HashMap<>();
         if (ObjectUtils.isNotEmpty(list)) {
-            tempMap = list.stream().collect(Collectors.toMap(
-                    it -> it.getKey(),
-                    it -> it.getData(),
-                    (v1, v2) -> v1
-            ));
+            tempMap = list.stream().collect(Collectors.toMap(it -> it.getKey(), it -> it.getData(), (v1, v2) -> v1));
         }
         for (String key : keys) {
             if (tempMap.containsKey(key)) {
@@ -78,6 +76,25 @@ public class ProjectUserConfigService extends SuperService {
         return map;
     }
 
+    //-------------------------------保存配置 start-----------------------
+
+    /**
+     * 标记完成绑定卡片
+     *
+     * @return
+     */
+    public ResultContent isFinishBindCard() {
+        return saveUserConfig(UserProjectTaskConfig.userBindCardKey, Boolean.TRUE);
+    }
+
+    /**
+     * 标记完成开通无感支付
+     *
+     * @return
+     */
+    public ResultContent isOpenUnPay() {
+        return saveUserConfig(UserProjectTaskConfig.userOpenUnconsciousPayment, Boolean.TRUE);
+    }
 
     public ResultContent saveUserConfig(String key, Object data) {
         ProjectUserConfigParam param = new ProjectUserConfigParam();