Commit 7856a0a2 by chentianzhong

调整

parent 9a457fce
package com.zq.email.controller;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -13,8 +16,11 @@ import org.springframework.web.bind.annotation.RestController;
* @author chentianzhong
* @since 2023-03-06
*/
@Api(tags = "对接外部系统接口")
@RestController
@RequestMapping("/email/businessSystem")
@Slf4j
@RequiredArgsConstructor
public class BusinessSystemController {
}
......@@ -3,6 +3,8 @@ package com.zq.email.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.zq.common.utils.AssertUtils;
import com.zq.common.utils.TokenUtils;
import com.zq.common.vo.OnlineUserDto;
import com.zq.common.vo.ResultVo;
import com.zq.email.entity.EmailContent;
import com.zq.email.entity.EmailPerson;
......@@ -92,11 +94,14 @@ public class EmailController {
@ApiOperation("邮件详情,这个接口如果前端从列表能获取到显示就不用调用")
@PostMapping("detail")
public ResultVo detail(@RequestBody EmailDetailVo vo) {
OnlineUserDto adminContext = TokenUtils.getAdminContext();
AssertUtils.notNull(adminContext, "登录已失效,请重新登录后再次尝试!");
AssertUtils.notNull(vo.getPersonId(), "缺少参数:personId");
AssertUtils.notNull(vo.getContentId(), "缺少参数:contentId");
EmailPerson emailPerson = emailPersonService.getById(vo.getPersonId());
AssertUtils.notNull(emailPerson, "获取邮件对应人员信息失败");
AssertUtils.isTrue(emailPerson.getEmailContentId() == vo.getContentId() , "contentId对应不一致"+emailPerson.getEmailContentId() +":"+vo.getContentId());
AssertUtils.isTrue(emailPerson.getUserId().equals(adminContext.getUserId()) , "非本人邮件,不允许阅读");
AssertUtils.isTrue(emailPerson.getEmailContentId() == vo.getContentId() , "邮件不匹配");
EmailContent content = emailContentService.getById(emailPerson.getEmailContentId());
AssertUtils.notNull(content, "获取邮件内容失败");
emailPerson.setEmailContent(content);
......
......@@ -34,7 +34,7 @@ public class EmailFolderController {
private final IEmailFolderService emailFolderService;
@ApiOperation("获取个人所有的文件夹")
@ApiOperation("获取个人自定义文件夹和默认文件夹树)")
@PostMapping("selfFolderList")
public ResultVo selfFolderList() {
OnlineUserDto adminContext = TokenUtils.getAdminContext();
......@@ -52,7 +52,7 @@ public class EmailFolderController {
}
@ApiOperation("获取个人自定义文件夹")
@ApiOperation("删除个人自定义文件夹")
@PostMapping("deleteFolder")
public ResultVo deleteFolder(@RequestBody List<Long> folderIdList) {
emailFolderService.deleteFolders(folderIdList);
......
......@@ -35,15 +35,14 @@ public class EmailPersonController {
private final IEmailPersonService emailPersonService;
@ApiOperation("移动邮件到个人文件夹")
@ApiOperation("移动邮件到自定义文件夹")
@PostMapping("move")
public ResultVo edit(@RequestBody EmailFolderMoveVo vo) {
emailPersonService.moveEmailFolder(vo);
return ResultVo.success();
}
@ApiOperation("任务邮件回复详情")
@ApiOperation("任务邮件收件人详情")
@PostMapping("findTaskEmailByContentId")
public ResultVo findTaskEmailByContentId(@RequestBody EmailDetailVo vo) {
AssertUtils.notNull(vo.getContentId(), "缺少参数:contentId");
......@@ -57,7 +56,7 @@ public class EmailPersonController {
return ResultVo.success(emailPersonService.findReceiverByContentId(vo.getContentId()));
}
@ApiOperation("邮件收件部门")
@ApiOperation("获取邮件收件部门")
@PostMapping("findReceiveDeptByContentId")
public ResultVo findReceiveDeptByContentId(@RequestBody EmailDetailVo vo) {
AssertUtils.notNull(vo.getContentId(), "缺少参数:contentId");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment