Skip to content

Commit aeb161a

Browse files
authored
Merge pull request #84 from dromara/dev
Dev
2 parents c793ebf + 5ecb476 commit aeb161a

File tree

1,052 files changed

+7074
-4515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,052 files changed

+7074
-4515
lines changed

docker/adminer/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/bin/bash
2-
version=2.2.3
2+
version=2.3.0
33
docker build -t orion-visor-adminer:${version} .
44
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
55
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest

docker/mysql/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/bin/bash
2-
version=2.2.3
2+
version=2.3.0
33
cp -r ../../sql ./sql
44
docker build -t orion-visor-mysql:${version} .
55
rm -rf ./sql

docker/push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/bin/bash
2-
version=2.2.3
2+
version=2.3.0
33
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
44
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:${version}
55
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version}

docker/redis/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/bin/bash
2-
version=2.2.3
2+
version=2.3.0
33
docker build -t orion-visor-redis:${version} .
44
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version}
55
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest

docker/service/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/bin/bash
2-
version=2.2.3
2+
version=2.3.0
33
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
44
mv ../../orion-visor-ui/dist ./dist
55
docker build --no-cache -t orion-visor-service:${version} .
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
66
<groupId>org.dromara.visor</groupId>
7-
<artifactId>orion-visor-framework</artifactId>
7+
<artifactId>orion-visor</artifactId>
88
<version>${revision}</version>
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12-
<artifactId>orion-visor-framework-common</artifactId>
12+
<artifactId>orion-visor-common</artifactId>
1313
<name>${project.artifactId}</name>
1414
<packaging>jar</packaging>
1515

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (c) 2023 - present Dromara, All rights reserved.
3+
*
4+
* https://visor.dromara.org
5+
* https://visor.dromara.org.cn
6+
* https://visor.orionsec.cn
7+
*
8+
* Members:
9+
* Jiahang Li - [email protected] - author
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
*/
23+
package org.dromara.visor.common.config;
24+
25+
import lombok.extern.slf4j.Slf4j;
26+
27+
import java.util.function.BiConsumer;
28+
import java.util.function.Function;
29+
30+
/**
31+
* 配置引用
32+
*
33+
* @author Jiahang Li
34+
* @version 1.0.0
35+
* @since 2025/1/6 18:01
36+
*/
37+
@Slf4j
38+
public abstract class ConfigRef<T> {
39+
40+
public final String key;
41+
42+
public T value;
43+
44+
protected final Function<String, T> convert;
45+
46+
public ConfigRef(String key, Function<String, T> convert) {
47+
this.key = key;
48+
this.convert = convert;
49+
}
50+
51+
/**
52+
* 覆盖配置
53+
*
54+
* @param value value
55+
*/
56+
public abstract void override(String value);
57+
58+
/**
59+
* 修改配置
60+
*
61+
* @param value value
62+
*/
63+
public abstract void set(T value);
64+
65+
/**
66+
* 获取配置
67+
*
68+
* @return value
69+
*/
70+
public abstract T get();
71+
72+
/**
73+
* 修改回调
74+
*
75+
* @param changeEvent changeEvent
76+
* @return this
77+
*/
78+
public abstract ConfigRef<T> onChange(BiConsumer<T, T> changeEvent);
79+
80+
}
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
/*
2+
* Copyright (c) 2023 - present Dromara, All rights reserved.
3+
*
4+
* https://visor.dromara.org
5+
* https://visor.dromara.org.cn
6+
* https://visor.orionsec.cn
7+
*
8+
* Members:
9+
* Jiahang Li - [email protected] - author
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
*/
23+
package org.dromara.visor.common.config;
24+
25+
import java.util.function.Function;
26+
27+
/**
28+
* 配置中心
29+
*
30+
* @author Jiahang Li
31+
* @version 1.0.0
32+
* @since 2025/1/5 21:30
33+
*/
34+
public interface ConfigStore {
35+
36+
/**
37+
* 获取 string 配置
38+
*
39+
* @param key key
40+
* @return config
41+
*/
42+
String getString(String key);
43+
44+
/**
45+
* 获取 string 配置
46+
*
47+
* @param key key
48+
* @param defaultValue defaultValue
49+
* @return config
50+
*/
51+
String getString(String key, String defaultValue);
52+
53+
/**
54+
* 获取 int 配置
55+
*
56+
* @param key key
57+
* @return config
58+
*/
59+
Integer getInteger(String key);
60+
61+
/**
62+
* 获取 int 配置
63+
*
64+
* @param key key
65+
* @param defaultValue defaultValue
66+
* @return config
67+
*/
68+
Integer getInteger(String key, Integer defaultValue);
69+
70+
/**
71+
* 获取 long 配置
72+
*
73+
* @param key key
74+
* @return config
75+
*/
76+
Long getLong(String key);
77+
78+
/**
79+
* 获取 long 配置
80+
*
81+
* @param key key
82+
* @param defaultValue defaultValue
83+
* @return config
84+
*/
85+
Long getLong(String key, Long defaultValue);
86+
87+
/**
88+
* 获取 double 配置
89+
*
90+
* @param key key
91+
* @return config
92+
*/
93+
Double getDouble(String key);
94+
95+
/**
96+
* 获取 double 配置
97+
*
98+
* @param key key
99+
* @param defaultValue defaultValue
100+
* @return config
101+
*/
102+
Double getDouble(String key, Double defaultValue);
103+
104+
/**
105+
* 获取 boolean 配置
106+
*
107+
* @param key key
108+
* @return config
109+
*/
110+
Boolean getBoolean(String key);
111+
112+
/**
113+
* 获取 boolean 配置
114+
*
115+
* @param key key
116+
* @param defaultValue defaultValue
117+
* @return config
118+
*/
119+
Boolean getBoolean(String key, Boolean defaultValue);
120+
121+
/**
122+
* 获取配置
123+
*
124+
* @param key key
125+
* @return conf
126+
*/
127+
String getConfig(String key);
128+
129+
/**
130+
* 获取配置
131+
*
132+
* @param key key
133+
* @param defaultValue defaultValue
134+
* @return conf
135+
*/
136+
String getConfig(String key, String defaultValue);
137+
138+
/**
139+
* 获取配置
140+
*
141+
* @param key key
142+
* @param convert convert
143+
* @param <T> T
144+
* @return conf
145+
*/
146+
<T> T getConfig(String key, Function<String, T> convert);
147+
148+
/**
149+
* 获取配置
150+
*
151+
* @param key key
152+
* @param convert convert
153+
* @param defaultValue defaultValue
154+
* @param <T> T
155+
* @return conf
156+
*/
157+
<T> T getConfig(String key, Function<String, T> convert, T defaultValue);
158+
159+
/**
160+
* 获取 string 配置
161+
*
162+
* @param key key
163+
* @return ref
164+
*/
165+
ConfigRef<String> string(String key);
166+
167+
/**
168+
* 获取 string 配置
169+
*
170+
* @param key key
171+
* @param defaultValue defaultValue
172+
* @return ref
173+
*/
174+
ConfigRef<String> string(String key, String defaultValue);
175+
176+
/**
177+
* 获取 int 配置
178+
*
179+
* @param key key
180+
* @return ref
181+
*/
182+
ConfigRef<Integer> int32(String key);
183+
184+
/**
185+
* 获取 int 配置
186+
*
187+
* @param key key
188+
* @param defaultValue defaultValue
189+
* @return ref
190+
*/
191+
ConfigRef<Integer> int32(String key, Integer defaultValue);
192+
193+
/**
194+
* 获取 long 配置
195+
*
196+
* @param key key
197+
* @return ref
198+
*/
199+
ConfigRef<Long> int64(String key);
200+
201+
/**
202+
* 获取 long 配置
203+
*
204+
* @param key key
205+
* @param defaultValue defaultValue
206+
* @return ref
207+
*/
208+
ConfigRef<Long> int64(String key, Long defaultValue);
209+
210+
/**
211+
* 获取 double 配置
212+
*
213+
* @param key key
214+
* @return ref
215+
*/
216+
ConfigRef<Double> float64(String key);
217+
218+
/**
219+
* 获取 double 配置
220+
*
221+
* @param key key
222+
* @param defaultValue defaultValue
223+
* @return ref
224+
*/
225+
ConfigRef<Double> float64(String key, Double defaultValue);
226+
227+
/**
228+
* 获取 boolean 配置
229+
*
230+
* @param key key
231+
* @return ref
232+
*/
233+
ConfigRef<Boolean> bool(String key);
234+
235+
/**
236+
* 获取 boolean 配置
237+
*
238+
* @param key key
239+
* @param defaultValue defaultValue
240+
* @return ref
241+
*/
242+
ConfigRef<Boolean> bool(String key, Boolean defaultValue);
243+
244+
/**
245+
* 获取配置
246+
*
247+
* @param key key
248+
* @param convert convert
249+
* @param <T> T
250+
* @return ref
251+
*/
252+
<T> ConfigRef<T> ref(String key, Function<String, T> convert);
253+
254+
/**
255+
* 获取配置
256+
*
257+
* @param key key
258+
* @param convert convert
259+
* @param defaultValue defaultValue
260+
* @param <T> T
261+
* @return ref
262+
*/
263+
<T> ConfigRef<T> ref(String key, Function<String, T> convert, T defaultValue);
264+
265+
}

0 commit comments

Comments
 (0)