package com.tashow.cloud.systemapi.api.mail;

import com.tashow.cloud.common.pojo.CommonResult;
import com.tashow.cloud.systemapi.api.mail.dto.MailSendSingleToUserReqDTO;
import com.tashow.cloud.systemapi.enums.ApiConstants;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
/** RPC 服务 - 邮件发送 */
public interface MailSendApi {

  String PREFIX = ApiConstants.PREFIX + "/mail/send";

  @PostMapping(PREFIX + "/send-single-admin")
  /** 发送单条邮件给 Admin 用户", description = "在 mail 为空时，使用 userId 加载对应 Admin 的邮箱 */
  CommonResult<Long> sendSingleMailToAdmin(@Valid @RequestBody MailSendSingleToUserReqDTO reqDTO);

  @PostMapping(PREFIX + "/send-single-member")
  /** 发送单条邮件给 Member 用户", description = "在 mail 为空时，使用 userId 加载对应 Member 的邮箱 */
  CommonResult<Long> sendSingleMailToMember(@Valid @RequestBody MailSendSingleToUserReqDTO reqDTO);
}
