package com.lantone.daqe.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lantone.common.api.CommonResult;
import com.lantone.daqe.dto.GetRecordTemplateManageDTO;
import com.lantone.daqe.dto.GetRecordTemplatePageDTO;
import com.lantone.daqe.facade.RecordTemplateManagementFacade;
import com.lantone.daqe.vo.GetRecordTemplateByIdVO;
import com.lantone.daqe.vo.GetRecordTemplatePageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description: 文书模板维护API
 * @author： zhanghang
 * @time: 2022/2/28 17:47
 */
@RestController
@Api(value = "文书模板维护API", tags = { "文书模板维护API" })
@RequestMapping("/recordTemplateManage")
public class RecordTemplateManagementController {

    @Autowired
    private RecordTemplateManagementFacade recordTemplateManagementFacade;


    @ApiOperation(value = "获取文书模板分页列表 [by:zhanghang]")
    @PostMapping("/getRecordTemplatePage")
    public CommonResult<IPage<GetRecordTemplatePageDTO>> getRecordTemplatePage(@RequestBody GetRecordTemplatePageVO getRecordTemplatePageVO) {
        return CommonResult.success(recordTemplateManagementFacade.getRecordTemplatePage(getRecordTemplatePageVO));
    }


    @ApiOperation(value = "查看文书模板信息 [by:zhanghang]")
    @PostMapping("/getRecordTemplateManage")
    public CommonResult<GetRecordTemplateManageDTO> getRecordTemplateManage(@RequestBody GetRecordTemplateByIdVO getRecordTemplateByIdVO) {
        return CommonResult.success(recordTemplateManagementFacade.getRecordTemplateById(getRecordTemplateByIdVO));
    }

}