liujunchi 2 년 전
부모
커밋
75c7e22944

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveBroadcastRoomMemberDao.java

@@ -42,5 +42,16 @@ public interface ImLiveBroadcastRoomMemberDao extends BaseMapper<ImLiveBroadcast
         "liveRoomStatus") Integer liveRoomStatus);
 
     List<ImLiveBroadcastRoomMember> queryMember(@Param("userIds") List<Long> userIds, @Param("groupId") String groupId);
+
+    /**
+     * 修改用户连麦状态
+     *
+     * @param roomUid          直播房间id
+     * @param userId           用户id
+     * @param whetherMicStatus 连麦状态
+     */
+    void userWhetherMic(@Param("roomUid") String roomUid, @Param("userId") Long userId, @Param(
+        "whetherMicStatus") Integer whetherMicStatus);
+
 }
 

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImLiveBroadcastRoomMember.java

@@ -55,12 +55,25 @@ public class ImLiveBroadcastRoomMember implements Serializable {
     @ApiModelProperty(value = "直播状态: 0离开;1观看")
     private Integer liveRoomStatus;
 
+
+    @TableField("whether_mic_status_")
+    @ApiModelProperty(value = "连麦状态 0:未申请1:申请连麦中2:连麦中")
+    private Integer whetherMicStatus;
+
     @TableField("create_time_")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
     private static final long serialVersionUID = 1L;
 
+    public Integer getWhetherMicStatus() {
+        return whetherMicStatus;
+    }
+
+    public void setWhetherMicStatus(Integer whetherMicStatus) {
+        this.whetherMicStatus = whetherMicStatus;
+    }
+
     public Integer getId() {
         return id;
     }

+ 19 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/ImLiveBroadcastRoomMemberVo.java

@@ -48,6 +48,25 @@ public class ImLiveBroadcastRoomMemberVo implements java.io.Serializable {
     @ApiModelProperty(value = "累计观看时长")
     private Integer totalViewTime;
 
+    @ApiModelProperty(value = "连麦状态 0:未申请1:申请连麦中2:连麦中")
+    private Integer whetherMicStatus;
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public Integer getWhetherMicStatus() {
+        return whetherMicStatus;
+    }
+
+    public void setWhetherMicStatus(Integer whetherMicStatus) {
+        this.whetherMicStatus = whetherMicStatus;
+    }
+
     public Integer getStudentId() {
         return studentId;
     }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveBroadcastRoomService.java

@@ -162,5 +162,14 @@ public interface ImLiveBroadcastRoomService extends IService<ImLiveBroadcastRoom
      * @param event TencentData.CallbackStreamStateEvent
      */
     void updateLiveRoomPushStreamTime(TencentData.CallbackStreamStateEvent event);
+
+    /**
+     * 修改用户连麦状态
+     *
+     * @param roomUid 直播房间id
+     * @param userId 用户id
+     * @param whetherMicStatus 连麦状态
+     */
+    void userWhetherMic(String roomUid, Long userId, Integer whetherMicStatus);
 }
 

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -2097,6 +2097,18 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
         updateById(entity);
     }
 
+    /**
+     * 修改用户连麦状态
+     *
+     * @param roomUid          直播房间id
+     * @param userId           用户id
+     * @param whetherMicStatus 连麦状态
+     */
+    @Override
+    public void userWhetherMic(String roomUid, Long userId, Integer whetherMicStatus) {
+        liveBroadcastRoomMemberDao.userWhetherMic(roomUid, userId, whetherMicStatus);
+    }
+
 
     /**
      * 查询直播间所有用户信息

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/ImLiveBroadcastRoomMemberMapper.xml

@@ -29,6 +29,7 @@
         i.room_title_ as roomTitle,
         tu.real_name_ speakerName,
         a.user_id_ as studentId,
+        a.whether_mic_status_ as whetherMicStatus,
         su.username_ as studentName,
         su.avatar_ as avatar,
         su.phone_ as phone,
@@ -56,6 +57,9 @@
         <if test="param.onlineStatus != null">
             AND a.online_status_ = #{param.onlineStatus}
         </if>
+        <if test="param.whetherMicStatus != null">
+            and a.whether_mic_status_ = #{param.whetherMicStatus}
+        </if>
         group by a.user_id_
     </select>
 
@@ -77,4 +81,10 @@
         where room_uid_ = #{groupId} and user_id_ in <foreach collection="userIds" item="userId" open="(" separator="," close=")">#{userId}</foreach>
 
     </select>
+
+    <update id="userWhetherMic">
+        update im_live_broadcast_room_member
+        set whether_mic_status_ = #{whetherMicStatus}
+        where room_uid_ = #{roomUid} and user_id_ = #{userId}
+    </update>
 </mapper>

+ 8 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ImLiveBroadcastRoomController.java

@@ -61,5 +61,13 @@ public class ImLiveBroadcastRoomController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation("设置连麦状态")
+    @PutMapping("/userWhetherMic")
+    public HttpResponseResult<Object> userWhetherMic(@ApiParam(value = "房间uid", required = true) String roomUid,
+                                                     @ApiParam(value = "用户id", required = true) Long userId,
+                                                     @ApiParam(value = "连麦状态 0:未申请1:申请连麦中2:连麦中", required = true) Integer whetherMicStatus) {
+        imLiveBroadcastRoomService.userWhetherMic(roomUid,userId,whetherMicStatus);
+        return succeed();
+    }
 }
 

+ 11 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherImLiveBroadcastRoomController.java

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -160,6 +161,16 @@ public class TeacherImLiveBroadcastRoomController extends BaseController {
         return succeed();
     }
 
+
+    @ApiOperation("设置连麦状态")
+    @PutMapping("/userWhetherMic")
+    public HttpResponseResult<Object> userWhetherMic(@ApiParam(value = "房间uid", required = true) String roomUid,
+                                                 @ApiParam(value = "用户id", required = true) Long userId,
+                                                 @ApiParam(value = "连麦状态 0:未申请1:申请连麦中2:连麦中", required = true) Integer whetherMicStatus) {
+        imLiveBroadcastRoomService.userWhetherMic(roomUid,userId,whetherMicStatus);
+        return succeed();
+    }
+
     @ApiOperation("查询直播间商品订单列表")
     @GetMapping("/queryLiveRoomGoodsOrderList")
     public HttpResponseResult<PageInfo<LiveRoomGoodsOrderVo>> queryLiveRoomGoodsOrderList(LiveRoomGoodsOrderQueryInfo queryInfo) {

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveBroadcastRoomController.java

@@ -24,6 +24,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -259,5 +260,15 @@ public class ImLiveBroadcastRoomController extends BaseController {
     public HttpResponseResult<Boolean> updateRoomStatus(@RequestBody @Valid LiveRoomStatus status ) {
         return succeed(imLiveBroadcastRoomService.updateRoomStatus(status));
     }
+
+
+    @ApiOperation("设置连麦状态")
+    @PutMapping("/userWhetherMic")
+    public HttpResponseResult<Object> userWhetherMic(@ApiParam(value = "房间uid", required = true) String roomUid,
+                                                     @ApiParam(value = "用户id", required = true) Long userId,
+                                                     @ApiParam(value = "连麦状态 0:未申请1:申请连麦中2:连麦中", required = true) Integer whetherMicStatus) {
+        imLiveBroadcastRoomService.userWhetherMic(roomUid,userId,whetherMicStatus);
+        return succeed();
+    }
 }
 

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveBroadcastRoomMemberController.java

@@ -46,7 +46,8 @@ public class ImLiveBroadcastRoomMemberController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "search", dataType = "String", value = "模糊搜索 学员编号姓名"),
             @ApiImplicitParam(name = "roomUid", dataType = "String", value = "房间uid"),
-            @ApiImplicitParam(name = "onlineStatus", dataType = "String 0:离线 1:在线  不传是全部", value = "在线状态"),
+            @ApiImplicitParam(name = "onlineStatus", dataType = "String ", value = "0:离线 1:在线  不传是全部"),
+            @ApiImplicitParam(name = "whetherMicStatus", dataType = "String", value = "连麦状态 0:未申请1:申请连麦中2:连麦中"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })