2019-07-26 13:32:43 +08:00
|
|
|
|
|
|
|
import request from '@/utils/request';
|
|
|
|
|
|
|
|
export function postDataBd(data) {
|
|
|
|
return request({
|
|
|
|
url: `/api/audio/bd?group=${data.group}&conversationId=${data.conversationId}`,
|
|
|
|
method: 'post',
|
2019-08-08 14:32:32 +08:00
|
|
|
data: data.file
|
2019-07-26 13:32:43 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 创建/获取会话id
|
|
|
|
export function getConversation(data) {
|
|
|
|
return request({
|
|
|
|
url: `/api/audio/conversation`,
|
|
|
|
method: 'get',
|
|
|
|
params: {
|
|
|
|
group: data.group,
|
|
|
|
userId: data.userId,
|
|
|
|
code: data.code
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function postDataXf(data) {
|
|
|
|
return request({
|
|
|
|
url: `/api/audio/xf`,
|
|
|
|
method: 'post',
|
|
|
|
data: data
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取语音历史记录
|
|
|
|
export function getHistoryVoice(code) {
|
|
|
|
return request({
|
|
|
|
url: `/api/audio/${code}/history`,
|
|
|
|
method: 'get'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 文字聊天 发送文字
|
|
|
|
export function chatWithText(data, group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/chatWithText?group=${group}`,
|
|
|
|
method: 'post',
|
|
|
|
data: {
|
2019-08-08 14:32:32 +08:00
|
|
|
message: data
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 文字聊天 发送文字
|
|
|
|
export function chatWithAudio(file, group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/chatWithAudio?group=${group}`,
|
|
|
|
method: 'post',
|
|
|
|
data: file
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 文字聊天 发送文字
|
|
|
|
export function getJoinTrainCode(data, group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/qrCode?group=${group}`,
|
|
|
|
method: 'post',
|
|
|
|
data: data
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 创建房间
|
|
|
|
export function postCreateRoom(data) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room`,
|
|
|
|
method: 'post',
|
|
|
|
data: data
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 检查房间存在
|
|
|
|
export function checkRoomExist(params) {
|
|
|
|
return request({
|
|
|
|
url: `/api/simulationRoom`,
|
|
|
|
method: 'get',
|
|
|
|
params
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取房间详情
|
|
|
|
export function postRoomDetail(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/${group}`,
|
2019-08-08 14:32:32 +08:00
|
|
|
method: 'get'
|
2019-07-26 13:32:43 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 销毁房间
|
|
|
|
export function deljointTrainRoom(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room`,
|
|
|
|
method: 'delete',
|
|
|
|
params: {
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询有权限房间列表
|
|
|
|
export function getjointTrainList() {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/list`,
|
|
|
|
method: 'get'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 加入房间
|
|
|
|
export function getjointTraining(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/join`,
|
|
|
|
method: 'put',
|
|
|
|
params: {
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 设置人员角色
|
|
|
|
export function putUserRoles(data, group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/user/role?group=${group}`,
|
|
|
|
method: 'put',
|
|
|
|
data: data
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 设置人员角色
|
|
|
|
export function getJointTrainRoomUserList(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/${group}/user/list`,
|
2019-08-08 14:32:32 +08:00
|
|
|
method: 'get'
|
2019-07-26 13:32:43 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 离开房间接口
|
|
|
|
export function putJointTrainingExit(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/exit`,
|
|
|
|
method: 'put',
|
|
|
|
params: {
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 开始联合演练
|
|
|
|
export function startJointTraining(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/simulation`,
|
|
|
|
method: 'post',
|
|
|
|
params: {
|
|
|
|
group: group
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取个人信息
|
|
|
|
export function getUserRoles(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/user/role`,
|
|
|
|
method: 'get',
|
|
|
|
params: {
|
|
|
|
group: group
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 返回房间
|
|
|
|
export function putJointTrainingState() {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/back`,
|
2019-08-08 14:32:32 +08:00
|
|
|
method: 'put'
|
2019-07-26 13:32:43 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 踢出用户
|
|
|
|
export function putJointTrainingUserkicked(userId, group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/user`,
|
|
|
|
method: 'put',
|
|
|
|
params: {
|
|
|
|
userId: userId,
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 管理员结束所有人的仿真
|
|
|
|
export function putJointTrainingSimulation(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/simulation/all`,
|
|
|
|
method: 'put',
|
|
|
|
params: {
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 结束仿真返回房间
|
|
|
|
export function putJointTrainingSimulationUser(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/simulation/user/exit`,
|
|
|
|
method: 'put',
|
|
|
|
params: {
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 进入仿真
|
|
|
|
export function putJointTrainingSimulationEntrance(group) {
|
|
|
|
return request({
|
|
|
|
url: `/api/jointTraining/room/simulation/user/entrance`,
|
|
|
|
method: 'put',
|
|
|
|
params: {
|
2019-08-08 14:32:32 +08:00
|
|
|
group: group
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 权限获取(房间权限)
|
|
|
|
*/
|
|
|
|
export function getPermissionJoint(group) {
|
|
|
|
return request({
|
|
|
|
url: '/api/jointTraining/qrCode',
|
|
|
|
method: 'get',
|
|
|
|
params: {
|
|
|
|
group: group
|
|
|
|
}
|
|
|
|
});
|
2019-08-08 14:32:32 +08:00
|
|
|
}
|