use of com.hb0730.boot.admin.domain.service.ISuperBaseService in project boot-admin by hb0730.
the class IBaseSaveController method save.
/**
* 保存
*
* @param dto 参数
* @return 是否成功
*/
@PostMapping("/save")
@SuppressWarnings({ "rawtypes", "unchecked" })
@Log(value = "保存", paramsName = { "dto" }, businessType = BusinessTypeEnum.INSERT)
@PreAuthorize("@bootAdmin.hasAnyAuthority(this,'ROLE_ADMINISTRATOR','save')")
default Result<String> save(@RequestBody @Validated DTO dto) {
ValidatorUtils.validate(dto);
ISuperBaseService baseService = getBaseService();
if (null != baseService) {
baseService.save(dto);
return R.success("保存成功");
}
return R.result(ResponseStatusEnum.PARAMS_REQUIRED_IS_NULL, "service is null");
}
use of com.hb0730.boot.admin.domain.service.ISuperBaseService in project boot-admin by hb0730.
the class IBaseUpdateController method updateById.
/**
* 根据id修改
*
* @param id id
* @param dto 修改参数
* @return 是否成功
*/
@PutMapping("/update/{id}")
@SuppressWarnings({ "rawtypes", "unchecked" })
@Log(value = "修改", paramsName = { "dto" }, businessType = BusinessTypeEnum.UPDATE)
@PreAuthorize("@bootAdmin.hasAnyAuthority(this,'ROLE_ADMINISTRATOR','update')")
default Result<String> updateById(@PathVariable("id") ID id, @Validated @RequestBody DTO dto) {
ValidatorUtils.validate(dto);
ISuperBaseService service = getBaseService();
if (null != service) {
service.updateById(id, dto);
return R.success("修改成功");
}
return R.result(ResponseStatusEnum.PARAMS_REQUIRED_IS_NULL, "service is null");
}
Aggregations