wl
2022-12-14 0b043f9c700fdf7e1a5e4ec4cf740b08915b269f
fix: 视频图片添加操作人
3个文件已修改
19 ■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/resources/ImageResourcesController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/resources/VideoResourcesController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/resources/VideoResources.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/resources/ImageResourcesController.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.ImageResources;
import com.ycl.service.resources.IImageResourcesService;
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;
@@ -29,6 +31,7 @@
    @Autowired
    IImageResourcesService iImageResourcesService;
    @GetMapping("/query")
    @ApiOperation("查询")
    @LogSave(operationType = "图片资源管理", contain = "查询图片")
@@ -42,28 +45,30 @@
    @PutMapping("modification")
    @ApiOperation("修改图片")
    @LogSave(operationType = "图片管理",contain = "修改图片")
    @LogSave(operationType = "图片管理", contain = "修改图片")
    public CommonResult modify(@RequestBody ImageResources imageResources) {
        return CommonResult.success(iImageResourcesService.updateById(imageResources));
    }
    @DeleteMapping("deletion")
    @ApiOperation("删除")
    @LogSave(operationType = "图片管理",contain = "删除图片")
    @LogSave(operationType = "图片管理", contain = "删除图片")
    public CommonResult delete(@RequestParam Integer id) {
        return CommonResult.success(iImageResourcesService.removeById(id));
    }
    @PostMapping("addition")
    @ApiOperation("添加")
    @LogSave(operationType = "图片管理",contain = "添加图片")
    @LogSave(operationType = "图片管理", contain = "添加图片")
    public CommonResult add(@RequestBody ImageResources imageResources) {
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        imageResources.setCreateUser(user.getUserId());
        return CommonResult.success(iImageResourcesService.save(imageResources));
    }
    @DeleteMapping("deletion_batch")
    @ApiOperation("批量删除")
    @LogSave(operationType = "图片管理",contain = "批量删除图片")
    @LogSave(operationType = "图片管理", contain = "批量删除图片")
    public CommonResult delete(@RequestParam List<Integer> ids) {
        return CommonResult.success(iImageResourcesService.removeBatchByIds(ids));
    }
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));
    }
ycl-platform/src/main/java/com/ycl/entity/resources/VideoResources.java
@@ -53,7 +53,7 @@
     * 创建人
     */
    @TableField("create_user")
    private Integer createUser;
    private Long createUser;
    /**
     * 创建时间