package com.cm.common.controller.app.apis.templaterecord;

import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.dtos.templaterecord.TemplateRecordDTO;
import com.cm.common.result.ErrorResult;
import com.cm.common.service.templaterecord.ITemplateRecordService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @ClassName: TemplateRecordController
 * @Description: 模板构建记录
 * @Author: WenG
 * @Date: 2020-05-07 16:50
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "模板构建记录接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/templaterecord")
public class TemplateRecordAppController extends AbstractController {

    @Autowired
    private ITemplateRecordService templateRecordService;
    @Autowired
    private SecurityComponent securityComponent;

    @ApiOperation(value = "模板构建记录详情(通过ID)", notes = "模板构建记录详情(通过ID)接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateRecordId", value = "模板构建记录ID", paramType = "path")
    })
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("gettemplaterecordbyid/{templateRecordId}")
    public TemplateRecordDTO getTemplateRecordById(@PathVariable("templateRecordId") String templateRecordId) throws SearchException {
        return templateRecordService.getTemplateRecordById(templateRecordId);
    }

}