mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-07 09:44:03 +08:00
后台课件操作日志c
This commit is contained in:
parent
ae0b3ab9e0
commit
c65013f266
@ -22,7 +22,6 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.*;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
@ -38,7 +37,6 @@ import xyz.playedu.api.util.RequestUtil;
|
||||
import xyz.playedu.api.util.StringUtil;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@ -155,19 +153,19 @@ public class AdminLogAspect {
|
||||
public JSONObject excludeProperties(String jsonData) {
|
||||
JSONObject jsonObjectResult = new JSONObject();
|
||||
// 把传入String类型转换成JSONObject对象
|
||||
if(JSONUtil.isTypeJSON(jsonData)){
|
||||
if (JSONUtil.isTypeJSON(jsonData)) {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(jsonData);
|
||||
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
if(StringUtil.isNotNull(value)){
|
||||
if (StringUtil.isNotNull(value)) {
|
||||
// 如果value依旧是json类型的话继续递归解析
|
||||
if (JSONUtil.isTypeJSON(value.toString())) {
|
||||
jsonObjectResult.put(key, excludeProperties(entry.getValue().toString()));
|
||||
} else {
|
||||
// 如果value是单纯的数据,执行脱敏操作
|
||||
for (String i : Arrays.asList(EXCLUDE_PROPERTIES)) {
|
||||
if(key.equals(i)){
|
||||
for (String i : EXCLUDE_PROPERTIES) {
|
||||
if (key.equals(i)) {
|
||||
jsonObjectResult.put(key, "******");
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import xyz.playedu.api.annotation.Log;
|
||||
import xyz.playedu.api.constant.BPermissionConstant;
|
||||
import xyz.playedu.api.constant.BackendConstant;
|
||||
import xyz.playedu.api.constant.BusinessType;
|
||||
import xyz.playedu.api.domain.CourseAttachment;
|
||||
import xyz.playedu.api.exception.NotFoundException;
|
||||
import xyz.playedu.api.middleware.BackendPermissionMiddleware;
|
||||
@ -44,6 +46,7 @@ public class CourseAttachmentController {
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.COURSE)
|
||||
@PostMapping("/create")
|
||||
@Log(title = "线上课-附件-新建", businessType = BusinessType.INSERT)
|
||||
public JsonResponse store(
|
||||
@PathVariable(name = "courseId") Integer courseId,
|
||||
@RequestBody @Validated CourseAttachmentRequest req)
|
||||
@ -71,6 +74,7 @@ public class CourseAttachmentController {
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.COURSE)
|
||||
@PostMapping("/create-batch")
|
||||
@Transactional
|
||||
@Log(title = "线上课-附件-批量新建", businessType = BusinessType.INSERT)
|
||||
public JsonResponse storeMulti(
|
||||
@PathVariable(name = "courseId") Integer courseId,
|
||||
@RequestBody @Validated CourseAttachmentMultiRequest req) {
|
||||
@ -107,6 +111,7 @@ public class CourseAttachmentController {
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.COURSE)
|
||||
@GetMapping("/{id}")
|
||||
@Log(title = "线上课-附件-编辑", businessType = BusinessType.GET)
|
||||
public JsonResponse edit(
|
||||
@PathVariable(name = "courseId") Integer courseId,
|
||||
@PathVariable(name = "id") Integer id)
|
||||
@ -117,6 +122,7 @@ public class CourseAttachmentController {
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.COURSE)
|
||||
@PutMapping("/{id}")
|
||||
@Log(title = "线上课-附件-编辑", businessType = BusinessType.UPDATE)
|
||||
public JsonResponse update(
|
||||
@PathVariable(name = "courseId") Integer courseId,
|
||||
@PathVariable(name = "id") Integer id,
|
||||
@ -129,6 +135,7 @@ public class CourseAttachmentController {
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.COURSE)
|
||||
@DeleteMapping("/{id}")
|
||||
@Log(title = "线上课-附件-删除", businessType = BusinessType.DELETE)
|
||||
public JsonResponse destroy(
|
||||
@PathVariable(name = "courseId") Integer courseId,
|
||||
@PathVariable(name = "id") Integer id)
|
||||
@ -139,6 +146,7 @@ public class CourseAttachmentController {
|
||||
}
|
||||
|
||||
@PutMapping("/update/sort")
|
||||
@Log(title = "线上课-附件-排序调整", businessType = BusinessType.UPDATE)
|
||||
public JsonResponse updateSort(
|
||||
@PathVariable(name = "courseId") Integer courseId,
|
||||
@RequestBody @Validated CourseAttachmentSortRequest req) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user