package com.m2pool.system.api;

import com.m2pool.common.core.Result.R;
import com.m2pool.common.core.constant.ServiceNameConstants;
import com.m2pool.system.api.entity.EmailEntity;
import com.m2pool.system.api.entity.EmailTemplateEntity;
import com.m2pool.system.api.entity.GetEmailCodeEntity;
import com.m2pool.system.api.factory.RemoteMailFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 邮件服务
 *
 * @author m2pool
 */
@FeignClient(contextId = "remoteMailService", value = ServiceNameConstants.AUTH_SERVICE, fallbackFactory = RemoteMailFallbackFactory.class)
public interface RemoteMailService
{
    /**
     * 发送提现的邮箱验证码
     *
     * @return 结果
     */
    @PostMapping("/addCreditEmailCode")
    public R<?> sendAddCreditEmailCode(@RequestBody GetEmailCodeEntity entity);

    /**
     * 发送文本邮件
     *
     * @return 结果
     */
    @PostMapping("/sendTextMail")
    public R<?> sendTextMail(@RequestBody EmailEntity entity);


    /**
     * 发送html邮件
     *
     * @return 结果
     */
    @PostMapping("/sendHtmlMailMessage")
    public R<?> sendHtmlMailMessage(@RequestBody EmailTemplateEntity entity);
}

