|
|
@@ -1,7 +1,13 @@
|
|
|
package com.zhongzheng.controller.course;
|
|
|
|
|
|
+import java.lang.reflect.Field;
|
|
|
+import java.lang.reflect.InvocationHandler;
|
|
|
+import java.lang.reflect.Method;
|
|
|
+import java.lang.reflect.Proxy;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.zhongzheng.modules.course.bo.MajorCategoryAddBo;
|
|
|
@@ -10,6 +16,9 @@ import com.zhongzheng.modules.course.bo.MajorCategoryQueryBo;
|
|
|
import com.zhongzheng.modules.course.service.IMajorCategoryService;
|
|
|
import com.zhongzheng.modules.course.vo.MajorCategoryVo;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.expression.EvaluationContext;
|
|
|
+import org.springframework.expression.spel.support.StandardEvaluationContext;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -87,8 +96,10 @@ public class MajorCategoryController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('course:category:add')")
|
|
|
@Log(title = "【专业分类】", businessType = BusinessType.INSERT)
|
|
|
@PostMapping()
|
|
|
- public AjaxResult<Long> add(@Validated @RequestBody MajorCategoryAddBo bo) {
|
|
|
- return AjaxResult.success(iMajorCategoryService.insertByAddBo(bo));
|
|
|
+ public AjaxResult add(@Validated @RequestBody MajorCategoryAddBo bo) throws NoSuchMethodException, NoSuchFieldException, IllegalAccessException {
|
|
|
+ Long id = iMajorCategoryService.insertByAddBo(bo);
|
|
|
+ String content = "新增分类:"+bo.getCategoryName();
|
|
|
+ return AjaxResult.success_log(id,content);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -100,6 +111,11 @@ public class MajorCategoryController extends BaseController {
|
|
|
@Log(title = "【专业分类】", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/edit")
|
|
|
public AjaxResult<Void> edit(@Validated @RequestBody MajorCategoryEditBo bo) {
|
|
|
+ if(iMajorCategoryService.updateByEditBo(bo)){
|
|
|
+ Long id = bo.getCategoryId();
|
|
|
+ String content = "修改分类:"+bo.getCategoryName();
|
|
|
+ return AjaxResult.success_log(id,content);
|
|
|
+ }
|
|
|
return toAjax(iMajorCategoryService.updateByEditBo(bo) ? 1 : 0);
|
|
|
}
|
|
|
|