package com.ydtech.modules.protocol.controller; import com.ydtech.core.page.HttpResult; import com.ydtech.core.page.PageResult; import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules; import com.ydtech.modules.protocol.entity.vo.PtlNewCarJudgeRulesVo; import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import java.util.List; @Api(tags = "新车判断规则") @RestController @RequestMapping("/ptl/newCar/judgeRule") public class PtlNewCarJudgeRulesController { private final PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService; public PtlNewCarJudgeRulesController(PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService) { this.ptlNewCarJudgeRulesService = ptlNewCarJudgeRulesService; } @PostMapping("/page") @ApiOperation("分页查询新车判断规则") public HttpResult> page(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) { return ptlNewCarJudgeRulesService.pageNewCarJudgeRules(ptlNewCarJudgeRulesVo); } @PostMapping @ApiOperation("添加新车判断规则") public HttpResult save(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) { return ptlNewCarJudgeRulesService.saveNewCarJudgeRules(ptlNewCarJudgeRulesVo); } @PutMapping("/{ruleId}") @ApiOperation("修改新车判断规则") public HttpResult revise(@PathVariable String ruleId, @RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) { return ptlNewCarJudgeRulesService.reviseNewCarJudgeRules(ruleId, ptlNewCarJudgeRulesVo); } @GetMapping("/{ruleId}") @ApiOperation("通过规则id查询所有信息") public HttpResult getByAgreementId(@PathVariable String ruleId) { return ptlNewCarJudgeRulesService.getByRuleId(ruleId); } @DeleteMapping("/{ruleId}") @ApiOperation("删除新车判断规则") public HttpResult delete(@PathVariable String ruleId) { return ptlNewCarJudgeRulesService.deleteByRuleId(ruleId); } @GetMapping("/getByCompanyId/{companyId}") @ApiOperation("通过保险公司编号查询新车判断规则") public HttpResult> getByCompanyId(@PathVariable String companyId) { return ptlNewCarJudgeRulesService.getByCompanyId(companyId); } }