规则配置

main
FOAM 2024-09-21 14:04:43 +08:00
parent 50b910bf25
commit c7989bec9a
4 changed files with 22 additions and 0 deletions

View File

@ -45,10 +45,15 @@ public class Dict extends BaseEntity implements Serializable {
@OneToMany(mappedBy = "dict",cascade={CascadeType.PERSIST,CascadeType.REMOVE})
private List<DictDetail> dictDetails;
@ApiModelProperty(value = "代码")
private String code;
@NotBlank
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "类型;0普通1规则")
private String type;
}

View File

@ -60,10 +60,20 @@ public class DictController {
return new ResponseEntity<>(dictService.queryAll(new DictQueryCriteria()),HttpStatus.OK);
}
@ApiOperation("查询字典")
@GetMapping(value = "/queryRule")
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity<Object> queryRule(DictQueryCriteria resources, Pageable pageable){
resources.setType("1");
return new ResponseEntity<>(dictService.queryAll(resources,pageable),HttpStatus.OK);
}
@ApiOperation("查询字典")
@GetMapping
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity<Object> queryDict(DictQueryCriteria resources, Pageable pageable){
resources.setType("0");
return new ResponseEntity<>(dictService.queryAll(resources,pageable),HttpStatus.OK);
}

View File

@ -33,7 +33,11 @@ public class DictDto extends BaseDTO implements Serializable {
private List<DictDetailDto> dictDetails;
private String code;
private String name;
private String description;
private String type;
}

View File

@ -27,4 +27,7 @@ public class DictQueryCriteria {
@Query(blurry = "name,description")
private String blurry;
@Query(type = Query.Type.EQUAL)
private String type;
}