优化通过uid查询视频会议信息接口
This commit is contained in:
+40
-12
@@ -4,15 +4,23 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.domain.entity.shortmessage.MeetingInfo;
|
||||
import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.shortmessage.MeetingInfoMapper;
|
||||
import com.ruoyi.system.mapper.sms.MsSmsSendHistoryRecordParamMapper;
|
||||
import com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
@@ -32,13 +40,15 @@ public class ShortMessageController extends BaseController {
|
||||
MsSmsSendRecordParamMapper recordParamMapper;
|
||||
@Autowired
|
||||
MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
|
||||
|
||||
/**
|
||||
* 查询短信发送记录
|
||||
*
|
||||
* @param smsSendRecord
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/recordList")
|
||||
public TableDataInfo smsSendRecordList( SmsSendRecord smsSendRecord){
|
||||
public TableDataInfo smsSendRecordList(SmsSendRecord smsSendRecord) {
|
||||
startPage();
|
||||
List<SmsSendRecord> list = shortMessageService.smsSendRecordList(smsSendRecord);
|
||||
return getDataTable(list);
|
||||
@@ -47,17 +57,17 @@ public class ShortMessageController extends BaseController {
|
||||
@Anonymous
|
||||
@PostMapping("/updateSendContent")
|
||||
public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) {
|
||||
if(smsSendRecord == null|| smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())){
|
||||
if (smsSendRecord == null || smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())) {
|
||||
return AjaxResult.error("参数校验失败");
|
||||
}
|
||||
// 查询当前版本记录
|
||||
// 查询当前版本记录
|
||||
SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
|
||||
smsSendRecord.setUpdateTime(new Date());
|
||||
// 更新短信内容,先删除短信记录参数表
|
||||
Example recordParamExam = new Example(MsSmsSendRecordParam.class);
|
||||
recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId());
|
||||
recordParamMapper.deleteByExample(recordParamExam);
|
||||
// 新增短信记录参数表
|
||||
// 更新短信内容,先删除短信记录参数表
|
||||
Example recordParamExam = new Example(MsSmsSendRecordParam.class);
|
||||
recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId());
|
||||
recordParamMapper.deleteByExample(recordParamExam);
|
||||
// 新增短信记录参数表
|
||||
List<MsSmsSendRecordParam> recordParams = new ArrayList<>();
|
||||
for (MsSmsTemplateParam templateParam : smsSendRecord.getTemplateParams()) {
|
||||
MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
|
||||
@@ -65,9 +75,9 @@ public class ShortMessageController extends BaseController {
|
||||
recordParam.setParamValue(templateParam.getParamValue());
|
||||
recordParams.add(recordParam);
|
||||
}
|
||||
recordParamMapper.batchInsert(recordParams);
|
||||
shortMessageService.insertShortMessageHistoryRecord(oldSendRecord,recordParams);
|
||||
return AjaxResult.success();
|
||||
recordParamMapper.batchInsert(recordParams);
|
||||
shortMessageService.insertShortMessageHistoryRecord(oldSendRecord, recordParams);
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
@@ -84,14 +94,32 @@ public class ShortMessageController extends BaseController {
|
||||
return AjaxResult.error("参数缺失");
|
||||
}
|
||||
|
||||
@Autowired
|
||||
MeetingInfoMapper meetingInfoMapper;
|
||||
@Autowired
|
||||
SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 查询UID好的密钥
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("/getMeetingInfo")
|
||||
public Object getEncryptInfoByUid(@RequestParam(name = "authId", required = true) String authId) {
|
||||
MeetingInfoVO result = new MeetingInfoVO();
|
||||
if (authId != null) {
|
||||
Object result = shortMessageService.getMeetingInfo(authId);
|
||||
MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(authId);
|
||||
if (meetingInfo != null && meetingInfo.getUserId() != null) {
|
||||
BeanUtils.copyProperties(meetingInfo, result);
|
||||
SysUser sysUser = sysUserMapper.selectUserById(meetingInfo.getUserId());
|
||||
LoginUser loginUser = new LoginUser();
|
||||
loginUser.setUserId(sysUser.getUserId());
|
||||
loginUser.setUser(sysUser);
|
||||
String token = tokenService.createVideoToken(loginUser, 120);
|
||||
// String createToken = createToken(claims);
|
||||
result.setToken(token);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return AjaxResult.error("查询失败");
|
||||
|
||||
Reference in New Issue
Block a user