Commit 229ddb9b authored by 赵啸非's avatar 赵啸非

添加资源扫描接口

parent ff2bb76f
......@@ -85,11 +85,6 @@
<artifactId>javase</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
......
......@@ -130,8 +130,8 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
Arrays.stream(tempResource.getUrl().split(",")).forEach(i -> {
setUrl.add(i);
});
resourceEntity.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(resourceEntity, context);
tempResource.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(tempResource, context);
} else if (tempResourceList.size() > 1) {
//找到多个同名的 资源配置
for (ResourceEntity tempResource : tempResourceList) {
......@@ -150,8 +150,8 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
Arrays.stream(tempResource.getUrl().split(",")).forEach(i -> {
setUrl.add(i);
});
resourceEntity.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(resourceEntity, context);
tempResource.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(tempResource, context);
}
}
}
......
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.module.site.web.SiteController;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -63,14 +61,7 @@ public class ScanTest {
}
if (ObjectUtils.isEmpty(result)) {
boolean tagExits = cls.isAnnotationPresent(Tag.class);
if (tagExits) {
Tag annotation = cls.getAnnotation(Tag.class);
result = annotation.name();
} else {
//自定义的controller 没有名称
result = "自定义api模块" + RandomUtil.randomInt(100);
}
resourceViewEntity.setName(result + "-查看");
resourceEditEntity.setName(result + "-维护");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment