Blame view

src/main/java/com/order/erp/controller/EmailTemplateController.java 2.14 KB
谢茂盛 authored
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.order.erp.controller;

import com.order.erp.common.constant.ServerResult;
import com.order.erp.common.jsr303.OperateGroup;
import com.order.erp.domain.vo.order.EmailTemplateQueryVO;
import com.order.erp.domain.vo.order.EmailTemplateVO;
import com.order.erp.service.order.EmailTemplateService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 邮件模板表(EmailTemplate)表控制层
 *
 * @author makejava
 * @since 2024-07-03 10:58:25
 */
@RestController
@RequestMapping("/order/erp/email_template")
public class EmailTemplateController {
    /**
     * 服务对象
     */
    @Resource
    private EmailTemplateService emailTemplateService;

    /**
     * 分页查询
     *
     * @param emailTemplateQueryVO 查询条件
     * @return 查询结果
     */
    @PostMapping("/list")
    public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) EmailTemplateQueryVO emailTemplateQueryVO) {
        return emailTemplateService.list(emailTemplateQueryVO);
    }


    /**
     * 新增数据
     *
     * @param emailTemplateVO 数据VO
     * @return 新增结果
     */
    @PostMapping("/add")
    public ServerResult add(@RequestBody EmailTemplateVO emailTemplateVO) {
        return emailTemplateService.add(emailTemplateVO);
    }

    /**
     * 编辑数据
     *
     * @param emailTemplateVO 数据VO
     * @return 编辑结果
     */
    @PostMapping("/edit")
    public ServerResult edit(@RequestBody EmailTemplateVO emailTemplateVO) {
        return emailTemplateService.edit(emailTemplateVO);
    }

    /**
     * 删除数据
     *
     * @param emailTemplateQueryVO 查询条件
     * @return 删除是否成功
     */
    @PostMapping("/delete_by_id")
    public ServerResult deleteById(@RequestBody EmailTemplateQueryVO emailTemplateQueryVO) {
        return emailTemplateService.deleteById(emailTemplateQueryVO);
    }

}