PtlNewCarJudgeRulesController.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.ydtech.modules.protocol.controller;
  2. import com.ydtech.core.page.HttpResult;
  3. import com.ydtech.core.page.PageResult;
  4. import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
  5. import com.ydtech.modules.protocol.entity.vo.PtlNewCarJudgeRulesVo;
  6. import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import org.springframework.web.bind.annotation.*;
  10. import java.util.List;
  11. @Api(tags = "新车判断规则")
  12. @RestController
  13. @RequestMapping("/ptl/newCar/judgeRule")
  14. public class PtlNewCarJudgeRulesController {
  15. private final PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService;
  16. public PtlNewCarJudgeRulesController(PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService) {
  17. this.ptlNewCarJudgeRulesService = ptlNewCarJudgeRulesService;
  18. }
  19. @PostMapping("/page")
  20. @ApiOperation("分页查询新车判断规则")
  21. public HttpResult<PageResult<PtlNewCarJudgeRules>> page(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
  22. return ptlNewCarJudgeRulesService.pageNewCarJudgeRules(ptlNewCarJudgeRulesVo);
  23. }
  24. @PostMapping
  25. @ApiOperation("添加新车判断规则")
  26. public HttpResult<Object> save(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
  27. return ptlNewCarJudgeRulesService.saveNewCarJudgeRules(ptlNewCarJudgeRulesVo);
  28. }
  29. @PutMapping("/{ruleId}")
  30. @ApiOperation("修改新车判断规则")
  31. public HttpResult<Object> revise(@PathVariable String ruleId, @RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
  32. return ptlNewCarJudgeRulesService.reviseNewCarJudgeRules(ruleId, ptlNewCarJudgeRulesVo);
  33. }
  34. @GetMapping("/{ruleId}")
  35. @ApiOperation("通过规则id查询所有信息")
  36. public HttpResult<PtlNewCarJudgeRulesVo> getByAgreementId(@PathVariable String ruleId) {
  37. return ptlNewCarJudgeRulesService.getByRuleId(ruleId);
  38. }
  39. @DeleteMapping("/{ruleId}")
  40. @ApiOperation("删除新车判断规则")
  41. public HttpResult<Object> delete(@PathVariable String ruleId) {
  42. return ptlNewCarJudgeRulesService.deleteByRuleId(ruleId);
  43. }
  44. @GetMapping("/getByCompanyId/{companyId}")
  45. @ApiOperation("通过保险公司编号查询新车判断规则")
  46. public HttpResult<List<PtlNewCarJudgeRules>> getByCompanyId(@PathVariable String companyId) {
  47. return ptlNewCarJudgeRulesService.getByCompanyId(companyId);
  48. }
  49. }