| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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<PageResult<PtlNewCarJudgeRules>> page(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
- return ptlNewCarJudgeRulesService.pageNewCarJudgeRules(ptlNewCarJudgeRulesVo);
- }
- @PostMapping
- @ApiOperation("添加新车判断规则")
- public HttpResult<Object> save(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
- return ptlNewCarJudgeRulesService.saveNewCarJudgeRules(ptlNewCarJudgeRulesVo);
- }
- @PutMapping("/{ruleId}")
- @ApiOperation("修改新车判断规则")
- public HttpResult<Object> revise(@PathVariable String ruleId, @RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
- return ptlNewCarJudgeRulesService.reviseNewCarJudgeRules(ruleId, ptlNewCarJudgeRulesVo);
- }
- @GetMapping("/{ruleId}")
- @ApiOperation("通过规则id查询所有信息")
- public HttpResult<PtlNewCarJudgeRulesVo> getByAgreementId(@PathVariable String ruleId) {
- return ptlNewCarJudgeRulesService.getByRuleId(ruleId);
- }
- @DeleteMapping("/{ruleId}")
- @ApiOperation("删除新车判断规则")
- public HttpResult<Object> delete(@PathVariable String ruleId) {
- return ptlNewCarJudgeRulesService.deleteByRuleId(ruleId);
- }
- @GetMapping("/getByCompanyId/{companyId}")
- @ApiOperation("通过保险公司编号查询新车判断规则")
- public HttpResult<List<PtlNewCarJudgeRules>> getByCompanyId(@PathVariable String companyId) {
- return ptlNewCarJudgeRulesService.getByCompanyId(companyId);
- }
- }
|