value
2024-04-30 ce10da906c58596fce43bffa6a6d177268ca177b
framework/src/main/java/com/yuanchu/mom/common/AllController.java
@@ -1,8 +1,10 @@
package com.yuanchu.mom.common;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.mapper.AuthMapper;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.method.HandlerMethod;
@@ -11,6 +13,7 @@
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.Map;
@Component
@@ -28,7 +31,13 @@
        for (HandlerMethod value : methodMap.values()) {
            ApiOperation annotation = value.getMethodAnnotation(ApiOperation.class);
            ValueAuth valueAuth = value.getMethodAnnotation(ValueAuth.class);
            ValueClassify valueClassify = value.getMethodAnnotation(ValueClassify.class);
            if (valueAuth==null){
                if (valueClassify !=null) {
                    String type = valueClassify.value();
                    String remark = annotation.value();
                    authMapper.insertPower(value.getMethod().getName(),remark,type);
                }else{
                if (annotation != null) {
                    String remark = annotation.value();
                    String type = "修改";
@@ -47,6 +56,8 @@
                        authMapper.insertPower(value.getMethod().getName(), remark, type);
                    }catch (Exception e){
                        System.err.println(value.getMethod());
                            e.printStackTrace();
                        }
                    }
                }
            }