浏览代码

绑定直播间 feign

lyhzzz 3 年之前
父节点
当前提交
d77a93d9b1

+ 0 - 1
platform-common/pom.xml

@@ -340,7 +340,6 @@
             <artifactId>ribbon-loadbalancer</artifactId>
             <version>2.2.4</version>
         </dependency>
-
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>

+ 17 - 7
platform-common/src/main/java/com/platform/controller/ZfbController.java

@@ -1,23 +1,22 @@
 package com.platform.controller;
 
 import com.platform.entity.Result;
+import com.platform.entity.SysUserBrand;
 import com.platform.service.custom.MySysUserBrandService;
 import com.platform.service.impl.ZhiHouseService;
 import com.platform.vos.TbUser;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
 
 @RestController
-@RequestMapping("/api/zfb")
+@RequestMapping("/zfb")
 public class ZfbController {
 
     @Autowired
@@ -27,8 +26,9 @@ public class ZfbController {
     private ZhiHouseService zhiHouseService;
 
     @PostMapping("/preDeleteStaff")
-    @RequiresPermissions("sys:user:delete")
-    public Result preDeleteStaff(@RequestParam Long userId,@RequestParam Long deptId) {
+    public Result preDeleteStaff(@RequestBody HashMap<String,Long> param) {
+        Long userId = param.get("userId");
+        Long deptId = param.get("deptId");
         // 获取直播间绑定信息
         List<Long> bindUsers = mySysUserBrandService.queryBrandIdList(userId);
         if (!ObjectUtils.isEmpty(bindUsers)) {
@@ -43,6 +43,16 @@ public class ZfbController {
         }
         return Result.success();
     }
+    @PostMapping("/getCanShow")
+    public Result getCanShow(@RequestBody HashMap<String,Long> param) {
+        Long userId = param.get("userId");
+        Integer brandId = Math.toIntExact(param.get("brandId"));
+        SysUserBrand userBrandById = mySysUserBrandService.getUserBrandById(userId, brandId);
+        if(userBrandById == null){
+            return Result.failure("暂无数据");
+        }
+        return Result.success(userBrandById.getCanShow());
+    }
 
 
 

+ 1 - 1
platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java

@@ -359,7 +359,7 @@ public class BrandServiceImpl implements BrandService {
 
         return brandEntity;
     }
-
+//{brandId: 1, canShow: 0, type: -1, userId: "1"}
     public void bindUsers(List<BrandBindUserVo> brandBindUserVoList) {
         brandBindUserVoList.parallelStream().filter(vo -> !ObjectUtils.isEmpty(vo.getType())).forEach(vo -> {
                     //绑定或者修改带看权限