package com.crm.manager.service.emial;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.system.email.template.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "EMAIL-SERVICE", path = "/email/template/manager")
public interface EmailTemplateFeignService {

    /**
     * 添加邮件模版
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/add")
    BaseResultDto add(@RequestBody @Validated SysEmailTemplateAddEntity entity) throws Exception;

    /**
     * 删除邮件模版
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/delete")
    BaseResultDto delete(@RequestBody @Validated SysEmailTemplateDeleteEntity entity) throws Exception;

    @PostMapping("/batch/update")
    BaseResultDto updateBatchRate(@RequestBody @Validated SysEmailTemplateBatchEntity entity) throws Exception;

    @PostMapping("/batch/update/send/code")
    BaseResultDto updateBatchEmailSendEmailCode() throws Exception;

    /**
     * 修改邮件模版
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/update")
    BaseResultDto update(@RequestBody @Validated SysEmailTemplateUpdateEntity entity) throws Exception;

    /**
     * 列表邮件模版
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/list")
    BaseResultDto pageList(@RequestBody @Validated SysEmailTemplateSearchEntity entity) throws Exception;

    @PostMapping("/list")
    BaseResultDto list() throws Exception;

    /**
     * 单个查询
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/single")
    BaseResultDto single(@RequestBody @Validated SingleLongEntity entity) throws Exception;


    @PostMapping("/add/send/code")
    BaseResultDto addChannelSendEmailCode() throws Exception;

    @PostMapping("/update/send/code")
    BaseResultDto updateEmailSendEmailCode() throws Exception;

    @PostMapping("/delete/send/code")
    BaseResultDto deleteChannelSendEmailCode() throws Exception;

}
