Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
email
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈天仲
email
Commits
7856a0a2
Commit
7856a0a2
authored
Mar 11, 2023
by
chentianzhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
9a457fce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
src/main/java/com/zq/email/controller/BusinessSystemController.java
+6
-0
src/main/java/com/zq/email/controller/EmailController.java
+6
-1
src/main/java/com/zq/email/controller/EmailFolderController.java
+2
-2
src/main/java/com/zq/email/controller/EmailPersonController.java
+3
-4
No files found.
src/main/java/com/zq/email/controller/BusinessSystemController.java
View file @
7856a0a2
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
{
}
}
src/main/java/com/zq/email/controller/EmailController.java
View file @
7856a0a2
...
@@ -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
);
...
...
src/main/java/com/zq/email/controller/EmailFolderController.java
View file @
7856a0a2
...
@@ -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
);
...
...
src/main/java/com/zq/email/controller/EmailPersonController.java
View file @
7856a0a2
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment