package com.xindazhou.message.api;

import com.xindazhou.framework.common.pojo.CommonResult;
import com.xindazhou.message.api.dto.template.MessageTemplateRespDTO;
import com.xindazhou.message.service.MessageTemplateService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

import static com.xindazhou.framework.common.pojo.CommonResult.success;

/**
 * 消息模板 API 实现类
 *
 * @author xindazhou
 */
@RestController
@Validated
public class MessageTemplateApiImpl implements MessageTemplateApi {

    @Resource
    private MessageTemplateService messageTemplateService;

    @Override
    public CommonResult<MessageTemplateRespDTO> getMessageTemplateByCode(String code) {
        // TODO: 实现消息模板查询逻辑
        MessageTemplateRespDTO template = messageTemplateService.getMessageTemplateByCode(code);
        return success(template);
    }

}

