介绍
<dependency>
<groupId>cn.jdevelops</groupId>
<artifactId>webs-springs</artifactId>
<version>2.0.5</version>
</dependency>
使用
引入依赖之后直接在controller中使用就行
UrlService
import cn.jdevelops.annotation.mapping.PathRestController; import cn.jdevelops.result.result.ResultVO; import cn.jdevelops.springs.service.url.UrlService; import cn.jdevelops.springs.service.url.entity.Urls; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping;
import java.util.*; import java.util.stream.Collectors;
/**
- 工具接口 *
- @author tnnn
- @version V1.0
@date 2022-07-20 09:08 */ @PathRestController(“url”) @Slf4j @Api(tags = “工具接口”, value = “工具接口”) @RequiredArgsConstructor @ApiSupport(order = 7) public class UrlController {
private final UrlService urlService;
@ApiOperation(value = “获取所有的接口”, notes = “工具接口”) @GetMapping(“/getAll”) public ResultVO
List<Urls> localUrl = urlService.getLocalUrl();
List<Urls> resultUrl = localUrl.stream().distinct().collect(Collectors.toList());
Map<String, List<Urls>> resultUrlMap = resultUrl.stream().collect(Collectors.groupingBy(Urls::getGrouping));
return ResultVO.success(resultUrlMap,"接口总数:"+resultUrl.size());
}
}
<a name="BTBfO"></a>
## 配置
<a name="kSc1j"></a>
### 设置不需要获取的url
> ** 表示多级
```yaml
jdevelops:
web:
geturl:
exclude-path-patterns:
- /swagger-resources/**