测试用户
2023-04-13 43393f2bb11cbf9e6af40077bbc5284660e8a754
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.deloitte.system.controller;
 
import com.common.core.beans.Result;
import com.common.core.enums.ResultCodeEnum;
import com.common.core.utils.IdUtils;
import com.deloitte.system.request.MessageVo;
import com.deloitte.system.service.MailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * @ClassName FileController
 * @Author holfeng
 * @Date 11:23 27/01/2022
 * @Version 1.0
 **/
@RestController
@RequestMapping("/mail")
@Slf4j
public class MailController {
    @Autowired
    private MailService mailService;
 
    @Autowired
    private IdUtils idWorker;
 
    @PostMapping("/sendEmail")
    public Result<Object> sendEmail(@RequestBody MessageVo messageVo) {
        String txId = idWorker.nextId();
        String sfMailMergeId=mailService.sendEmail(txId,messageVo);
        Result<Object> res = Result.resp(ResultCodeEnum.RT_SUCCESS);
        res.setObject(sfMailMergeId);
        res.setTxId(txId);
        return res;
    }
 
//    @GetMapping("/sync")
//    public Result<Object>  syncEmail() {
//        String txId = idWorker.nextId();
//        mailService.receiveImapMail();
//        Result<Object> res = Result.resp(ResultCodeEnum.RT_SUCCESS);
//        res.setTxId(txId);
//        return res;
//    }
 
}