mirror of
https://github.com/liuweijw/fw-cloud-framework.git
synced 2026-03-13 08:50:21 +08:00
修复日志删除Long型Id问题
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.github.liuweijw.business.admin.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -50,6 +52,13 @@ public class LogInfoServiceImpl implements LogInfoService {
|
||||
Sort sort = new Sort(new Sort.Order(Sort.Direction.DESC, "id"));
|
||||
PageRequest pageRequest = PageUtils.of(pageParams, sort);
|
||||
Page<LogInfo> pageList = logInfoRepository.findAll(predicate, pageRequest);
|
||||
|
||||
List<LogInfo> cList = pageList.getContent();
|
||||
if (null != cList && cList.size() > 0) {
|
||||
cList.forEach(log -> {
|
||||
log.setIdView(log.getId() + "");
|
||||
});
|
||||
}
|
||||
return PageUtils.of(pageList);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@ public class LogController extends BaseController {
|
||||
@RequestMapping(value = "/del/{id}", method = RequestMethod.POST)
|
||||
@PrePermissions(value = Functional.DEL)
|
||||
public R<Boolean> del(HttpServletRequest request, @PathVariable Long id) {
|
||||
if (null == id || id.intValue() <= 0) return new R<Boolean>().failure("日志id为空");
|
||||
if (null == id || id <= 0)
|
||||
return new R<Boolean>().data(false).failure("日志id为空");
|
||||
|
||||
boolean isDel = this.logInfoService.delById(id);
|
||||
return new R<Boolean>().data(isDel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user