简述
本文中,将使用spring boot
来构建服务,使用swagger2来提供api ui。最终部署到linux下tomcat中。
Nothing is true, everthing is permitted
Settings Sync
One Monokai Theme/Monokai Operator/Monokai Pro
GitLens
GitHub Copilot
C/C++
Codeium
Go
Jupyter
Python
Extension Pack for Java
Tabnine
String Manipulation
Bracket Pair Colorizer/Rainbow Brackets
Todo Tree
Vim
insertCursorAtEndOfEachLineSelected:选中多行,添加光标至行末
Select All Occurrences of Find Match:选中文本,光标选中所有匹配文本
showActiveFileInExplorer:在explorer中定位当前文件
Alibaba Cloud AI Coding Assistant
Alibaba Java Coding Guidelines/CheckStyle/SonarLint
Codeium/CodeGeex/通义灵码
DubboTest
Lombok
MybatisX
Maven Helper
Monokai Pro Theme/Material Theme UI
PlantUML integration
Rainbow Brackets
RestfulTool
Save Actions
String Manipulation
Tabnine
删除C:\Users\****\AppData\Roaming\JetBrains\GoLand2021.2\eval
中文件即可
对于mac, 其地址是~/Library/Application Support/JetBrains/GoLand2021.2/eval
问题:有些区域直属于省,但其区域编码按层级又在市级别以下,如何正确获取这些区域的名称
方案:递归查找时,标识是否找到,若找到才倒序插入列表1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51<html>
<head>
<script type="text/javascript">
var list = [];
var data = [{
value: "51",
children: [{
value: "5101",
children: [{
value: "510104",
children: []
}]
}]
}, {
value: "61",
children: [{
value: "6101",
children: [{
value: "610101",
children: []
}]
}, {
value: "610194",
children: [{
value: "61019401",
children: []
}]
}]
}];
var selectedValue = "61019401";
var got = false;
var find = function (item) {
if (selectedValue.startsWith(item.value)) {
if(item.children && item.children.length > 0) {
for (var j = 0; j < item.children.length; j++) {
find(item.children[j])
}
}
if (selectedValue == item.value) got = true
if (got) {
list.push(item);
}
}
}
find(data);
console.log(list);
</script>
</head>
</html>
1 | private static List<dynamic> GetAreaList(List<QR_Area> areaList, int type, string code = "86") |
构建组织1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17private static dynamic ConstructContractor(List<SimpleContractor> list)
{
if (list == null || list.Count == 0) return null;
var l = list;
var top = l[0];
if (l.Count > 1)
{
l.RemoveAt(0);
var groups = l.GroupBy(c => c.C.Substring(0, top.C.Length + 4));
return new { Code = top.C, Name = top.N, Children = groups.Select(g => {
var sub = g.ToList().OrderBy(c => c.C.Length).OrderBy(c => c.C).ToList();
if (sub[0].C.Length > top.C.Length + 4) return null;
return ConstructContractor(sub);
}).Where(x => x != null).ToList() };
}
return new { Code = top.C, Name = top.N };
}
获取组织1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18private static dynamic GetContractor(dynamic contractor, string code)
{
if (contractor.Code.Equals(code)) return contractor;
if (code.StartsWith(contractor.Code))
{
if (contractor.Children != null && contractor.Children.Count > 0)
{
for (var i = 0; i < contractor.Children.Count; i++)
{
var result = GetContractor(contractor.Children[i], code);
if (result != null) return result;
}
}
}
return null;
}
1 | func findDepth(s string) int { |
1 | input: (1+2+(1*2)(1+2)) |
1 | func getKMax(s []int, k int) int { |
1 | input: [10,9,8,7,6,5,4,3,2,1], 3 |
sh VBoxLinuxAdditions.run
,