package com.muyu.warn.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.common.core.domain.Result;
import com.muyu.warn.domain.Template;
import com.muyu.warn.service.TemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName Template
 * @Description 报文模板
 * @Author YiBo.Liu
 * @Date 2024/9/22 18:37
 */
@RestController
@RequestMapping("/template")
public class TemplateController {

    @Autowired
    private TemplateService templateService;

    /**
     * 通过报文id查询
     * @param templateId
     * @return
     */
    @GetMapping("/findByTemplateId")
    private Result findByTemplateId(@RequestParam("templateId") Integer templateId) {
        return Result.success(templateService.getOne(
                new LambdaQueryWrapper<Template>().eq(Template::getTemplateId, templateId)));

    }
}
