| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.example.jz.modle.R; |
| | | import com.example.jz.modle.entity.Announcement; |
| | | import com.example.jz.modle.entity.Group; |
| | | import com.example.jz.modle.entity.GroupUser; |
| | | import com.example.jz.modle.entity.Message; |
| | | import com.example.jz.modle.vo.GroupMessageVo; |
| | | import com.example.jz.modle.vo.GroupUserVo; |
| | | import com.example.jz.service.GroupService; |
| | |
| | | @ApiImplicitParam(name = "report", value = "群组id", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "context", value = "群组id", required = true, dataType = "String") |
| | | }) |
| | | public R<List<GroupMessageVo>> get(@RequestParam(value = "report" ,required = false) String reporter, @RequestParam(value = "context",required = false) String context,Integer groupId) { |
| | | return R.ok(groupService.getByCondition(reporter, context,groupId)); |
| | | public R<List<GroupMessageVo>> get(@RequestParam(value = "report", required = false) String reporter, @RequestParam(value = "context", required = false) String context, Integer groupId) { |
| | | return R.ok(groupService.getByCondition(reporter, context, groupId)); |
| | | } |
| | | |
| | | @PutMapping("banSpeech") |
| | | @ApiOperation(value = "禁言") |
| | | @ApiImplicitParam(name = "id", value = "群组id", required = true, dataType = "Integer") |
| | | public R setBanSpeech(@RequestParam("id") Integer id,@RequestParam("groupId")Integer groupId) { |
| | | return R.ok(groupUserService.update(new UpdateWrapper<GroupUser>().set("ban_speech",1).eq("user_id",id).eq("group_id",groupId))); |
| | | public R setBanSpeech(@RequestParam("id") Integer id, @RequestParam("groupId") Integer groupId) { |
| | | return R.ok(groupUserService.update(new UpdateWrapper<GroupUser>().set("ban_speech", 1).eq("user_id", id).eq("group_id", groupId))); |
| | | } |
| | | |
| | | @PutMapping("allowSpeech") |
| | | @ApiOperation(value = "允许发言") |
| | | @ApiImplicitParam(name = "id", value = "群组id", required = true, dataType = "Integer") |
| | | public R setAllowSpeech(@RequestParam("id") Integer id,@RequestParam("groupId")Integer groupId) { |
| | | return R.ok(groupUserService.update(new UpdateWrapper<GroupUser>().set("ban_speech",0).eq("user_id",id).eq("group_id",groupId))); |
| | | public R setAllowSpeech(@RequestParam("id") Integer id, @RequestParam("groupId") Integer groupId) { |
| | | return R.ok(groupUserService.update(new UpdateWrapper<GroupUser>().set("ban_speech", 0).eq("user_id", id).eq("group_id", groupId))); |
| | | } |
| | | |
| | | @PutMapping("banSpeechAll") |
| | | @ApiOperation(value = "全部禁言") |
| | | public R setBanSpeechAll(@RequestParam("id") Integer id) { |
| | | return R.ok(groupUserService.update(new UpdateWrapper<GroupUser>().set("ban_speech",1).eq("group_id",id))); |
| | | return R.ok(groupUserService.update(new UpdateWrapper<GroupUser>().set("ban_speech", 1).eq("group_id", id))); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(name = "id", value = "群组id", required = true, dataType = "Integer") |
| | | }) |
| | | public R<Boolean> sendMessage(@RequestParam("id") Integer id, @RequestParam("text") String text) { |
| | | if (StringUtils.isBlank(text)) { |
| | | return R.failed("文本为空"); |
| | | } |
| | | return R.ok(groupService.sendMessage(id, text)); |
| | | } |
| | | |