Commit 7856a0a2 by chentianzhong

调整

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