hgw 3 лет назад
Родитель
Сommit
eafff2e9a4

+ 1 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveRoomBlackDao.java

@@ -3,7 +3,6 @@ package com.ym.mec.biz.dal.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
 import org.apache.ibatis.annotations.Param;
 
@@ -20,7 +19,7 @@ public interface ImLiveRoomBlackDao extends BaseMapper<ImLiveRoomBlack> {
 
     int insertBatch(@Param("entities") List<ImLiveRoomBlack> entities);
 
-    List<SysUser> queryStudent(@Param("tenantId") Integer tenantId, @Param("search") String search, @Param("roomUid") String roomUid);
+    <T> IPage<T> queryStudent(Page<T> page, @Param("param") Map<String, Object> param);
 
     <T> IPage<T> queryBlackList(Page<T> page, @Param("param") Map<String, Object> param);
 

+ 4 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveRoomBlackService.java

@@ -6,7 +6,6 @@ import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
 import com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo;
 import com.ym.mec.common.page.PageInfo;
 
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -20,9 +19,11 @@ public interface ImLiveRoomBlackService extends IService<ImLiveRoomBlack> {
     /**
      * 查询当前机构学生 -下拉框
      *
-     * @param search 搜索关键字不能为空
+     * @param param 参数
+     *              <p> search - 搜索关键字
+     *              <p> roomUid - 房间uid
      */
-    List<SysUser> queryStudentList(String roomUid, String search);
+    PageInfo<SysUser> queryStudentList(Map<String, Object> param);
 
     /**
      * 添加用户到房间黑名单中

+ 9 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveRoomBlackServiceImpl.java

@@ -45,17 +45,21 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
     /**
      * 查询当前机构学生 -下拉框
      *
-     * @param search 搜索关键字不能为空
+     * @param param 参数
+     *              <p> search - 搜索关键字
+     *              <p> roomUid - 房间uid
      */
     @Override
-    public List<SysUser> queryStudentList(String roomUid, String search) {
-        Optional.ofNullable(search).orElseThrow(() -> new BizException("search is null"));
+    public PageInfo<SysUser> queryStudentList(Map<String, Object> param) {
+        WrapperUtil.toStr(param, "search", "搜索关键字不能为空");
+        Page<SysUser> pageInfo = PageUtil.getPageInfo(param);
+        pageInfo.setDesc("a.id_");
         Integer tenantId = TenantContextHolder.getTenantId();
         //管理员机构id 是-1
         if (Objects.nonNull(tenantId) && tenantId == -1) {
-            tenantId = null;
+            param.put("tenantId", tenantId);
         }
-        return baseMapper.queryStudent(tenantId, search, roomUid);
+        return PageUtil.pageInfo(baseMapper.queryStudent(pageInfo, param));
     }
 
     /**
@@ -122,7 +126,6 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
         WrapperUtil.toStr(param, "roomUid", "房间编号不能为空");
         Page<ImLiveRoomBlackVo> pageInfo = PageUtil.getPageInfo(param);
         pageInfo.setDesc("a.create_time_");
-        param.put("tenantId", TenantContextHolder.getTenantId());
         IPage<ImLiveRoomBlackVo> imLiveRoomBlackVoIPage = baseMapper.queryBlackList(pageInfo, param);
         return PageUtil.pageInfo(imLiveRoomBlackVoIPage);
     }

+ 14 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveRoomBlackController.java

@@ -2,20 +2,20 @@ package com.ym.mec.web.controller;
 
 
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
-import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo;
 import com.ym.mec.biz.service.ImLiveRoomBlackService;
+import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.*;
-import com.ym.mec.common.controller.BaseController;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -35,12 +35,14 @@ public class ImLiveRoomBlackController extends BaseController {
 
     @ApiImplicitParams({
             @ApiImplicitParam(name = "roomUid", dataType = "String", value = "直播房间uid"),
-            @ApiImplicitParam(name = "search", dataType = "String", value = "搜索关键字-用户id,用户名,手机号"),
+            @ApiImplicitParam(name = "search", dataType = "String", value = "搜索关键字-用户id,用户名,手机号", required = true),
+            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
+            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })
-    @ApiOperation("分页查询直播间列表")
-    @GetMapping("/queryStudentList")
-    public HttpResponseResult<List<SysUser>> queryStudentList(String roomUid, String search) {
-        return succeed(imLiveRoomBlackService.queryStudentList(roomUid, search));
+    @ApiOperation("查询当前机构学生 -下拉框")
+    @PostMapping("/queryStudentList")
+    public HttpResponseResult<PageInfo<SysUser>> queryStudentList(@RequestBody Map<String, Object> param) {
+        return succeed(imLiveRoomBlackService.queryStudentList(param));
     }
 
     @ApiImplicitParams({
@@ -49,7 +51,7 @@ public class ImLiveRoomBlackController extends BaseController {
     })
     @ApiOperation("添加用户到房间黑名单中")
     @PostMapping("/add")
-    public HttpResponseResult<Object> add(Map<String, Object> param){
+    public HttpResponseResult<Object> add(@RequestBody Map<String, Object> param) {
         imLiveRoomBlackService.add(param);
         return succeed();
     }
@@ -60,7 +62,7 @@ public class ImLiveRoomBlackController extends BaseController {
     })
     @ApiOperation("删除该用户从房间黑名单中移除")
     @PostMapping("/delete")
-    public HttpResponseResult<Object> delete(Map<String, Object> param){
+    public HttpResponseResult<Object> delete(@RequestBody Map<String, Object> param) {
         imLiveRoomBlackService.delete(param);
         return succeed();
     }