增加管理员日志详情接口

This commit is contained in:
xxx
2023-09-05 16:23:53 +08:00
parent 61eb5be2ee
commit 06da295d58
4 changed files with 30 additions and 5 deletions

View File

@@ -19,10 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import xyz.playedu.common.annotation.BackendPermission;
import xyz.playedu.common.annotation.Log;
@@ -31,6 +28,7 @@ import xyz.playedu.common.constant.BPermissionConstant;
import xyz.playedu.common.constant.BusinessTypeConstant;
import xyz.playedu.common.context.BCtx;
import xyz.playedu.common.domain.AdminLog;
import xyz.playedu.common.exception.ServiceException;
import xyz.playedu.common.service.AdminLogService;
import xyz.playedu.common.types.JsonResponse;
import xyz.playedu.common.types.paginate.AdminLogPaginateFiler;
@@ -87,4 +85,19 @@ public class AdminLogController {
return JsonResponse.data(data);
}
@BackendPermission(slug = BPermissionConstant.ADMIN_LOG)
@GetMapping("/detail/{id}")
public JsonResponse detail(@PathVariable(name = "id") Integer id) {
Integer adminId = 0;
if (!backendBus.isSuperAdmin()) {
adminId = BCtx.getId();
}
AdminLog log = adminLogService.find(id, adminId);
if (log == null) {
throw new ServiceException("日志不存在");
}
return JsonResponse.data(log);
}
}