|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.ruoyi.common.annotation.Anonymous; | 
|---|
|  |  |  | import com.ruoyi.common.core.domain.AjaxResult; | 
|---|
|  |  |  | import com.ruoyi.rongcloud.param.RongCloudGroupDisParam; | 
|---|
|  |  |  | import com.ruoyi.rongcloud.param.RongCloudGroupParam; | 
|---|
|  |  |  | import com.ruoyi.rongcloud.param.RongCloudGroupSyncParam; | 
|---|
|  |  |  | import com.ruoyi.rongcloud.param.RongCloudGroupUserParam; | 
|---|
|  |  |  | import com.ruoyi.rongcloud.service.RongCloudService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @Description: | 
|---|
|  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @Api(tags = "融云接口") | 
|---|
|  |  |  | @Anonymous | 
|---|
|  |  |  | @RequestMapping("/rongCloud") | 
|---|
|  |  |  | public class RongCloudController { | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | RongCloudService rongCloudService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("getToken") | 
|---|
|  |  |  | @GetMapping("/getToken") | 
|---|
|  |  |  | @ApiOperation("获取token") | 
|---|
|  |  |  | public AjaxResult getToken(String userId,String name) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | String token = rongCloudService.getToken(userId, name); | 
|---|
|  |  |  | return AjaxResult.success(token); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/checkOnline") | 
|---|
|  |  |  | @ApiOperation("查询用户在线状态") | 
|---|
|  |  |  | public AjaxResult checkOnline(@RequestBody List<String> userIds) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Map map = rongCloudService.checkOnline(userIds); | 
|---|
|  |  |  | return AjaxResult.success(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupCreate") | 
|---|
|  |  |  | @ApiOperation("群组管理-创建群组") | 
|---|
|  |  |  | public AjaxResult groupCreate(@RequestBody RongCloudGroupParam group) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupCreate(group); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupDismiss") | 
|---|
|  |  |  | @ApiOperation("群组管理-解散群组") | 
|---|
|  |  |  | public AjaxResult groupDismiss(@RequestBody RongCloudGroupDisParam groupDis) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupDismiss(groupDis); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupJoin") | 
|---|
|  |  |  | @ApiOperation("群组管理-加入群组") | 
|---|
|  |  |  | public AjaxResult groupJoin(@RequestBody RongCloudGroupParam groupParam) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupJoin(groupParam); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupQuit") | 
|---|
|  |  |  | @ApiOperation("群组管理-退出群组") | 
|---|
|  |  |  | public AjaxResult groupQuit(@RequestBody RongCloudGroupParam groupParam) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupQuit(groupParam); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupUserQuery") | 
|---|
|  |  |  | @ApiOperation("群组管理-查询群组成员") | 
|---|
|  |  |  | public AjaxResult groupUserQuery(@RequestBody RongCloudGroupParam groupId) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupUserQuery(groupId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupRefresh") | 
|---|
|  |  |  | @ApiOperation("群组管理-刷新群组信息") | 
|---|
|  |  |  | public AjaxResult groupRefresh(@RequestBody RongCloudGroupParam groupParam) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupRefresh(groupParam); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/userGroupQuery") | 
|---|
|  |  |  | @ApiOperation("群组管理-查询用户所在群组") | 
|---|
|  |  |  | public AjaxResult userGroupQuery(@RequestBody RongCloudGroupUserParam userParam) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.userGroupQuery(userParam); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/groupSync") | 
|---|
|  |  |  | @ApiOperation("群组管理-同步用户所在群组") | 
|---|
|  |  |  | public AjaxResult groupSync(@RequestBody RongCloudGroupSyncParam syncParam) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupSync(syncParam); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/groupInfo") | 
|---|
|  |  |  | @ApiOperation("群组管理-查询群组详情") | 
|---|
|  |  |  | public AjaxResult groupInfo(String groupId) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupInfo(groupId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/groupUserAll") | 
|---|
|  |  |  | @ApiOperation("群组管理-查询人员选择") | 
|---|
|  |  |  | public AjaxResult groupUserAll(String groupId) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return rongCloudService.groupUserAll(groupId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|