package com.platform.controller; import com.platform.model.entity.CaseRuleConfigEntity; import com.platform.model.resp.Result; import com.platform.service.CaseRuleConfigService; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @RestController @RequestMapping("/case/rule") public class CaseRuleConfigController extends BaseController { @Resource private CaseRuleConfigService caseRuleConfigService; @PostMapping("/saveOrUpdate") public Result saveOrUpdate(@RequestBody CaseRuleConfigEntity caseRuleConfigEntity) { if(ObjectUtils.isEmpty(caseRuleConfigEntity.getId())){ return toAjax(caseRuleConfigService.save(caseRuleConfigEntity)); }else { caseRuleConfigService.removeById(caseRuleConfigEntity.getId()); return toAjax(caseRuleConfigService.save(caseRuleConfigEntity)); } } @GetMapping("/data/{caseId}") public Result data(@PathVariable int caseId) { return Result.data(caseRuleConfigService.getByCaseId(caseId)); } }