Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
86ff61e9
Commit
86ff61e9
authored
May 18, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表结构修改
parent
d909b18e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
75 deletions
+3
-75
PlanLevelNamespaceProgram.java
...om.yanzuoguang.redis/level/PlanLevelNamespaceProgram.java
+0
-36
PlanLevelNamespaceServerIp.java
...m.yanzuoguang.redis/level/PlanLevelNamespaceServerIp.java
+0
-24
PlanConsumer.java
.../src/main/java/com.yanzuoguang.redis/mq/PlanConsumer.java
+2
-6
PlanLevelType.java
...src/main/java/com.yanzuoguang.redis/vo/PlanLevelType.java
+1
-9
No files found.
yzg-util-redis/src/main/java/com.yanzuoguang.redis/level/PlanLevelNamespaceProgram.java
deleted
100644 → 0
View file @
d909b18e
package
com
.
yanzuoguang
.
redis
.
level
;
import
com.yanzuoguang.redis.PlanLevelNamespaceDefault
;
import
com.yanzuoguang.redis.vo.PlanLevelType
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
org.springframework.stereotype.Component
;
/**
* 程序级别
*
* @author 颜佐光
*/
@Component
public
class
PlanLevelNamespaceProgram
implements
PlanLevelNamespaceDefault
{
private
final
PlanLevelNamespaceServerIp
planLevelNamespaceServerIp
;
private
final
PlanLevelNamespaceApplication
planLevelNamespaceApplication
;
public
PlanLevelNamespaceProgram
(
PlanLevelNamespaceServerIp
planLevelNamespaceServerIp
,
PlanLevelNamespaceApplication
planLevelNamespaceApplication
)
{
this
.
planLevelNamespaceServerIp
=
planLevelNamespaceServerIp
;
this
.
planLevelNamespaceApplication
=
planLevelNamespaceApplication
;
}
@Override
public
String
getLevelNamespace
()
{
return
StringHelper
.
getId
(
planLevelNamespaceServerIp
.
getLevelNamespace
(),
planLevelNamespaceApplication
.
getLevelNamespace
()
);
}
@Override
public
PlanLevelType
getLevel
()
{
return
PlanLevelType
.
Program
;
}
}
yzg-util-redis/src/main/java/com.yanzuoguang.redis/level/PlanLevelNamespaceServerIp.java
deleted
100644 → 0
View file @
d909b18e
package
com
.
yanzuoguang
.
redis
.
level
;
import
com.yanzuoguang.redis.PlanLevelNamespaceDefault
;
import
com.yanzuoguang.redis.vo.PlanLevelType
;
import
com.yanzuoguang.util.helper.UrlHelper
;
import
org.springframework.stereotype.Component
;
/**
* 服务器Ip级别
*
* @author 颜佐光
*/
@Component
public
class
PlanLevelNamespaceServerIp
implements
PlanLevelNamespaceDefault
{
@Override
public
String
getLevelNamespace
()
{
return
UrlHelper
.
getIp
();
}
@Override
public
PlanLevelType
getLevel
()
{
return
PlanLevelType
.
ServerIp
;
}
}
yzg-util-redis/src/main/java/com.yanzuoguang.redis/mq/PlanConsumer.java
View file @
86ff61e9
...
...
@@ -32,15 +32,11 @@ public class PlanConsumer {
* @param channel 连接频道
*/
public
void
plan
(
String
json
,
Message
message
,
Channel
channel
)
{
try
{
mqService
.
basicHandle
(
message
,
channel
,
json
,
content
->
{
PlanInfo
<
String
>
timeNew
=
JsonHelper
.
deserialize
(
json
,
new
TypeReference
<
PlanInfo
<
String
>>()
{
});
// 获取运行的任务
planService
.
runPlan
(
timeNew
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
finally
{
mqService
.
basicAck
(
message
,
channel
);
}
});
}
}
yzg-util-redis/src/main/java/com.yanzuoguang.redis/vo/PlanLevelType.java
View file @
86ff61e9
...
...
@@ -15,14 +15,6 @@ public enum PlanLevelType {
* SpringBoot同Application.Name 级别
*/
Application
(
"Application"
,
1
),
/**
* 同一个程序级别
*/
ServerIp
(
"ServerIp"
,
2
),
/**
* 同一个程序级别
*/
Program
(
"Program"
,
3
),
/**
* 自定义级别,
* 自定义需要任务实现 PlanLevelNamespace 接口,
...
...
@@ -45,7 +37,7 @@ public enum PlanLevelType {
* @param name 名称
* @param id id
*/
private
PlanLevelType
(
String
name
,
int
id
)
{
PlanLevelType
(
String
name
,
int
id
)
{
this
.
name
=
name
;
this
.
id
=
id
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment