From 7ef4892f9f24f941aca37e6b3991b808a0aca619 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期五, 08 九月 2023 11:16:35 +0800
Subject: [PATCH] 优化
---
ycl-platform/src/main/java/com/ycl/controller/resources/VideoResourcesController.java | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ycl-platform/src/main/java/com/ycl/controller/resources/VideoResourcesController.java b/ycl-platform/src/main/java/com/ycl/controller/resources/VideoResourcesController.java
index f650fb1..4f7feae 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/resources/VideoResourcesController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/resources/VideoResourcesController.java
@@ -3,12 +3,14 @@
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonResult;
+import com.ycl.bo.AdminUserDetails;
import com.ycl.controller.BaseController;
import com.ycl.entity.resources.VideoResources;
import com.ycl.service.resources.IVideoResourcesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -58,6 +60,8 @@
@ApiOperation("娣诲姞")
@LogSave(operationType = "瑙嗛绠$悊", contain = "娣诲姞瑙嗛")
public CommonResult add(@RequestBody VideoResources videoResources) {
+ AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
+ videoResources.setCreateUser(user.getUserId());
return CommonResult.success(iVideoResourcesService.save(videoResources));
}
@@ -67,4 +71,4 @@
public CommonResult delete(@RequestParam List<Integer> ids) {
return CommonResult.success(iVideoResourcesService.removeBatchByIds(ids));
}
-}
+}
\ No newline at end of file
--
Gitblit v1.8.0