Jelajahi Sumber

机构类型

TRX 1 tahun lalu
induk
melakukan
7e999c6ff6

+ 5 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/school/CardController.java

@@ -1,6 +1,7 @@
 package com.zhongshu.card.server.core.controller.school;
 
 import com.github.microservice.auth.security.annotations.ResourceAuth;
+import com.github.microservice.auth.security.helper.AuthHelper;
 import com.github.microservice.auth.security.type.AuthType;
 import com.zhongshu.card.client.model.base.IDParam;
 import com.zhongshu.card.client.model.org.OrgUserDetailParam;
@@ -44,6 +45,9 @@ public class CardController {
     @Autowired
     CardInfoService cardInfoService;
 
+    @Autowired
+    AuthHelper authHelper;
+
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "得到当前用户所在校园的所有卡片", description = "得到当前用户所在校园的所有卡片")
     @RequestMapping(value = {"getCurrentUserOrgAll"}, method = {RequestMethod.GET})
@@ -69,6 +73,7 @@ public class CardController {
     @Operation(summary = "用户添加-编辑卡片信息", description = "用户添加-编辑卡片信息")
     @RequestMapping(value = {"addCardInfo"}, method = {RequestMethod.POST})
     public ResultContent addCardInfo(@RequestBody CardInfoParam param) {
+        param.setUserId(authHelper.getCurrentUser().getUserId());
         return cardInfoService.addCardInfo(param);
     }
 

+ 1 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/school/CardInfoServiceImpl.java

@@ -69,7 +69,6 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
         if (StringUtils.isEmpty(param.getCode())) {
             return ResultContent.buildFail("code不能为空");
         }
-
         String oid = param.getOid();
         String code = param.getCode();
         CardInfo cardInfo = new CardInfo();
@@ -97,6 +96,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
         cardInfo.setUserId(account.getUserId());
         cardInfo.setUserName(account.getName());
         cardInfoDao.save(cardInfo);
+
         return ResultContent.buildSuccess();
     }