ReceiveEmailMappingController.java 2.74 KB
package com.order.erp.controller;

import com.order.erp.common.constant.ServerResult;
import com.order.erp.domain.dto.order.ReceiveEmailMappingDO;
import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO;
import com.order.erp.domain.vo.order.ReceiveEmailMappingVO;
import com.order.erp.service.order.ReceiveEmailMappingService;
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;

/**
 * 邮件接收人信息绑定表(ReceiveEmailMapping)表控制层
 *
 * @author makejava
 * @since 2024-07-03 10:58:52
 */
@RestController
@RequestMapping("/order/erp/receive_email_mapping")
public class ReceiveEmailMappingController {
    /**
     * 服务对象
     */
    @Resource
    private ReceiveEmailMappingService receiveEmailMappingService;

    /**
     * 分页查询
     *
     *
     * @return 查询结果
     */
    @PostMapping("/list")
    public ServerResult list() {
        return receiveEmailMappingService.listGetAll();
    }


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

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

    /**
     * 删除数据
     *
     * @param receiveEmailMappingVO 查询条件
     * @return 删除是否成功
     */
    @PostMapping("/delete_by_id")
    public ServerResult deleteById(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) {
        return receiveEmailMappingService.deleteById(receiveEmailMappingVO);
    }
    /**
     * 通过id查询单条数据
     *
     * @param receiveEmailMappingQueryVO 查询条件
     * @return 实例对象
     */
    @PostMapping("/query_by_id")
    public ServerResult queryById(@RequestBody ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) {
        return receiveEmailMappingService.queryById(receiveEmailMappingQueryVO);
    }

    /**
     * 禁用/启用配置
     *
     * @param receiveEmailMappingDo 数据vo
     * @return  操作结果
     */
    @PostMapping("/opt")
    public ServerResult opt(@RequestBody ReceiveEmailMappingDO receiveEmailMappingDo) {
        return receiveEmailMappingService.opt(receiveEmailMappingDo);
    }
}