|
|
@ -45,24 +45,24 @@ import java.util.Map; |
|
|
|
@RestController |
|
|
|
@RequestMapping("psychologisttitle") |
|
|
|
public class PsychologistTitleController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PsychologistTitleService psychologistTitleService; |
|
|
|
|
|
|
|
@GetMapping("page") |
|
|
|
public Result<PageData<PsychologistTitleDTO>> page(@RequestParam Map<String, Object> params){ |
|
|
|
public Result<PageData<PsychologistTitleDTO>> page(@RequestParam Map<String, Object> params) { |
|
|
|
PageData<PsychologistTitleDTO> page = psychologistTitleService.page(params); |
|
|
|
return new Result<PageData<PsychologistTitleDTO>>().ok(page); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("{id}") |
|
|
|
public Result<PsychologistTitleDTO> get(@PathVariable("id") String id){ |
|
|
|
public Result<PsychologistTitleDTO> get(@PathVariable("id") String id) { |
|
|
|
PsychologistTitleDTO data = psychologistTitleService.get(id); |
|
|
|
return new Result<PsychologistTitleDTO>().ok(data); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping |
|
|
|
public Result save(@RequestBody PsychologistTitleDTO dto){ |
|
|
|
public Result save(@RequestBody PsychologistTitleDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
psychologistTitleService.save(dto); |
|
|
@ -70,7 +70,7 @@ public class PsychologistTitleController { |
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping |
|
|
|
public Result update(@RequestBody PsychologistTitleDTO dto){ |
|
|
|
public Result update(@RequestBody PsychologistTitleDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
psychologistTitleService.update(dto); |
|
|
@ -78,7 +78,7 @@ public class PsychologistTitleController { |
|
|
|
} |
|
|
|
|
|
|
|
@DeleteMapping |
|
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
|
//效验数据
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
|
psychologistTitleService.delete(ids); |
|
|
@ -91,4 +91,9 @@ public class PsychologistTitleController { |
|
|
|
ExcelUtils.exportExcelToTarget(response, null, list, PsychologistTitleExcel.class); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("list") |
|
|
|
public Result<List<PsychologistTitleDTO>> list(@RequestParam Map<String, Object> params) { |
|
|
|
List<PsychologistTitleDTO> page = psychologistTitleService.list(params); |
|
|
|
return new Result<List<PsychologistTitleDTO>>().ok(page); |
|
|
|
} |
|
|
|
} |