fei.wang
2024-05-13 b9b58b9ef261cb290d93465f88a2cbd814b576f0
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
48
49
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
 
package com.flow.controller;
 
import com.flow.pojo.Mail;
import com.flow.service.mailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping({"/hxzk"})
public class mailController {
    @Autowired
    mailService mailService;
 
    public mailController() {
    }
 
    @PostMapping({"findMail"})
    public int findMail(String company) {
        return this.mailService.findMail(company);
    }
 
    @PostMapping({"findMailUser"})
    public Mail findMailUser(String company) {
        return this.mailService.findMailUser(company);
    }
 
    @GetMapping({"addMail"})
    @ResponseBody
    public int findMail(Mail mail) {
        int exits = this.mailService.findMail(mail.getCompany());
        int pod;
        if (exits == 1) {
            pod = this.mailService.updateMail(mail);
        } else {
            pod = this.mailService.addMail(mail);
        }
 
        return pod;
    }
}