package com.xindazhou.message.api;

import com.xindazhou.framework.common.pojo.CommonResult;
import com.xindazhou.message.api.dto.template.MessageTemplateRespDTO;
import com.xindazhou.message.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 消息模板 API
 *
 * @author xindazhou
 */
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 消息模板")
public interface MessageTemplateApi {

    String PREFIX = "/rpc-api/message/template";

    @GetMapping(PREFIX + "/get-by-code")
    @Operation(summary = "根据模板编号获取消息模板")
    @Parameter(name = "code", description = "模板编号", required = true, example = "MESSAGE_TEMPLATE_001")
    CommonResult<MessageTemplateRespDTO> getMessageTemplateByCode(@RequestParam("code") String code);

}

