package com.hotent.baseInfo.controller;


import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.baseInfo.req.CostInformationPageReq;
import com.hotent.common.CrudService;
import com.hotent.resp.PageResp;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import com.hotent.base.model.CommonResult;
import com.hotent.base.util.StringUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RestController;
import com.hotent.base.controller.BaseController;
import com.hotent.baseInfo.model.CostInformation;
import com.hotent.baseInfo.manager.CostInformationManager;

/**
 * 监审资料 前端控制器
 *
 * @company 山西清众科技股份有限公司
 * @author 超级管理员
 * @since 2025-09-17
 */
@RestController
@RequestMapping("/api/costInformation/v1/")
@Api(tags = "监审资料管理")
@ApiGroup(group = {ApiGroupConsts.GROUP_COST})
public class CostInformationController extends BaseController<CostInformationManager, CostInformation> {


	// 创建通用服务实例
	private final CrudService crudService = new CrudService();

	/**
	 * 根据id获取监审资料数据详情
	 * @param id
	 * @return
	 * @throws Exception 
	 * ModelAndView
	 */
	@GetMapping(value="/getDetail")
	@ApiOperation(value="根据id获取监审资料数据详情",httpMethod = "GET",notes = "根据id获取监审资料数据详情")
	public CommonResult<CostInformation> getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{
		return CommonResult.<CostInformation>ok().value(baseService.getDetail(id));
	}

	//分页查询
	@PostMapping(value="/pageList")
	@ApiOperation(value="分页查询pageList",httpMethod = "POST",notes = "分页查询")
	public PageResp<CostInformation> pageList(@RequestBody CostInformationPageReq req) throws Exception {
		return crudService.pageQuery(req, baseService::getInformationList);

	}

}
