package org.springblade.audit.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springblade.audit.entity.AuditUploadFileTemplate;
import org.springblade.audit.service.IAuditUploadFileTemplateService;
import org.springblade.core.tool.api.R;
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.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zbc
 * @since 2021-12-07
 */
@RestController
@RequestMapping("/audit/template")
@Api(value = "审核上传模板管理", tags = "审核上传模板接口")
public class AuditUploadFileTemplateController {

	@Autowired
	private IAuditUploadFileTemplateService auditUploadFileTemplateService;


	@GetMapping("/getFileTemplate")
	@ApiOperation(value = "获取上传审核模板")
	public R getFileTemplate(String code) {
		AuditUploadFileTemplate one = auditUploadFileTemplateService.getOne(new LambdaQueryWrapper<AuditUploadFileTemplate>()
			.eq(AuditUploadFileTemplate::getReportType, code)
		);
		return R.data(one);
	}

}

