正在显示
69 个修改的文件
包含
6918 行增加
和
0 行删除
.gitignore
0 → 100644
1 | +HELP.md | ||
2 | +target/ | ||
3 | +!.mvn/wrapper/maven-wrapper.jar | ||
4 | +!**/src/main/** | ||
5 | +!**/src/test/** | ||
6 | + | ||
7 | +### STS ### | ||
8 | +.apt_generated | ||
9 | +.classpath | ||
10 | +.factorypath | ||
11 | +.project | ||
12 | +.settings | ||
13 | +.springBeans | ||
14 | +.sts4-cache | ||
15 | + | ||
16 | +### IntelliJ IDEA ### | ||
17 | +.idea | ||
18 | +*.iws | ||
19 | +*.iml | ||
20 | +*.ipr | ||
21 | + | ||
22 | +### NetBeans ### | ||
23 | +/nbproject/private/ | ||
24 | +/nbbuild/ | ||
25 | +/dist/ | ||
26 | +/nbdist/ | ||
27 | +/.nb-gradle/ | ||
28 | +build/ | ||
29 | + | ||
30 | +### VS Code ### | ||
31 | +.vscode/ |
config/application.yml
0 → 100644
1 | +server: | ||
2 | + port: 9030 | ||
3 | + | ||
4 | +# spring 配置 | ||
5 | +spring: | ||
6 | + application: | ||
7 | + name: message-bus-service | ||
8 | + | ||
9 | + # 数据源配置 | ||
10 | + datasource: | ||
11 | + type: com.alibaba.druid.pool.DruidDataSource | ||
12 | + driver-class-name: com.mysql.cj.jdbc.Driver | ||
13 | + url: jdbc:mysql://118.31.66.166:3306/bus_service?characterEncoding=utf8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true | ||
14 | + username: 110 | ||
15 | + password: QAHqCJf2kFYCLirM | ||
16 | + | ||
17 | + # rabbitmq配置 | ||
18 | + rabbitmq: | ||
19 | + host: 192.168.1.63 | ||
20 | + port: 5672 | ||
21 | + username: mrz | ||
22 | + password: vmvnv1v2 | ||
23 | + | ||
24 | + # 多环境配置 | ||
25 | + profiles: | ||
26 | + active: dev | ||
27 | + | ||
28 | + # Jackson配置 | ||
29 | + jackson: | ||
30 | + default-property-inclusion: ALWAYS | ||
31 | + time-zone: GMT+8 | ||
32 | + date-format: yyyy-MM-dd HH:mm:ss | ||
33 | + # Spring Security配置 | ||
34 | + security: | ||
35 | + user: | ||
36 | + name: admin | ||
37 | + password: 123456 | ||
38 | + | ||
39 | + # zipkin 链路追踪配置 | ||
40 | + zipkin: | ||
41 | + base-url: http://192.168.1.63:9411 | ||
42 | + sleuth: | ||
43 | + sampler: | ||
44 | + probability: 1 | ||
45 | + | ||
46 | +# mybatis 配置 | ||
47 | +mybatis: | ||
48 | + mapper-locations: classpath:mapper/*.xml | ||
49 | + type-aliases-package: com.sunyo.wlpt.message.bus.service.domain | ||
50 | + | ||
51 | +# 日志配置 | ||
52 | +logging: | ||
53 | + config: config/logback-dev.xml | ||
54 | + level: | ||
55 | + com.sunyo.wlpt.message.bus.service.mapper: debug | ||
56 | +logback: | ||
57 | + appname: message-bus-service | ||
58 | + logdir: ./log | ||
59 | + | ||
60 | +#eureka 配置 | ||
61 | +eureka: | ||
62 | + instance: | ||
63 | + status-page-url: http://${eureka.instance.hostname}:${server.port}/index | ||
64 | + prefer-ip-address: true | ||
65 | + instance-id: ${spring.cloud.client.ip-address}:${server.port} | ||
66 | + hostname: ${spring.cloud.client.ip-address} | ||
67 | + metadata-map: | ||
68 | + user: | ||
69 | + name: "admin" | ||
70 | + password: "123456" | ||
71 | + client: | ||
72 | + healthcheck: | ||
73 | + enabled: true | ||
74 | + service-url: | ||
75 | + defaultZone: http://192.168.1.53:12345/eureka/ | ||
76 | + | ||
77 | +# boot admin | ||
78 | +management: | ||
79 | + endpoints: | ||
80 | + enabled-by-default: true | ||
81 | + web: | ||
82 | + exposure: | ||
83 | + include: "*" | ||
84 | + endpoint: | ||
85 | + health: | ||
86 | + show-details: always | ||
87 | + shutdown: | ||
88 | + enabled: true | ||
89 | + | ||
90 | +# 基础信息配置 | ||
91 | +info: | ||
92 | + version: 1.0 | ||
93 | + description: "消息平台服务" |
config/logback-dev.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132--> | ||
3 | +<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> | ||
4 | +<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> | ||
5 | +<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> | ||
6 | +<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> | ||
7 | +<configuration scan="true" scanPeriod="10 seconds"> | ||
8 | + | ||
9 | + <!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> | ||
10 | + | ||
11 | + <contextName>logback</contextName> | ||
12 | + <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> | ||
13 | + <property name="log.path" value="./logs" /> | ||
14 | + | ||
15 | + <!-- 彩色日志 --> | ||
16 | + <!-- 彩色日志依赖的渲染类 --> | ||
17 | + <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> | ||
18 | + <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> | ||
19 | + <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> | ||
20 | + <!-- 彩色日志格式 --> | ||
21 | + <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> | ||
22 | + | ||
23 | + | ||
24 | + <!--输出到控制台--> | ||
25 | + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
26 | + <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> | ||
27 | + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
28 | + <level>debug</level> | ||
29 | + </filter> | ||
30 | + <encoder> | ||
31 | + <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> | ||
32 | + <!-- 设置字符集 windows系统这里设置成GBK--> | ||
33 | + <charset>UTF-8</charset> | ||
34 | + </encoder> | ||
35 | + </appender> | ||
36 | + | ||
37 | + | ||
38 | + <!--输出到文件--> | ||
39 | + | ||
40 | + <!-- 时间滚动输出 level为 DEBUG 日志 --> | ||
41 | + <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
42 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
43 | + <file>${log.path}/log_debug.log</file> | ||
44 | + <!--日志文件输出格式--> | ||
45 | + <encoder> | ||
46 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
47 | + <charset>UTF-8</charset> <!-- 设置字符集 --> | ||
48 | + </encoder> | ||
49 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
50 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
51 | + <!-- 日志归档 --> | ||
52 | + <fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
53 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
54 | + <maxFileSize>100MB</maxFileSize> | ||
55 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
56 | + <!--日志文件保留天数--> | ||
57 | + <maxHistory>15</maxHistory> | ||
58 | + </rollingPolicy> | ||
59 | + <!-- 此日志文件只记录debug级别的 --> | ||
60 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
61 | + <level>debug</level> | ||
62 | + <onMatch>ACCEPT</onMatch> | ||
63 | + <onMismatch>DENY</onMismatch> | ||
64 | + </filter> | ||
65 | + </appender> | ||
66 | + | ||
67 | + <!-- 时间滚动输出 level为 INFO 日志 --> | ||
68 | + <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
69 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
70 | + <file>${log.path}/log_info.log</file> | ||
71 | + <!--日志文件输出格式--> | ||
72 | + <encoder> | ||
73 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
74 | + <charset>UTF-8</charset> | ||
75 | + </encoder> | ||
76 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
77 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
78 | + <!-- 每天日志归档路径以及格式 --> | ||
79 | + <fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
80 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
81 | + <maxFileSize>100MB</maxFileSize> | ||
82 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
83 | + <!--日志文件保留天数--> | ||
84 | + <maxHistory>15</maxHistory> | ||
85 | + </rollingPolicy> | ||
86 | + <!-- 此日志文件只记录info级别的 --> | ||
87 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
88 | + <level>info</level> | ||
89 | + <onMatch>ACCEPT</onMatch> | ||
90 | + <onMismatch>DENY</onMismatch> | ||
91 | + </filter> | ||
92 | + </appender> | ||
93 | + | ||
94 | + <!-- 时间滚动输出 level为 WARN 日志 --> | ||
95 | + <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
96 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
97 | + <file>${log.path}/log_warn.log</file> | ||
98 | + <!--日志文件输出格式--> | ||
99 | + <encoder> | ||
100 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
101 | + <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
102 | + </encoder> | ||
103 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
104 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
105 | + <fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
106 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
107 | + <maxFileSize>100MB</maxFileSize> | ||
108 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
109 | + <!--日志文件保留天数--> | ||
110 | + <maxHistory>15</maxHistory> | ||
111 | + </rollingPolicy> | ||
112 | + <!-- 此日志文件只记录warn级别的 --> | ||
113 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
114 | + <level>warn</level> | ||
115 | + <onMatch>ACCEPT</onMatch> | ||
116 | + <onMismatch>DENY</onMismatch> | ||
117 | + </filter> | ||
118 | + </appender> | ||
119 | + | ||
120 | + | ||
121 | + <!-- 时间滚动输出 level为 ERROR 日志 --> | ||
122 | + <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
123 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
124 | + <file>${log.path}/log_error.log</file> | ||
125 | + <!--日志文件输出格式--> | ||
126 | + <encoder> | ||
127 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
128 | + <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
129 | + </encoder> | ||
130 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
131 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
132 | + <fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
133 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
134 | + <maxFileSize>100MB</maxFileSize> | ||
135 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
136 | + <!--日志文件保留天数--> | ||
137 | + <maxHistory>15</maxHistory> | ||
138 | + </rollingPolicy> | ||
139 | + <!-- 此日志文件只记录ERROR级别的 --> | ||
140 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
141 | + <level>ERROR</level> | ||
142 | + <onMatch>ACCEPT</onMatch> | ||
143 | + <onMismatch>DENY</onMismatch> | ||
144 | + </filter> | ||
145 | + </appender> | ||
146 | + | ||
147 | + <!-- 时间滚动输出 level为 trace 日志 --> | ||
148 | + <appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
149 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
150 | + <file>${log.path}/log_trace.log</file> | ||
151 | + <!--日志文件输出格式--> | ||
152 | + <encoder> | ||
153 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
154 | + <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
155 | + </encoder> | ||
156 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
157 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
158 | + <fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
159 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
160 | + <maxFileSize>100MB</maxFileSize> | ||
161 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
162 | + <!--日志文件保留天数--> | ||
163 | + <maxHistory>15</maxHistory> | ||
164 | + </rollingPolicy> | ||
165 | + <!-- 此日志文件只记录trace级别的 --> | ||
166 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
167 | + <level>TRACE</level> | ||
168 | + <onMatch>ACCEPT</onMatch> | ||
169 | + <onMismatch>DENY</onMismatch> | ||
170 | + </filter> | ||
171 | + </appender> | ||
172 | + | ||
173 | + | ||
174 | + <!-- | ||
175 | + <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 | ||
176 | + 以及指定<appender>。<logger>仅有一个name属性, | ||
177 | + 一个可选的level和一个可选的addtivity属性。 | ||
178 | + name:用来指定受此logger约束的某一个包或者具体的某一个类。 | ||
179 | + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, | ||
180 | + 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 | ||
181 | + 如果未设置此属性,那么当前logger将会继承上级的级别。 | ||
182 | + addtivity:是否向上级logger传递打印信息。默认是true。 | ||
183 | + --> | ||
184 | + <!--<logger name="org.springframework.web" level="info"/>--> | ||
185 | + <!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> | ||
186 | + <!-- | ||
187 | + 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: | ||
188 | + 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 | ||
189 | + 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: | ||
190 | + --> | ||
191 | + | ||
192 | + | ||
193 | + <!-- | ||
194 | + root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 | ||
195 | + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, | ||
196 | + 不能设置为INHERITED或者同义词NULL。默认是DEBUG | ||
197 | + 可以包含零个或多个元素,标识这个appender将会添加到这个logger。 | ||
198 | + --> | ||
199 | + <!--<logger name="com.tianbo.analysis" level="trace">--> | ||
200 | + <!--<appender-ref ref="CONSOLE" />--> | ||
201 | + <!--<appender-ref ref="TRACE_FILE" />--> | ||
202 | + <!--<appender-ref ref="DEBUG_FILE" />--> | ||
203 | + <!--<appender-ref ref="INFO_FILE" />--> | ||
204 | + <!--<appender-ref ref="WARN_FILE" />--> | ||
205 | + <!--<appender-ref ref="ERROR_FILE" />--> | ||
206 | + <!--</logger>--> | ||
207 | + | ||
208 | + <!--开发环境:打印控制台--> | ||
209 | + <springProfile name="dev"> | ||
210 | + <logger name="org.springframework" level="info"/> | ||
211 | + <logger name="com.sunyo.wlpt.nmms.mapper" level="debug"> | ||
212 | + <appender-ref ref="CONSOLE" /> | ||
213 | + <appender-ref ref="DEBUG_FILE" /> | ||
214 | + </logger> | ||
215 | + <logger name="org.apache.tomcat" level="info" /> | ||
216 | + <root level="info"> | ||
217 | + <appender-ref ref="CONSOLE" /> | ||
218 | + <appender-ref ref="TRACE_FILE" /> | ||
219 | + <appender-ref ref="DEBUG_FILE" /> | ||
220 | + <appender-ref ref="INFO_FILE" /> | ||
221 | + <appender-ref ref="WARN_FILE" /> | ||
222 | + <appender-ref ref="ERROR_FILE" /> | ||
223 | + </root> | ||
224 | + </springProfile> | ||
225 | + | ||
226 | + <!--生产环境:输出到文件--> | ||
227 | + <springProfile name="pro"> | ||
228 | + <logger name="org.springframework" level="INFO"/> | ||
229 | + <root level="info"> | ||
230 | + <appender-ref ref="CONSOLE" /> | ||
231 | + <appender-ref ref="DEBUG_FILE" /> | ||
232 | + <appender-ref ref="INFO_FILE" /> | ||
233 | + <appender-ref ref="ERROR_FILE" /> | ||
234 | + <appender-ref ref="WARN_FILE" /> | ||
235 | + <appender-ref ref="TRACE_FILE" /> | ||
236 | + </root> | ||
237 | + </springProfile> | ||
238 | + | ||
239 | +</configuration> |
config/logback-spring.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<configuration scan="ture" scanPeriod="60 seconds" debug="false"> | ||
3 | + | ||
4 | + <springProperty scope="context" name="appname" source="logback.appname"/> | ||
5 | + <springProperty scope="context" name="logdir" source="logback.logdir"/> | ||
6 | + <!--文件名--> | ||
7 | + <contextName>${appname}</contextName> | ||
8 | + | ||
9 | + <!--输出到控制面板--> | ||
10 | + <appender name="consoleLog1" class="ch.qos.logback.core.ConsoleAppender"> | ||
11 | + <!-- layout输出方式输出--> | ||
12 | + <layout class="ch.qos.logback.classic.PatternLayout"> | ||
13 | + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
14 | + </layout> | ||
15 | + </appender> | ||
16 | + <!--输出到控制面板--> | ||
17 | + <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"> | ||
18 | + <encoder> | ||
19 | + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
20 | + </encoder> | ||
21 | + </appender> | ||
22 | + <!--输出info级别日志--> | ||
23 | + <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
24 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
25 | + <!--过滤 Error--> | ||
26 | + <level>ERROR</level> | ||
27 | + <!--匹配到就禁止--> | ||
28 | + <onMatch>DENY</onMatch> | ||
29 | + <!--没有匹配到就允许--> | ||
30 | + <onMismatch>ACCEPT</onMismatch> | ||
31 | + </filter> | ||
32 | + <!--<File>../logs</File>--> | ||
33 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
34 | + <FileNamePattern>${logdir}/info.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern> | ||
35 | + <maxHistory>100</maxHistory> | ||
36 | + <totalSizeCap>100MB</totalSizeCap> | ||
37 | + </rollingPolicy> | ||
38 | + <encoder> | ||
39 | + <charset>UTF-8</charset> | ||
40 | + <pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern> | ||
41 | + </encoder> | ||
42 | + </appender> | ||
43 | + <!--输出Error级别日志--> | ||
44 | + <!--<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">--> | ||
45 | + <!--<filter class="ch.qos.logback.classic.filter.LevelFilter">--> | ||
46 | + <!--<!–过滤 Error –>--> | ||
47 | + <!--<level>ERROR</level>--> | ||
48 | + <!--</filter>--> | ||
49 | + <!--<!–<File>../logs</File>–>--> | ||
50 | + <!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">--> | ||
51 | + <!--<FileNamePattern>${logdir}/error.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>--> | ||
52 | + <!--<maxHistory>100</maxHistory>--> | ||
53 | + <!--<totalSizeCap>100MB</totalSizeCap>--> | ||
54 | + <!--</rollingPolicy>--> | ||
55 | + <!--<encoder>--> | ||
56 | + <!--<charset>UTF-8</charset>--> | ||
57 | + <!--<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>--> | ||
58 | + <!--</encoder>--> | ||
59 | + <!--</appender>--> | ||
60 | + <!--监控下列类的所有日志,定义输出级别--> | ||
61 | + <logger name="java.sql.PreparedStatement" level="DEBUG" additivity="false"> | ||
62 | + <appender-ref ref="consoleLog"/> | ||
63 | + </logger> | ||
64 | + <logger name="java.sql.Connection" level="DEBUG" additivity="false"> | ||
65 | + <appender-ref ref="consoleLog"/> | ||
66 | + </logger> | ||
67 | + <logger name="java.sql.Statement" level="DEBUG" additivity="false"> | ||
68 | + <appender-ref ref="consoleLog"/> | ||
69 | + </logger> | ||
70 | + <logger name="com.ibatis" level="DEBUG" additivity="false"> | ||
71 | + <appender-ref ref="consoleLog"/> | ||
72 | + </logger> | ||
73 | + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" additivity="false"> | ||
74 | + <appender-ref ref="consoleLog"/> | ||
75 | + </logger> | ||
76 | + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" additivity="false"> | ||
77 | + <appender-ref ref="consoleLog"/> | ||
78 | + </logger> | ||
79 | + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" additivity="false"> | ||
80 | + <appender-ref ref="consoleLog"/> | ||
81 | + </logger> | ||
82 | + <!--输出--> | ||
83 | + <root level="INFO"> | ||
84 | + <appender-ref ref="consoleLog"/> | ||
85 | + <!--<appender-ref ref="consoleLog"/>--> | ||
86 | + <appender-ref ref="fileInfoLog"/> | ||
87 | + <!--<appender-ref ref="fileErrorLog"/>--> | ||
88 | + </root> | ||
89 | + | ||
90 | +</configuration> |
pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
4 | + <modelVersion>4.0.0</modelVersion> | ||
5 | + <groupId>com.sunyo.wlpt.message.bus.service</groupId> | ||
6 | + <artifactId>message_bus_service</artifactId> | ||
7 | + <version>0.0.1-SNAPSHOT</version> | ||
8 | + <name>message_bus_service</name> | ||
9 | + <description>消息总线服务</description> | ||
10 | + | ||
11 | + <properties> | ||
12 | + <java.version>1.8</java.version> | ||
13 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
14 | + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
15 | + <spring-boot.version>2.1.7.RELEASE</spring-boot.version> | ||
16 | + <spring-cloud.version>Greenwich.SR2</spring-cloud.version> | ||
17 | + </properties> | ||
18 | + | ||
19 | + <dependencies> | ||
20 | + <!-- SpringBoot start --> | ||
21 | + <dependency> | ||
22 | + <groupId>org.springframework.boot</groupId> | ||
23 | + <artifactId>spring-boot-starter-web</artifactId> | ||
24 | + </dependency> | ||
25 | + <dependency> | ||
26 | + <groupId>org.springframework.boot</groupId> | ||
27 | + <artifactId>spring-boot-starter</artifactId> | ||
28 | + </dependency> | ||
29 | + <dependency> | ||
30 | + <groupId>org.springframework.boot</groupId> | ||
31 | + <artifactId>spring-boot-starter-security</artifactId> | ||
32 | + </dependency> | ||
33 | + <dependency> | ||
34 | + <groupId>org.springframework.boot</groupId> | ||
35 | + <artifactId>spring-boot-starter-amqp</artifactId> | ||
36 | + </dependency> | ||
37 | + <!-- SpringBoot end --> | ||
38 | + <!-- SpringCloud start --> | ||
39 | + <dependency> | ||
40 | + <groupId>org.springframework.cloud</groupId> | ||
41 | + <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> | ||
42 | + </dependency> | ||
43 | + | ||
44 | + <dependency> | ||
45 | + <groupId>org.springframework.cloud</groupId> | ||
46 | + <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> | ||
47 | + </dependency> | ||
48 | + | ||
49 | + <dependency> | ||
50 | + <groupId>org.springframework.cloud</groupId> | ||
51 | + <artifactId>spring-cloud-starter-openfeign</artifactId> | ||
52 | + </dependency> | ||
53 | + | ||
54 | + <dependency> | ||
55 | + <groupId>org.springframework.cloud</groupId> | ||
56 | + <artifactId>spring-cloud-starter-zipkin</artifactId> | ||
57 | + </dependency> | ||
58 | + | ||
59 | + <dependency> | ||
60 | + <groupId>de.codecentric</groupId> | ||
61 | + <artifactId>spring-boot-admin-starter-client</artifactId> | ||
62 | + <version>2.2.0</version> | ||
63 | + </dependency> | ||
64 | + | ||
65 | + <dependency> | ||
66 | + <groupId>org.springframework.boot</groupId> | ||
67 | + <artifactId>spring-boot-starter-actuator</artifactId> | ||
68 | + </dependency> | ||
69 | + <!-- SpringCloud end --> | ||
70 | + <!-- database start --> | ||
71 | + <dependency> | ||
72 | + <groupId>org.mybatis.spring.boot</groupId> | ||
73 | + <artifactId>mybatis-spring-boot-starter</artifactId> | ||
74 | + <version>2.1.1</version> | ||
75 | + </dependency> | ||
76 | + | ||
77 | + <dependency> | ||
78 | + <groupId>mysql</groupId> | ||
79 | + <artifactId>mysql-connector-java</artifactId> | ||
80 | + <scope>runtime</scope> | ||
81 | + </dependency> | ||
82 | + | ||
83 | + <dependency> | ||
84 | + <groupId>com.github.pagehelper</groupId> | ||
85 | + <artifactId>pagehelper-spring-boot-starter</artifactId> | ||
86 | + <version>1.2.12</version> | ||
87 | + </dependency> | ||
88 | + | ||
89 | + <dependency> | ||
90 | + <groupId>com.alibaba</groupId> | ||
91 | + <artifactId>druid-spring-boot-starter</artifactId> | ||
92 | + <version>1.1.9</version> | ||
93 | + </dependency> | ||
94 | + <!-- database end --> | ||
95 | + <!-- tools start --> | ||
96 | + <dependency> | ||
97 | + <groupId>org.projectlombok</groupId> | ||
98 | + <artifactId>lombok</artifactId> | ||
99 | + <optional>true</optional> | ||
100 | + </dependency> | ||
101 | + | ||
102 | + <dependency> | ||
103 | + <groupId>log4j</groupId> | ||
104 | + <artifactId>log4j</artifactId> | ||
105 | + <version>1.2.17</version> | ||
106 | + </dependency> | ||
107 | + | ||
108 | + <dependency> | ||
109 | + <groupId>io.springfox</groupId> | ||
110 | + <artifactId>springfox-swagger2</artifactId> | ||
111 | + <version>2.9.2</version> | ||
112 | + </dependency> | ||
113 | + <dependency> | ||
114 | + <groupId>io.springfox</groupId> | ||
115 | + <artifactId>springfox-swagger-ui</artifactId> | ||
116 | + <version>2.9.2</version> | ||
117 | + </dependency> | ||
118 | + <dependency> | ||
119 | + <groupId>io.swagger</groupId> | ||
120 | + <artifactId>swagger-annotations</artifactId> | ||
121 | + <version>1.5.22</version> | ||
122 | + </dependency> | ||
123 | + <dependency> | ||
124 | + <groupId>io.swagger</groupId> | ||
125 | + <artifactId>swagger-models</artifactId> | ||
126 | + <version>1.5.22</version> | ||
127 | + </dependency> | ||
128 | + | ||
129 | + <dependency> | ||
130 | + <groupId>joda-time</groupId> | ||
131 | + <artifactId>joda-time</artifactId> | ||
132 | + <version>2.10.5</version> | ||
133 | + </dependency> | ||
134 | + | ||
135 | + <dependency> | ||
136 | + <groupId>org.apache.commons</groupId> | ||
137 | + <artifactId>commons-lang3</artifactId> | ||
138 | + <version>3.9</version> | ||
139 | + </dependency> | ||
140 | + | ||
141 | + <dependency> | ||
142 | + <groupId>org.springframework.boot</groupId> | ||
143 | + <artifactId>spring-boot-starter-test</artifactId> | ||
144 | + <scope>test</scope> | ||
145 | + </dependency> | ||
146 | + <!-- tools end --> | ||
147 | + </dependencies> | ||
148 | + | ||
149 | + <dependencyManagement> | ||
150 | + <dependencies> | ||
151 | + <dependency> | ||
152 | + <groupId>org.springframework.boot</groupId> | ||
153 | + <artifactId>spring-boot-dependencies</artifactId> | ||
154 | + <version>${spring-boot.version}</version> | ||
155 | + <type>pom</type> | ||
156 | + <scope>import</scope> | ||
157 | + </dependency> | ||
158 | + <dependency> | ||
159 | + <groupId>org.springframework.cloud</groupId> | ||
160 | + <artifactId>spring-cloud-dependencies</artifactId> | ||
161 | + <version>${spring-cloud.version}</version> | ||
162 | + <type>pom</type> | ||
163 | + <scope>import</scope> | ||
164 | + </dependency> | ||
165 | + </dependencies> | ||
166 | + </dependencyManagement> | ||
167 | + | ||
168 | + <build> | ||
169 | + <plugins> | ||
170 | + <plugin> | ||
171 | + <groupId>org.apache.maven.plugins</groupId> | ||
172 | + <artifactId>maven-compiler-plugin</artifactId> | ||
173 | + <configuration> | ||
174 | + <source>1.8</source> | ||
175 | + <target>1.8</target> | ||
176 | + <encoding>UTF-8</encoding> | ||
177 | + </configuration> | ||
178 | + </plugin> | ||
179 | + <plugin> | ||
180 | + <groupId>org.springframework.boot</groupId> | ||
181 | + <artifactId>spring-boot-maven-plugin</artifactId> | ||
182 | + </plugin> | ||
183 | + </plugins> | ||
184 | + </build> | ||
185 | + <repositories> | ||
186 | + <repository> | ||
187 | + <id>spring-milestone</id> | ||
188 | + <name>Spring Milestone</name> | ||
189 | + <url>https://repo.spring.io/milestone</url> | ||
190 | + <snapshots> | ||
191 | + <enabled>false</enabled> | ||
192 | + </snapshots> | ||
193 | + </repository> | ||
194 | + <repository> | ||
195 | + <id>spring-snapshot</id> | ||
196 | + <name>Spring Snapshot</name> | ||
197 | + <url>https://repo.spring.io/snapshot</url> | ||
198 | + <snapshots> | ||
199 | + <enabled>true</enabled> | ||
200 | + </snapshots> | ||
201 | + </repository> | ||
202 | + </repositories> | ||
203 | + | ||
204 | + <pluginRepositories> | ||
205 | + <pluginRepository> | ||
206 | + <id>spring-milestone</id> | ||
207 | + <name>Spring Milestone</name> | ||
208 | + <url>https://repo.spring.io/milestone</url> | ||
209 | + <snapshots> | ||
210 | + <enabled>false</enabled> | ||
211 | + </snapshots> | ||
212 | + </pluginRepository> | ||
213 | + <pluginRepository> | ||
214 | + <id>spring-snapshot</id> | ||
215 | + <name>Spring Snapshot</name> | ||
216 | + <url>https://repo.spring.io/snapshot</url> | ||
217 | + <snapshots> | ||
218 | + <enabled>true</enabled> | ||
219 | + </snapshots> | ||
220 | + </pluginRepository> | ||
221 | + </pluginRepositories> | ||
222 | +</project> |
1 | +package com.sunyo.wlpt.message.bus.service; | ||
2 | + | ||
3 | +import org.mybatis.spring.annotation.MapperScan; | ||
4 | +import org.springframework.boot.SpringApplication; | ||
5 | +import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
6 | +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | ||
7 | +import org.springframework.cloud.openfeign.EnableFeignClients; | ||
8 | +import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
9 | + | ||
10 | +/** | ||
11 | + * @author 子诚 | ||
12 | + */ | ||
13 | +@SpringBootApplication | ||
14 | +@MapperScan("com.sunyo.wlpt.message.bus.service.mapper") | ||
15 | +@EnableFeignClients | ||
16 | +@EnableEurekaClient | ||
17 | +@EnableTransactionManagement | ||
18 | +public class MessageBusServiceApplication { | ||
19 | + | ||
20 | + public static void main(String[] args) { | ||
21 | + SpringApplication.run(MessageBusServiceApplication.class, args); | ||
22 | + } | ||
23 | + | ||
24 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.config; | ||
2 | + | ||
3 | +import org.springframework.context.annotation.Configuration; | ||
4 | +import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
5 | +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
6 | +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description:SpringSecurity 权限配置框架 | ||
11 | + * 时间:2020/7/5 13:38 | ||
12 | + */ | ||
13 | +@EnableWebSecurity | ||
14 | +@Configuration | ||
15 | +public class SecurityConfig extends WebSecurityConfigurerAdapter { | ||
16 | + @Override | ||
17 | + protected void configure(HttpSecurity http) throws Exception { | ||
18 | + http.csrf().disable(); | ||
19 | + | ||
20 | + //http.authorizeRequests().antMatchers("/","/bus/**").permitAll().and().csrf().disable(); | ||
21 | + | ||
22 | + } | ||
23 | +} | ||
24 | + |
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
6 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
7 | +import com.sunyo.wlpt.message.bus.service.service.BusExchangeService; | ||
8 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
9 | +import org.springframework.web.bind.annotation.*; | ||
10 | + | ||
11 | +import javax.annotation.Resource; | ||
12 | +import java.util.List; | ||
13 | + | ||
14 | +/** | ||
15 | + * @author 子诚 | ||
16 | + * Description:关于MQ交换机的控制器 | ||
17 | + * 时间:2020/7/1 16:13 | ||
18 | + */ | ||
19 | +@CrossOrigin | ||
20 | +@RequestMapping("bus/exchange") | ||
21 | +@RestController | ||
22 | +public class BusExchangeController { | ||
23 | + | ||
24 | + @Resource | ||
25 | + private BusExchangeService busExchangeService; | ||
26 | + | ||
27 | + /** | ||
28 | + * 分页查询,交换机列表 | ||
29 | + * | ||
30 | + * @param exchangeName 交换机名称 | ||
31 | + * @param pageNum 当前页数 | ||
32 | + * @param pageSize 每页数量 | ||
33 | + * @return 成功返回交换机列表 | ||
34 | + */ | ||
35 | + @GetMapping("/list") | ||
36 | + public ResultJson<PageInfo> selectBusExchangeList( | ||
37 | + @RequestParam(value = "exchangeName", required = false) String exchangeName, | ||
38 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
39 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
40 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
41 | + BusExchange busExchange = new BusExchange(); | ||
42 | + // 获取参数,交换机名称 | ||
43 | + busExchange.setExchangeName(exchangeName); | ||
44 | + // 分页查询 | ||
45 | + PageInfo pageInfo = busExchangeService.selectBusExchangeList(busExchange, pageNum, pageSize); | ||
46 | + if (pageInfo.getTotal() > 0) { | ||
47 | + result.setCode("200"); | ||
48 | + result.setData(pageInfo); | ||
49 | + result.setMsg("查询MQ交换机列表,成功!"); | ||
50 | + } else { | ||
51 | + result.setCode("500"); | ||
52 | + result.setMsg("查询MQ交换机列表,失败!"); | ||
53 | + } | ||
54 | + return result; | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * 删除交换机 | ||
59 | + * | ||
60 | + * @param busExchange {@link BusExchange} | ||
61 | + * @return {@link ResultJson} | ||
62 | + */ | ||
63 | + @DeleteMapping("/delete") | ||
64 | + public ResultJson deleteBusExchange(@RequestBody BusExchange busExchange) { | ||
65 | + ResultJson result = new ResultJson<>(); | ||
66 | + int num = busExchangeService.deleteByPrimaryKey(busExchange.getId()); | ||
67 | + if (num > 0) { | ||
68 | + result.setCode("200"); | ||
69 | + result.setMsg("删除MQ交换机,成功"); | ||
70 | + } else { | ||
71 | + result.setCode("500"); | ||
72 | + result.setMsg("删除MQ交换机,失败"); | ||
73 | + } | ||
74 | + return result; | ||
75 | + } | ||
76 | + | ||
77 | + /** | ||
78 | + * 批量删除 | ||
79 | + * | ||
80 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
81 | + * @return {@link ResultJson} | ||
82 | + */ | ||
83 | + @GetMapping("/batchRemove") | ||
84 | + public ResultJson batchRemoveBusExchange(String ids) { | ||
85 | + ResultJson result = new ResultJson<>(); | ||
86 | + int num = busExchangeService.deleteByPrimaryKey(ids); | ||
87 | + if (num > 0) { | ||
88 | + result.setCode("200"); | ||
89 | + result.setMsg("批量删除交换机,成功!"); | ||
90 | + } else { | ||
91 | + result.setCode("500"); | ||
92 | + result.setMsg("批量删除交换机,失败!"); | ||
93 | + } | ||
94 | + return result; | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * 编辑交换机信息 | ||
99 | + * | ||
100 | + * @param busExchange {@link BusExchange} | ||
101 | + * @return {@link ResultJson} | ||
102 | + */ | ||
103 | + @PutMapping("/update") | ||
104 | + public ResultJson updateBusExchange(@RequestBody BusExchange busExchange) { | ||
105 | + | ||
106 | + // 先验证,修改好的核心信息(交换机名称)是否已存在 | ||
107 | + String message = validateBusExchange(busExchange); | ||
108 | + // 验证通过 | ||
109 | + if (message == null) { | ||
110 | + ResultJson result = new ResultJson<>(); | ||
111 | + int num = busExchangeService.updateByPrimaryKeySelective(busExchange); | ||
112 | + if (num > 0) { | ||
113 | + result.setCode("200"); | ||
114 | + result.setMsg("编辑交换机信息,成功"); | ||
115 | + } else { | ||
116 | + result.setCode("500"); | ||
117 | + result.setMsg("编辑交换机信息,失败"); | ||
118 | + } | ||
119 | + return result; | ||
120 | + } | ||
121 | + return new ResultJson("400", message != null ? message : "编辑交换机信息,失败!"); | ||
122 | + } | ||
123 | + | ||
124 | + /** | ||
125 | + * 新增交换机 | ||
126 | + * | ||
127 | + * @param busExchange {@link BusExchange} | ||
128 | + * @return {@link ResultJson} | ||
129 | + */ | ||
130 | + @PostMapping("/insert") | ||
131 | + public ResultJson insertBusExchange(@RequestBody BusExchange busExchange) { | ||
132 | + //先验证,增加的虚拟主机的核心信息(交换机名称)是否已存在 | ||
133 | + String message = validateBusExchange(busExchange); | ||
134 | + //验证通过 | ||
135 | + if (message == null) { | ||
136 | + ResultJson result = new ResultJson<>(); | ||
137 | + // 设置id | ||
138 | + busExchange.setId(IdUtils.generateId()); | ||
139 | + int num = busExchangeService.insertSelective(busExchange); | ||
140 | + if (num > 0) { | ||
141 | + result.setCode("200"); | ||
142 | + result.setMsg("添加交换机信息,成功!"); | ||
143 | + } else { | ||
144 | + result.setCode("500"); | ||
145 | + result.setMsg("添加交换机信息,失败!"); | ||
146 | + } | ||
147 | + return result; | ||
148 | + } | ||
149 | + return new ResultJson("400", message != null ? message : "添加交换机信息,失败!"); | ||
150 | + } | ||
151 | + | ||
152 | + | ||
153 | + /** | ||
154 | + * 校验交换机,添加和修改之前,是否已存在 | ||
155 | + * | ||
156 | + * @param busExchange {@link BusExchange} | ||
157 | + * @return 通过,无返回消息 | ||
158 | + */ | ||
159 | + private String validateBusExchange(BusExchange busExchange) { | ||
160 | + // 判断交换机名称,是否为空 | ||
161 | + if ("".equals(busExchange.getExchangeName()) || busExchange.getExchangeName() == null) { | ||
162 | + return "该交换机信息中,没有交换机名称"; | ||
163 | + } | ||
164 | + | ||
165 | + // 如果id不为空,则是 update 操作 | ||
166 | + if (busExchange.getId() != null && busExchange.getId().length() != 0) { | ||
167 | + // 根据 id 查询出原来的 消息队列 信息 | ||
168 | + BusExchange oldBusExchange = busExchangeService.selectByPrimaryKey(busExchange.getId()); | ||
169 | + // 如果修改后的 exchangeName,和原来的 exchangeName 不一致,则校验 该 exchangeName 是否已存在 | ||
170 | + if (!oldBusExchange.getExchangeName().equals(busExchange.getExchangeName())) { | ||
171 | + // 根据 exchangeName,进行查询校验 | ||
172 | + List<BusExchange> info = busExchangeService.validateBusExchange(busExchange); | ||
173 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
174 | + if (info.size() > 0) { | ||
175 | + return "该-交换机(交换机名称)-信息已存在,请谨慎输入"; | ||
176 | + } | ||
177 | + return null; | ||
178 | + } | ||
179 | + // exchangeName 一致,则代表着没有修改 exchangeName,校验通过 | ||
180 | + return null; | ||
181 | + } | ||
182 | + // 如果id为空,则是 insert 操作 | ||
183 | + else { | ||
184 | + // 根据 exchangeName,进行查询校验 | ||
185 | + List<BusExchange> info = busExchangeService.validateBusExchange(busExchange); | ||
186 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
187 | + if (info.size() > 0) { | ||
188 | + return "该-交换机(交换机名称)-信息已存在,请谨慎输入"; | ||
189 | + } | ||
190 | + return null; | ||
191 | + } | ||
192 | + } | ||
193 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
6 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
7 | +import com.sunyo.wlpt.message.bus.service.service.BusQueueService; | ||
8 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
9 | +import org.springframework.web.bind.annotation.*; | ||
10 | + | ||
11 | +import javax.annotation.Resource; | ||
12 | +import java.util.List; | ||
13 | + | ||
14 | +/** | ||
15 | + * @author 子诚 | ||
16 | + * Description:关于消息队列的控制器 | ||
17 | + * 时间:2020/7/1 19:05 | ||
18 | + */ | ||
19 | +@CrossOrigin | ||
20 | +@RequestMapping("bus/queue") | ||
21 | +@RestController | ||
22 | +public class BusQueueController { | ||
23 | + | ||
24 | + @Resource | ||
25 | + private BusQueueService busQueueService; | ||
26 | + | ||
27 | + /** | ||
28 | + * 分页查询,消息队列-列表 | ||
29 | + * | ||
30 | + * @param queueName 消息队列名称 | ||
31 | + * @param pageNum 当前页数 | ||
32 | + * @param pageSize 每页数量 | ||
33 | + * @return 成功返回,消息队列-列表 | ||
34 | + */ | ||
35 | + @GetMapping("/list") | ||
36 | + public ResultJson<PageInfo> selectBusQueueList( | ||
37 | + @RequestParam(value = "queueName", required = false) String queueName, | ||
38 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
39 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
40 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
41 | + BusQueue busQueue = new BusQueue(); | ||
42 | + // 获取参数,队列名称 | ||
43 | + busQueue.setQueueName(queueName); | ||
44 | + // 分页查询 | ||
45 | + PageInfo pageInfo = busQueueService.selectBusQueueList(busQueue, pageNum, pageSize); | ||
46 | + if (pageInfo.getTotal() > 0) { | ||
47 | + result.setCode("200"); | ||
48 | + result.setData(pageInfo); | ||
49 | + result.setMsg("查询-消息队列-列表,成功!"); | ||
50 | + } else { | ||
51 | + result.setCode("500"); | ||
52 | + result.setMsg("查询-消息队列-列表,失败!"); | ||
53 | + } | ||
54 | + return result; | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * 删除队列 | ||
59 | + * | ||
60 | + * @param busQueue {@link BusQueue} | ||
61 | + * @return {@link ResultJson} | ||
62 | + */ | ||
63 | + @DeleteMapping("/delete") | ||
64 | + public ResultJson deleteBusQueue(@RequestBody BusQueue busQueue) { | ||
65 | + ResultJson result = new ResultJson<>(); | ||
66 | + int num = busQueueService.deleteByPrimaryKey(busQueue.getId()); | ||
67 | + if (num > 0) { | ||
68 | + result.setCode("200"); | ||
69 | + result.setMsg("删除-消息队列,成功"); | ||
70 | + } else { | ||
71 | + result.setCode("500"); | ||
72 | + result.setMsg("删除-消息交换机,失败"); | ||
73 | + } | ||
74 | + return result; | ||
75 | + } | ||
76 | + | ||
77 | + /** | ||
78 | + * 批量删除 | ||
79 | + * | ||
80 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
81 | + * @return {@link ResultJson} | ||
82 | + */ | ||
83 | + @GetMapping("/batchRemove") | ||
84 | + public ResultJson batchRemoveBusQueue(String ids) { | ||
85 | + | ||
86 | + ResultJson result = new ResultJson<>(); | ||
87 | + int num = busQueueService.deleteByPrimaryKey(ids); | ||
88 | + if (num > 0) { | ||
89 | + result.setCode("200"); | ||
90 | + result.setMsg("批量删除消息队列,成功!"); | ||
91 | + } else { | ||
92 | + result.setCode("500"); | ||
93 | + result.setMsg("批量删除消息队列,失败!"); | ||
94 | + } | ||
95 | + return result; | ||
96 | + } | ||
97 | + | ||
98 | + /** | ||
99 | + * 编辑-消息队列-信息 | ||
100 | + * | ||
101 | + * @param busQueue {@link BusQueue} | ||
102 | + * @return {@link ResultJson} | ||
103 | + */ | ||
104 | + @PutMapping("/update") | ||
105 | + public ResultJson updateBusQueue(@RequestBody BusQueue busQueue) { | ||
106 | + // 先校验队列名称 | ||
107 | + String message = validateBusQueue(busQueue); | ||
108 | + // 验证通过 | ||
109 | + if (message == null) { | ||
110 | + ResultJson result = new ResultJson<>(); | ||
111 | + int num = busQueueService.updateByPrimaryKeySelective(busQueue); | ||
112 | + if (num > 0) { | ||
113 | + result.setCode("200"); | ||
114 | + result.setMsg("编辑-消息队列-信息,成功"); | ||
115 | + } else { | ||
116 | + result.setCode("500"); | ||
117 | + result.setMsg("编辑-消息队列-信息,失败"); | ||
118 | + } | ||
119 | + return result; | ||
120 | + } | ||
121 | + return new ResultJson("400", message != null ? message : "编辑-消息队列-信息,失败!"); | ||
122 | + } | ||
123 | + | ||
124 | + /** | ||
125 | + * 新增-消息队列 | ||
126 | + * | ||
127 | + * @param busQueue {@link BusQueue} | ||
128 | + * @return {@link ResultJson} | ||
129 | + */ | ||
130 | + @PostMapping("/insert") | ||
131 | + public ResultJson insertBusQueue(@RequestBody BusQueue busQueue) { | ||
132 | + //先验证,增加的虚拟主机的核心信息(交换机名称)是否已存在 | ||
133 | + String message = validateBusQueue(busQueue); | ||
134 | + //验证通过 | ||
135 | + if (message == null) { | ||
136 | + ResultJson result = new ResultJson<>(); | ||
137 | + // 设置id | ||
138 | + busQueue.setId(IdUtils.generateId()); | ||
139 | + int num = busQueueService.insertSelective(busQueue); | ||
140 | + if (num > 0) { | ||
141 | + result.setCode("200"); | ||
142 | + result.setMsg("添加-消息队列-信息,成功!"); | ||
143 | + } else { | ||
144 | + result.setCode("500"); | ||
145 | + result.setMsg("添加-消息队列-信息,失败!"); | ||
146 | + } | ||
147 | + return result; | ||
148 | + } | ||
149 | + return new ResultJson("400", message != null ? message : "添加-消息队列-信息,失败!"); | ||
150 | + } | ||
151 | + | ||
152 | + /** | ||
153 | + * 校验-消息队列,添加和修改之前,是否已存在 | ||
154 | + * | ||
155 | + * @param busQueue {@link BusQueue} | ||
156 | + * @return 通过校验,无返回消息 | ||
157 | + */ | ||
158 | + private String validateBusQueue(BusQueue busQueue) { | ||
159 | + // 判断队列名称,是否为空 | ||
160 | + if ("".equals(busQueue.getQueueName()) || busQueue.getQueueName() == null) { | ||
161 | + return "该-消息队列-信息中,没有消息队列名称"; | ||
162 | + } | ||
163 | + | ||
164 | + // 如果id不为空,则是 update 操作 | ||
165 | + if (busQueue.getId() != null && busQueue.getId().length() != 0) { | ||
166 | + // 根据 id 查询出原来的 消息队列 信息 | ||
167 | + BusQueue oldBusQueue = busQueueService.selectByPrimaryKey(busQueue.getId()); | ||
168 | + // 如果修改后的 队列名称,和原来的 队列名称 不一致,则校验 该 队列名称 是否已存在 | ||
169 | + if (!oldBusQueue.getQueueName().equals(busQueue.getQueueName())) { | ||
170 | + // 根据 QueueName,进行查询校验 | ||
171 | + List<BusQueue> info = busQueueService.validateBusQueue(busQueue); | ||
172 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
173 | + if (info.size() > 0) { | ||
174 | + return "该-消息队列(队列名称)-信息已存在,请谨慎输入"; | ||
175 | + } | ||
176 | + return null; | ||
177 | + } | ||
178 | + // 队列名称 一致,则代表着没有修改 队列名称,校验通过 | ||
179 | + return null; | ||
180 | + } | ||
181 | + // 如果id为空,则是 insert 操作 | ||
182 | + else { | ||
183 | + // 根据 QueueName,进行查询校验 | ||
184 | + List<BusQueue> info = busQueueService.validateBusQueue(busQueue); | ||
185 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
186 | + if (info.size() > 0) { | ||
187 | + return "该-消息队列-信息已存在,请谨慎输入"; | ||
188 | + } | ||
189 | + return null; | ||
190 | + } | ||
191 | + } | ||
192 | + | ||
193 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
6 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
7 | +import com.sunyo.wlpt.message.bus.service.service.BusServerService; | ||
8 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
9 | +import org.springframework.web.bind.annotation.*; | ||
10 | + | ||
11 | +import javax.annotation.Resource; | ||
12 | +import java.util.List; | ||
13 | + | ||
14 | +/** | ||
15 | + * @author 子诚 | ||
16 | + * Description:关于MQ服务器静态信息的控制器 | ||
17 | + * 时间:2020/6/28 18:21 | ||
18 | + */ | ||
19 | +@CrossOrigin | ||
20 | +@RequestMapping("bus/server") | ||
21 | +@RestController | ||
22 | +public class BusServerController { | ||
23 | + | ||
24 | + @Resource | ||
25 | + private BusServerService busServerService; | ||
26 | + | ||
27 | + /** | ||
28 | + * 分页查询,MQ服务器列表 | ||
29 | + * | ||
30 | + * @param serverName MQ服务器名称 | ||
31 | + * @param pageNum 当前页数 | ||
32 | + * @param pageSize 每页数量 | ||
33 | + * @return 成功返回MQ服务器列表 | ||
34 | + */ | ||
35 | + @GetMapping("/list") | ||
36 | + public ResultJson<PageInfo> selectBusServerList( | ||
37 | + @RequestParam(value = "serverName", required = false) String serverName, | ||
38 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
39 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
40 | + | ||
41 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
42 | + BusServer busServer = new BusServer(); | ||
43 | + // 获取参数,服务器名称 | ||
44 | + busServer.setServerName(serverName); | ||
45 | + // 分页查询 | ||
46 | + PageInfo pageInfo = busServerService.selectBusServerList(busServer, pageNum, pageSize); | ||
47 | + if (pageInfo.getTotal() > 0) { | ||
48 | + result.setCode("200"); | ||
49 | + result.setData(pageInfo); | ||
50 | + result.setMsg("查询MQ服务器列表,成功!"); | ||
51 | + } else { | ||
52 | + result.setCode("500"); | ||
53 | + result.setMsg("查询MQ服务器列表,失败!"); | ||
54 | + } | ||
55 | + return result; | ||
56 | + } | ||
57 | + | ||
58 | + /** | ||
59 | + * 删除服务器 | ||
60 | + * | ||
61 | + * @param busServer {@link BusServer} | ||
62 | + * @return {@link ResultJson} | ||
63 | + */ | ||
64 | + @DeleteMapping("/delete") | ||
65 | + public ResultJson deleteBusServer(@RequestBody BusServer busServer) { | ||
66 | + ResultJson result = new ResultJson<>(); | ||
67 | + int num = busServerService.deleteByPrimaryKey(busServer.getId()); | ||
68 | + if (num > 0) { | ||
69 | + result.setCode("200"); | ||
70 | + result.setMsg("删除MQ服务器,成功"); | ||
71 | + } else { | ||
72 | + result.setCode("500"); | ||
73 | + result.setMsg("删除MQ服务器,失败"); | ||
74 | + } | ||
75 | + return result; | ||
76 | + } | ||
77 | + | ||
78 | + /** | ||
79 | + * 批量删除 | ||
80 | + * | ||
81 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
82 | + * @return {@link ResultJson} | ||
83 | + */ | ||
84 | + @GetMapping("/batchRemove") | ||
85 | + public ResultJson batchRemoveBusServer(String ids) { | ||
86 | + ResultJson result = new ResultJson<>(); | ||
87 | + int num = busServerService.deleteByPrimaryKey(ids); | ||
88 | + if (num > 0) { | ||
89 | + result.setCode("200"); | ||
90 | + result.setMsg("批量删除服务器,成功!"); | ||
91 | + } else { | ||
92 | + result.setCode("500"); | ||
93 | + result.setMsg("批量删除服务器,失败!"); | ||
94 | + } | ||
95 | + return result; | ||
96 | + } | ||
97 | + | ||
98 | + /** | ||
99 | + * 修改服务器信息 | ||
100 | + * | ||
101 | + * @param busServer {@link BusServer} | ||
102 | + * @return {@link ResultJson} | ||
103 | + */ | ||
104 | + @PutMapping("/update") | ||
105 | + public ResultJson updateBusServer(@RequestBody BusServer busServer) { | ||
106 | + //先验证,修改好的核心信息(ip和port,同时存在)是否已存在 | ||
107 | + String message = validateBusServer(busServer); | ||
108 | + //验证通过 | ||
109 | + if (message == null) { | ||
110 | + ResultJson result = new ResultJson<>(); | ||
111 | + int num = busServerService.updateByPrimaryKeySelective(busServer); | ||
112 | + if (num > 0) { | ||
113 | + result.setCode("200"); | ||
114 | + result.setMsg("修改服务器信息,成功"); | ||
115 | + } else { | ||
116 | + result.setCode("500"); | ||
117 | + result.setMsg("修改服务器信息,失败"); | ||
118 | + } | ||
119 | + return result; | ||
120 | + } | ||
121 | + return new ResultJson("400", message != null ? message : "修改服务器信息,失败!"); | ||
122 | + } | ||
123 | + | ||
124 | + /** | ||
125 | + * 新增服务器 | ||
126 | + * | ||
127 | + * @param busServer {@link BusServer} | ||
128 | + * @return {@link ResultJson} | ||
129 | + */ | ||
130 | + @PostMapping("/insert") | ||
131 | + public ResultJson insertBusServer(@RequestBody BusServer busServer) { | ||
132 | + //先验证,增加的服务器的核心信息(ip和port,同时存在)是否已存在 | ||
133 | + String message = validateBusServer(busServer); | ||
134 | + //验证通过 | ||
135 | + if (message == null) { | ||
136 | + ResultJson result = new ResultJson<>(); | ||
137 | + // 设置id | ||
138 | + busServer.setId(IdUtils.generateId()); | ||
139 | + int num = busServerService.insertSelective(busServer); | ||
140 | + if (num > 0) { | ||
141 | + result.setCode("200"); | ||
142 | + result.setMsg("添加服务器信息,成功!"); | ||
143 | + } else { | ||
144 | + result.setCode("500"); | ||
145 | + result.setMsg("添加服务器信息,失败!"); | ||
146 | + } | ||
147 | + return result; | ||
148 | + } | ||
149 | + return new ResultJson("400", message != null ? message : "该服务器信息,已存在!"); | ||
150 | + } | ||
151 | + | ||
152 | + /** | ||
153 | + * 校验,添加和修改之前,是否已存在 | ||
154 | + * | ||
155 | + * @param busServer {@link BusServer} | ||
156 | + * @return 通过,无返回消息 | ||
157 | + */ | ||
158 | + private String validateBusServer(BusServer busServer) { | ||
159 | + if ("".equals(busServer.getServerIp()) || busServer.getServerIp() == null) { | ||
160 | + return "该服务器信息中,没有服务器IP"; | ||
161 | + } | ||
162 | + if ("".equals(busServer.getServerPort()) || busServer.getServerPort() == null) { | ||
163 | + return "该服务器信息中,没有服务器Port"; | ||
164 | + } | ||
165 | + | ||
166 | + // 如果id不为空,则是 update 操作 | ||
167 | + if (busServer.getId() != null && busServer.getId().length() != 0) { | ||
168 | + // 根据 id 查询出原来的 MQ服务器 信息 | ||
169 | + BusServer oldBusServer = busServerService.selectByPrimaryKey(busServer.getId()); | ||
170 | + // 如果修改后的 ServerIp以及ServerPort(同时),和原来的 ServerIp以及ServerPort(同时) 不一致,(有一个不一致,即可) | ||
171 | + // 则校验 该 ServerIp以及ServerPort(同时) 是否已存在 | ||
172 | + if (!oldBusServer.getServerPort().equals(busServer.getServerPort()) || | ||
173 | + !oldBusServer.getServerIp().equals(busServer.getServerIp())) { | ||
174 | + | ||
175 | + // 根据 ServerIp以及ServerPort(同时),进行查询校验 | ||
176 | + List<BusServer> info = busServerService.validateBusServer(busServer); | ||
177 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
178 | + if (info.size() > 0) { | ||
179 | + return "该-MQ服务器(ServerIp以及ServerPort)-信息已存在,请谨慎输入"; | ||
180 | + } | ||
181 | + return null; | ||
182 | + } | ||
183 | + // ServerIp以及ServerPort(同时) 一致,则代表着没有修改 ServerIp以及ServerPort(同时),校验通过 | ||
184 | + return null; | ||
185 | + } | ||
186 | + // 如果id为空,则是 insert 操作 | ||
187 | + else { | ||
188 | + // 根据 ServerIp以及ServerPort(同时),进行查询校验 | ||
189 | + List<BusServer> info = busServerService.validateBusServer(busServer); | ||
190 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
191 | + if (info.size() > 0) { | ||
192 | + return "该-MQ服务器(ServerIp以及ServerPort)-信息已存在,请谨慎输入"; | ||
193 | + } | ||
194 | + return null; | ||
195 | + } | ||
196 | + } | ||
197 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.MessageNote; | ||
6 | +import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding; | ||
7 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
8 | +import com.sunyo.wlpt.message.bus.service.service.MessageNoteService; | ||
9 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
10 | +import org.springframework.web.bind.annotation.*; | ||
11 | + | ||
12 | +import javax.annotation.Resource; | ||
13 | +import java.util.Date; | ||
14 | + | ||
15 | +/** | ||
16 | + * @author 子诚 | ||
17 | + * Description:关于消息收发记录的控制器 | ||
18 | + * 时间:2020/7/2 15:06 | ||
19 | + */ | ||
20 | +@CrossOrigin | ||
21 | +@RequestMapping("bus/note") | ||
22 | +@RestController | ||
23 | +public class MessageNoteController { | ||
24 | + | ||
25 | + @Resource | ||
26 | + private MessageNoteService messageNoteService; | ||
27 | + | ||
28 | + /** | ||
29 | + * 分页查询,消息收发记录 | ||
30 | + * | ||
31 | + * @param username 用户登陆名称 | ||
32 | + * @param serverName MQ服务器名称 | ||
33 | + * @param virtualHostName 虚拟主机名称 | ||
34 | + * @param exchangeName 交换机名称 | ||
35 | + * @param queueName 队列名称 | ||
36 | + * @param routingKeyName 路由键名称 | ||
37 | + * @param sendTime 发送消息时间 | ||
38 | + * @param receiveTime 接收消息时间 | ||
39 | + * @param pageNum 当前页数,默认 1 | ||
40 | + * @param pageSize 每页条数,默认 10 | ||
41 | + * @return 消息收发记录-列表 | ||
42 | + */ | ||
43 | + @GetMapping("/list") | ||
44 | + public ResultJson<PageInfo> selectMessageNoteList( | ||
45 | + @RequestParam(value = "username", required = false) String username, | ||
46 | + @RequestParam(value = "serverName", required = false) String serverName, | ||
47 | + @RequestParam(value = "virtualHostName", required = false) String virtualHostName, | ||
48 | + @RequestParam(value = "exchangeName", required = false) String exchangeName, | ||
49 | + @RequestParam(value = "queueName", required = false) String queueName, | ||
50 | + @RequestParam(value = "routingKeyName", required = false) String routingKeyName, | ||
51 | + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
52 | + @RequestParam(value = "sendTime", required = false) Date sendTime, | ||
53 | + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | ||
54 | + @RequestParam(value = "receiveTime", required = false) Date receiveTime, | ||
55 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
56 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
57 | + | ||
58 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
59 | + MessageNote messageNote = new MessageNote(); | ||
60 | + // 获取参数,用户登陆名称 | ||
61 | + messageNote.setUsername(username); | ||
62 | + // 获取参数,MQ服务器名称 | ||
63 | + messageNote.setServerName(serverName); | ||
64 | + // 获取参数,虚拟主机名称 | ||
65 | + messageNote.setVirtualHostName(virtualHostName); | ||
66 | + // 获取参数,交换机名称 | ||
67 | + messageNote.setExchangeName(exchangeName); | ||
68 | + // 获取参数,队列名称 | ||
69 | + messageNote.setQueueName(queueName); | ||
70 | + // 获取参数,路由键名称 | ||
71 | + messageNote.setRoutingKeyName(routingKeyName); | ||
72 | + // 获取参数,发送消息时间 | ||
73 | + messageNote.setSendTime(sendTime); | ||
74 | + // 获取参数,接收消息时间 | ||
75 | + messageNote.setReceiveTime(receiveTime); | ||
76 | + // 分页查询 | ||
77 | + PageInfo pageInfo = messageNoteService.selectMessageNoteList(messageNote, pageNum, pageSize); | ||
78 | + if (pageInfo.getTotal() > 0) { | ||
79 | + result.setCode("200"); | ||
80 | + result.setData(pageInfo); | ||
81 | + result.setMsg("查询MQ服务器列表,成功!"); | ||
82 | + } else { | ||
83 | + result.setCode("500"); | ||
84 | + result.setMsg("查询MQ服务器列表,失败!"); | ||
85 | + } | ||
86 | + return result; | ||
87 | + } | ||
88 | + | ||
89 | + /** | ||
90 | + * 删除--消息收发记录 | ||
91 | + * | ||
92 | + * @param messageNote {@link MessageNote} | ||
93 | + * @return {@link ResultJson} | ||
94 | + */ | ||
95 | + @DeleteMapping("/delete") | ||
96 | + public ResultJson deleteMessageNote(@RequestBody MessageNote messageNote) { | ||
97 | + ResultJson result = new ResultJson<>(); | ||
98 | + int num = messageNoteService.deleteByPrimaryKey(messageNote.getId()); | ||
99 | + if (num > 0) { | ||
100 | + result.setCode("200"); | ||
101 | + result.setMsg("删除-消息收发记录,成功"); | ||
102 | + } else { | ||
103 | + result.setCode("500"); | ||
104 | + result.setMsg("删除-消息收发记录,失败"); | ||
105 | + } | ||
106 | + return result; | ||
107 | + } | ||
108 | + | ||
109 | + /** | ||
110 | + * 批量删除 | ||
111 | + * | ||
112 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
113 | + * @return {@link ResultJson} | ||
114 | + */ | ||
115 | + @GetMapping("/batchRemove") | ||
116 | + public ResultJson batchRemoveMessageNote(String ids) { | ||
117 | + ResultJson result = new ResultJson<>(); | ||
118 | + int num = messageNoteService.deleteByPrimaryKey(ids); | ||
119 | + if (num > 0) { | ||
120 | + result.setCode("200"); | ||
121 | + result.setMsg("批量删除-消息收发记录,成功!"); | ||
122 | + } else { | ||
123 | + result.setCode("500"); | ||
124 | + result.setMsg("批量删除-消息收发记录,失败!"); | ||
125 | + } | ||
126 | + return result; | ||
127 | + } | ||
128 | + | ||
129 | + /** | ||
130 | + * 编辑-消息收发记录 | ||
131 | + * | ||
132 | + * @param messageNote {@link MessageNote} | ||
133 | + * @return {@link ResultJson} | ||
134 | + */ | ||
135 | + @PutMapping("/update") | ||
136 | + public ResultJson updateMessageNote(@RequestBody MessageNote messageNote) { | ||
137 | + ResultJson result = new ResultJson<>(); | ||
138 | + int num = messageNoteService.updateByPrimaryKeySelective(messageNote); | ||
139 | + if (num > 0) { | ||
140 | + result.setCode("200"); | ||
141 | + result.setMsg("编辑-消息收发记录,成功"); | ||
142 | + } else { | ||
143 | + result.setCode("500"); | ||
144 | + result.setMsg("编辑-消息收发记录,失败"); | ||
145 | + } | ||
146 | + return result; | ||
147 | + } | ||
148 | + | ||
149 | + /** | ||
150 | + * 新增-消息收发记录 | ||
151 | + * | ||
152 | + * @param messageNote {@link MessageNote} | ||
153 | + * @return {@link ResultJson} | ||
154 | + */ | ||
155 | + @PostMapping("/insert") | ||
156 | + public ResultJson insertMessageNote(@RequestBody MessageNote messageNote) { | ||
157 | + ResultJson result = new ResultJson<>(); | ||
158 | + // 设置id | ||
159 | + messageNote.setId(IdUtils.generateId()); | ||
160 | + int num = messageNoteService.insertSelective(messageNote); | ||
161 | + if (num > 0) { | ||
162 | + result.setCode("200"); | ||
163 | + result.setMsg("添加-消息收发记录,成功"); | ||
164 | + } else { | ||
165 | + result.setCode("500"); | ||
166 | + result.setMsg("添加-消息收发记录,失败"); | ||
167 | + } | ||
168 | + return result; | ||
169 | + } | ||
170 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.RoutingKey; | ||
5 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
6 | +import com.sunyo.wlpt.message.bus.service.service.RoutingKeyService; | ||
7 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
8 | +import org.springframework.web.bind.annotation.*; | ||
9 | + | ||
10 | +import javax.annotation.Resource; | ||
11 | +import java.util.List; | ||
12 | + | ||
13 | +/** | ||
14 | + * @author 子诚 | ||
15 | + * Description:关于路由键的控制器 | ||
16 | + * 时间:2020/7/1 17:41 | ||
17 | + */ | ||
18 | +@CrossOrigin | ||
19 | +@RequestMapping("bus/routing") | ||
20 | +@RestController | ||
21 | +public class RoutingKeyController { | ||
22 | + | ||
23 | + @Resource | ||
24 | + private RoutingKeyService routingKeyService; | ||
25 | + | ||
26 | + /** | ||
27 | + * 分页查询,路由键列表 | ||
28 | + * | ||
29 | + * @param routingKeyName 路由键名称 | ||
30 | + * @param pageNum 当前页数 | ||
31 | + * @param pageSize 每页数量 | ||
32 | + * @return 成功返回路由键列表 | ||
33 | + */ | ||
34 | + @GetMapping("/list") | ||
35 | + public ResultJson<PageInfo> selectRoutingKeyList( | ||
36 | + @RequestParam(value = "routingKeyName", required = false) String routingKeyName, | ||
37 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
38 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
39 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
40 | + | ||
41 | + RoutingKey routingKey = new RoutingKey(); | ||
42 | + // 获取参数,路由键名称 | ||
43 | + routingKey.setRoutingKeyName(routingKeyName); | ||
44 | + // 分页查询 | ||
45 | + PageInfo pageInfo = routingKeyService.selectRoutingKeyList(routingKey, pageNum, pageSize); | ||
46 | + if (pageInfo.getTotal() > 0) { | ||
47 | + result.setCode("200"); | ||
48 | + result.setData(pageInfo); | ||
49 | + result.setMsg("查询路由键列表,成功!"); | ||
50 | + } else { | ||
51 | + result.setCode("500"); | ||
52 | + result.setMsg("查询路由键列表,失败!"); | ||
53 | + } | ||
54 | + return result; | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * 删除路由键 | ||
59 | + * | ||
60 | + * @param routingKey {@link RoutingKey} | ||
61 | + * @return {@link ResultJson} | ||
62 | + */ | ||
63 | + @DeleteMapping("/delete") | ||
64 | + public ResultJson deleteRoutingKey(@RequestBody RoutingKey routingKey) { | ||
65 | + ResultJson result = new ResultJson<>(); | ||
66 | + int num = routingKeyService.deleteByPrimaryKey(routingKey.getId()); | ||
67 | + if (num > 0) { | ||
68 | + result.setCode("200"); | ||
69 | + result.setMsg("删除路由键,成功"); | ||
70 | + } else { | ||
71 | + result.setCode("500"); | ||
72 | + result.setMsg("删除路由键,失败"); | ||
73 | + } | ||
74 | + return result; | ||
75 | + } | ||
76 | + | ||
77 | + /** | ||
78 | + * 批量删除 | ||
79 | + * | ||
80 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
81 | + * @return {@link ResultJson} | ||
82 | + */ | ||
83 | + @GetMapping("/batchRemove") | ||
84 | + public ResultJson batchRemoveRoutingKey(String ids) { | ||
85 | + ResultJson result = new ResultJson<>(); | ||
86 | + int num = routingKeyService.deleteByPrimaryKey(ids); | ||
87 | + if (num > 0) { | ||
88 | + result.setCode("200"); | ||
89 | + result.setMsg("批量删除路由键,成功!"); | ||
90 | + } else { | ||
91 | + result.setCode("500"); | ||
92 | + result.setMsg("批量删除路由键,失败!"); | ||
93 | + } | ||
94 | + return result; | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * 修改路由键信息 | ||
99 | + * | ||
100 | + * @param routingKey {@link RoutingKey} | ||
101 | + * @return {@link ResultJson} | ||
102 | + */ | ||
103 | + @PutMapping("/update") | ||
104 | + public ResultJson updateRoutingKey(@RequestBody RoutingKey routingKey) { | ||
105 | + //先验证,修改好的核心信息(路由键名称)是否已存在 | ||
106 | + String message = validateRoutingKey(routingKey); | ||
107 | + //验证通过 | ||
108 | + if (message == null) { | ||
109 | + ResultJson result = new ResultJson<>(); | ||
110 | + int num = routingKeyService.updateByPrimaryKeySelective(routingKey); | ||
111 | + if (num > 0) { | ||
112 | + result.setCode("200"); | ||
113 | + result.setMsg("修改路由键信息,成功"); | ||
114 | + } else { | ||
115 | + result.setCode("500"); | ||
116 | + result.setMsg("修改路由键信息,失败"); | ||
117 | + } | ||
118 | + return result; | ||
119 | + } | ||
120 | + return new ResultJson("400", message != null ? message : "修改路由键信息,失败!"); | ||
121 | + } | ||
122 | + | ||
123 | + /** | ||
124 | + * 新增路由键 | ||
125 | + * | ||
126 | + * @param routingKey {@link RoutingKey} | ||
127 | + * @return {@link ResultJson} | ||
128 | + */ | ||
129 | + @PostMapping("/insert") | ||
130 | + public ResultJson insertRoutingKey(@RequestBody RoutingKey routingKey) { | ||
131 | + //先验证,增加的服务器的核心信息(ip和port,同时存在)是否已存在 | ||
132 | + String message = validateRoutingKey(routingKey); | ||
133 | + //验证通过 | ||
134 | + if (message == null) { | ||
135 | + ResultJson result = new ResultJson<>(); | ||
136 | + // 设置id | ||
137 | + routingKey.setId(IdUtils.generateId()); | ||
138 | + int num = routingKeyService.insertSelective(routingKey); | ||
139 | + if (num > 0) { | ||
140 | + result.setCode("200"); | ||
141 | + result.setMsg("添加路由键信息,成功!"); | ||
142 | + } else { | ||
143 | + result.setCode("500"); | ||
144 | + result.setMsg("添加路由键信息,失败!"); | ||
145 | + } | ||
146 | + return result; | ||
147 | + } | ||
148 | + return new ResultJson("400", message != null ? message : "添加路由键信息,失败!"); | ||
149 | + } | ||
150 | + | ||
151 | + /** | ||
152 | + * 校验路由键,添加和修改之前,是否已存在 | ||
153 | + * | ||
154 | + * @param routingKey {@link RoutingKey} | ||
155 | + * @return 通过,无返回消息 | ||
156 | + */ | ||
157 | + private String validateRoutingKey(RoutingKey routingKey) { | ||
158 | + if ("".equals(routingKey.getRoutingKeyName()) || routingKey.getRoutingKeyName() == null) { | ||
159 | + return "该路由键信息中,没有路由键名称"; | ||
160 | + } | ||
161 | + | ||
162 | + // 如果id不为空,则是 update 操作 | ||
163 | + | ||
164 | + if (routingKey.getId() != null && routingKey.getId().length() != 0) { | ||
165 | + // 根据 id 查询出原来的 路由键 信息 | ||
166 | + RoutingKey oldRoutingKey = routingKeyService.selectByPrimaryKey(routingKey.getId()); | ||
167 | + // 如果修改后的 routingKeyName,和原来的 routingKeyName 不一致,则校验 该 routingKeyName 是否已存在 | ||
168 | + if (!oldRoutingKey.getRoutingKeyName().equals(routingKey.getRoutingKeyName())) { | ||
169 | + // 根据 routingKeyName,进行查询校验 | ||
170 | + List<RoutingKey> info = routingKeyService.validateRoutingKey(routingKey); | ||
171 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
172 | + if (info.size() > 0) { | ||
173 | + return "该-路由键(路由键名称)-信息已存在,请谨慎输入"; | ||
174 | + } | ||
175 | + return null; | ||
176 | + } | ||
177 | + // routingKeyName 一致,则代表着没有修改 routingKeyName,校验通过 | ||
178 | + return null; | ||
179 | + } | ||
180 | + // 如果id为空,则是 insert 操作 | ||
181 | + else { | ||
182 | + // 根据 routingKeyName,进行查询校验 | ||
183 | + List<RoutingKey> info = routingKeyService.validateRoutingKey(routingKey); | ||
184 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
185 | + if (info.size() > 0) { | ||
186 | + return "该-路由键(路由键名称)-信息已存在,请谨慎输入"; | ||
187 | + } | ||
188 | + return null; | ||
189 | + } | ||
190 | + } | ||
191 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/controller/UserMessageBindingController.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | + | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
6 | +import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding; | ||
7 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
8 | +import com.sunyo.wlpt.message.bus.service.service.UserMessageBindingService; | ||
9 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
10 | +import org.springframework.web.bind.annotation.*; | ||
11 | + | ||
12 | +import javax.annotation.Resource; | ||
13 | + | ||
14 | +/** | ||
15 | + * @author 子诚 | ||
16 | + * Description:关于账户消息绑定配置表的控制器 | ||
17 | + * 时间:2020/7/2 11:20 | ||
18 | + */ | ||
19 | + | ||
20 | +@CrossOrigin | ||
21 | +@RequestMapping("bus/umb") | ||
22 | +@RestController | ||
23 | +public class UserMessageBindingController { | ||
24 | + | ||
25 | + @Resource | ||
26 | + private UserMessageBindingService userMessageBindingService; | ||
27 | + | ||
28 | + /** | ||
29 | + * 分页查询,账户消息绑定配置表,列表 | ||
30 | + * | ||
31 | + * @param username 所属用户登陆名称 | ||
32 | + * @param virtualHostName 所属虚拟主机名称 | ||
33 | + * @param exchangeName 所属交换机名称 | ||
34 | + * @param queueName 所属队列名称 | ||
35 | + * @param routingKeyName 所属路由键名称 | ||
36 | + * @param subscriber 订阅者 | ||
37 | + * @param pageNum 当前页数 | ||
38 | + * @param pageSize 每页数量 | ||
39 | + * @return 列表 {@link ResultJson} | ||
40 | + */ | ||
41 | + @GetMapping("/list") | ||
42 | + public ResultJson<PageInfo> selectUserMessageBindingList( | ||
43 | + @RequestParam(value = "username", required = false) String username, | ||
44 | + @RequestParam(value = "virtualHostName", required = false) String virtualHostName, | ||
45 | + @RequestParam(value = "exchangeName", required = false) String exchangeName, | ||
46 | + @RequestParam(value = "queueName", required = false) String queueName, | ||
47 | + @RequestParam(value = "routingKeyName", required = false) String routingKeyName, | ||
48 | + @RequestParam(value = "subscriber", required = false) String subscriber, | ||
49 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
50 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
51 | + | ||
52 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
53 | + | ||
54 | + UserMessageBinding userMessageBinding = new UserMessageBinding(); | ||
55 | + // 获取参数,所属用户登陆名称 | ||
56 | + userMessageBinding.setUsername(username); | ||
57 | + // 获取参数,所属虚拟主机名称 | ||
58 | + userMessageBinding.setVirtualHostName(virtualHostName); | ||
59 | + // 获取参数,所属交换机名称 | ||
60 | + userMessageBinding.setExchangeName(exchangeName); | ||
61 | + // 获取参数,所属队列名称 | ||
62 | + userMessageBinding.setQueueName(queueName); | ||
63 | + // 获取参数,所属路由键名称 | ||
64 | + userMessageBinding.setRoutingKeyName(routingKeyName); | ||
65 | + // 获取参数,订阅者 | ||
66 | + userMessageBinding.setSubscriber(subscriber); | ||
67 | + // 分页查询 | ||
68 | + PageInfo pageInfo = userMessageBindingService.selectUserMessageBindingList(userMessageBinding, pageNum, pageSize); | ||
69 | + if (pageInfo.getTotal() > 0) { | ||
70 | + result.setCode("200"); | ||
71 | + result.setData(pageInfo); | ||
72 | + result.setMsg("查询-账户消息绑定配置列表,成功!"); | ||
73 | + } else { | ||
74 | + result.setCode("500"); | ||
75 | + result.setMsg("查询-账户消息绑定配置列表,失败!"); | ||
76 | + } | ||
77 | + return result; | ||
78 | + } | ||
79 | + | ||
80 | + /** | ||
81 | + * 删除--账户消息配置信息 | ||
82 | + * | ||
83 | + * @param userMessageBinding {@link UserMessageBinding} | ||
84 | + * @return {@link ResultJson} | ||
85 | + */ | ||
86 | + @DeleteMapping("/delete") | ||
87 | + public ResultJson deleteUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding) { | ||
88 | + ResultJson result = new ResultJson<>(); | ||
89 | + int num = userMessageBindingService.deleteByPrimaryKey(userMessageBinding.getId()); | ||
90 | + if (num > 0) { | ||
91 | + result.setCode("200"); | ||
92 | + result.setMsg("删除-账户消息配置信息,成功"); | ||
93 | + } else { | ||
94 | + result.setCode("500"); | ||
95 | + result.setMsg("删除-账户消息配置信息,失败"); | ||
96 | + } | ||
97 | + return result; | ||
98 | + } | ||
99 | + | ||
100 | + /** | ||
101 | + * 批量删除 | ||
102 | + * | ||
103 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
104 | + * @return {@link ResultJson} | ||
105 | + */ | ||
106 | + @GetMapping("/batchRemove") | ||
107 | + public ResultJson batchRemoveUserMessageBinding(String ids) { | ||
108 | + ResultJson result = new ResultJson<>(); | ||
109 | + int num = userMessageBindingService.deleteByPrimaryKey(ids); | ||
110 | + if (num > 0) { | ||
111 | + result.setCode("200"); | ||
112 | + result.setMsg("批量删除-账户消息配置-信息,成功!"); | ||
113 | + } else { | ||
114 | + result.setCode("500"); | ||
115 | + result.setMsg("批量删除-账户消息配置-信息,失败!"); | ||
116 | + } | ||
117 | + return result; | ||
118 | + } | ||
119 | + | ||
120 | + /** | ||
121 | + * 编辑-账户消息配置信息 | ||
122 | + * | ||
123 | + * @param userMessageBinding {@link UserMessageBinding} | ||
124 | + * @return {@link ResultJson} | ||
125 | + */ | ||
126 | + @PutMapping("/update") | ||
127 | + public ResultJson updateUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding) { | ||
128 | + ResultJson result = new ResultJson<>(); | ||
129 | + int num = userMessageBindingService.updateByPrimaryKeySelective(userMessageBinding); | ||
130 | + if (num > 0) { | ||
131 | + result.setCode("200"); | ||
132 | + result.setMsg("编辑-账户消息配置-信息,成功"); | ||
133 | + } else { | ||
134 | + result.setCode("500"); | ||
135 | + result.setMsg("编辑-账户消息配置-信息,失败"); | ||
136 | + } | ||
137 | + return result; | ||
138 | + } | ||
139 | + | ||
140 | + /** | ||
141 | + * 新增-账户消息配置信息 | ||
142 | + * | ||
143 | + * @param userMessageBinding {@link UserMessageBinding} | ||
144 | + * @return {@link ResultJson} | ||
145 | + */ | ||
146 | + @PostMapping("/insert") | ||
147 | + public ResultJson insertUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding) { | ||
148 | + ResultJson result = new ResultJson<>(); | ||
149 | + // 设置id | ||
150 | + userMessageBinding.setId(IdUtils.generateId()); | ||
151 | + int num = userMessageBindingService.insertSelective(userMessageBinding); | ||
152 | + if (num > 0) { | ||
153 | + result.setCode("200"); | ||
154 | + result.setMsg("添加-账户消息配置-信息,成功"); | ||
155 | + } else { | ||
156 | + result.setCode("500"); | ||
157 | + result.setMsg("添加-账户消息配置-信息,失败"); | ||
158 | + } | ||
159 | + return result; | ||
160 | + } | ||
161 | + | ||
162 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.controller; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.VirtualHost; | ||
6 | +import com.sunyo.wlpt.message.bus.service.response.ResultJson; | ||
7 | +import com.sunyo.wlpt.message.bus.service.service.VirtualHostService; | ||
8 | +import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | ||
9 | +import org.springframework.web.bind.annotation.*; | ||
10 | + | ||
11 | +import javax.annotation.Resource; | ||
12 | +import java.util.List; | ||
13 | + | ||
14 | +/** | ||
15 | + * @author 子诚 | ||
16 | + * Description:关于MQ虚拟主机信息的控制器 | ||
17 | + * 时间:2020/7/1 14:28 | ||
18 | + */ | ||
19 | +@CrossOrigin | ||
20 | +@RequestMapping("bus/host") | ||
21 | +@RestController | ||
22 | +public class VirtualHostController { | ||
23 | + | ||
24 | + @Resource | ||
25 | + private VirtualHostService virtualHostService; | ||
26 | + | ||
27 | + /** | ||
28 | + * 分页查询,虚拟主机列表 | ||
29 | + * | ||
30 | + * @param serverId 所属服务器ID | ||
31 | + * @param virtualHostName 虚拟主机名称 | ||
32 | + * @param pageNum 当前页数 | ||
33 | + * @param pageSize 每页数量 | ||
34 | + * @return 成功返回,虚拟主机列表 | ||
35 | + */ | ||
36 | + @GetMapping("/list") | ||
37 | + public ResultJson<PageInfo> selectVirtualHostList( | ||
38 | + @RequestParam(value = "serverId", required = false) String serverId, | ||
39 | + @RequestParam(value = "virtualHostName", required = false) String virtualHostName, | ||
40 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
41 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||
42 | + ResultJson<PageInfo> result = new ResultJson<>(); | ||
43 | + VirtualHost virtualHost = new VirtualHost(); | ||
44 | + // 获取参数,所属服务器ID | ||
45 | + virtualHost.setServerId(serverId); | ||
46 | + // 获取参数,虚拟主机名称 | ||
47 | + virtualHost.setVirtualHostName(virtualHostName); | ||
48 | + // 分页查询 | ||
49 | + PageInfo pageInfo = virtualHostService.selectVirtualHostList(virtualHost, pageNum, pageSize); | ||
50 | + if (pageInfo.getTotal() > 0) { | ||
51 | + result.setCode("200"); | ||
52 | + result.setData(pageInfo); | ||
53 | + result.setMsg("查询虚拟主机列表,成功!"); | ||
54 | + } else { | ||
55 | + result.setCode("500"); | ||
56 | + result.setMsg("查询虚拟主机列表,失败!"); | ||
57 | + } | ||
58 | + return result; | ||
59 | + } | ||
60 | + | ||
61 | + /** | ||
62 | + * 删除虚拟主机 | ||
63 | + * | ||
64 | + * @param virtualHost {@link VirtualHost} | ||
65 | + * @return {@link ResultJson} | ||
66 | + */ | ||
67 | + @DeleteMapping("/delete") | ||
68 | + public ResultJson deleteVirtualHost(@RequestBody VirtualHost virtualHost) { | ||
69 | + | ||
70 | + ResultJson result = new ResultJson<>(); | ||
71 | + int num = virtualHostService.deleteByPrimaryKey(virtualHost.getId()); | ||
72 | + if (num > 0) { | ||
73 | + result.setCode("200"); | ||
74 | + result.setMsg("删除虚拟主机信息,成功"); | ||
75 | + } else { | ||
76 | + result.setCode("500"); | ||
77 | + result.setMsg("删除虚拟主机信息,失败"); | ||
78 | + } | ||
79 | + return result; | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 批量删除,虚拟主机 | ||
84 | + * | ||
85 | + * @param ids 需被删除的服务器的id以','相连接的字符串 | ||
86 | + * @return {@link ResultJson} | ||
87 | + */ | ||
88 | + @GetMapping("/batchRemove") | ||
89 | + public ResultJson batchRemoveVirtualHost(String ids) { | ||
90 | + ResultJson result = new ResultJson<>(); | ||
91 | + int num = virtualHostService.deleteByPrimaryKey(ids); | ||
92 | + if (num > 0) { | ||
93 | + result.setCode("200"); | ||
94 | + result.setMsg("批量删除虚拟主机,成功!"); | ||
95 | + } else { | ||
96 | + result.setCode("500"); | ||
97 | + result.setMsg("批量删除虚拟主机,失败!"); | ||
98 | + } | ||
99 | + return result; | ||
100 | + } | ||
101 | + | ||
102 | + /** | ||
103 | + * 编辑虚拟机信息 | ||
104 | + * | ||
105 | + * @param virtualHost {@link VirtualHost} | ||
106 | + * @return {@link ResultJson} | ||
107 | + */ | ||
108 | + @PutMapping("/update") | ||
109 | + public ResultJson updateVirtualHost(@RequestBody VirtualHost virtualHost) { | ||
110 | + | ||
111 | + //先验证,修改好的核心信息(虚拟主机名称)是否已存在 | ||
112 | + String message = validateVirtualHost(virtualHost); | ||
113 | + //验证通过 | ||
114 | + if (message == null) { | ||
115 | + ResultJson result = new ResultJson<>(); | ||
116 | + int num = virtualHostService.updateByPrimaryKeySelective(virtualHost); | ||
117 | + if (num > 0) { | ||
118 | + result.setCode("200"); | ||
119 | + result.setMsg("修改虚拟主机信息,成功"); | ||
120 | + } else { | ||
121 | + result.setCode("500"); | ||
122 | + result.setMsg("修改虚拟主机信息,失败"); | ||
123 | + } | ||
124 | + return result; | ||
125 | + } | ||
126 | + return new ResultJson("400", message != null ? message : "修改虚拟主机信息,失败!"); | ||
127 | + } | ||
128 | + | ||
129 | + /** | ||
130 | + * 新增虚拟主机 | ||
131 | + * | ||
132 | + * @param virtualHost {@link VirtualHost} | ||
133 | + * @return {@link ResultJson} | ||
134 | + */ | ||
135 | + @PostMapping("/insert") | ||
136 | + public ResultJson insertVirtualHost(@RequestBody VirtualHost virtualHost) { | ||
137 | + //先验证,增加的虚拟主机的核心信息(虚拟主机名称)是否已存在 | ||
138 | + String message = validateVirtualHost(virtualHost); | ||
139 | + //验证通过 | ||
140 | + if (message == null) { | ||
141 | + ResultJson result = new ResultJson<>(); | ||
142 | + // 设置id | ||
143 | + virtualHost.setId(IdUtils.generateId()); | ||
144 | + int num = virtualHostService.insertSelective(virtualHost); | ||
145 | + if (num > 0) { | ||
146 | + result.setCode("200"); | ||
147 | + result.setMsg("添加虚拟主机信息,成功!"); | ||
148 | + } else { | ||
149 | + result.setCode("500"); | ||
150 | + result.setMsg("添加虚拟主机信息,失败!"); | ||
151 | + } | ||
152 | + return result; | ||
153 | + } | ||
154 | + return new ResultJson("400", message != null ? message : "添加虚拟主机信息,失败!"); | ||
155 | + } | ||
156 | + | ||
157 | + /** | ||
158 | + * 校验虚拟主机,添加和修改之前,是否已存在 | ||
159 | + * | ||
160 | + * @param virtualHost {@link VirtualHost} | ||
161 | + * @return 通过,无返回消息 | ||
162 | + */ | ||
163 | + private String validateVirtualHost(VirtualHost virtualHost) { | ||
164 | + if ("".equals(virtualHost.getVirtualHostName()) || virtualHost.getVirtualHostName() == null) { | ||
165 | + return "该虚拟主机信息中,没有虚拟主机名称"; | ||
166 | + } | ||
167 | + | ||
168 | + // 如果id不为空,则是 update 操作 | ||
169 | + if (virtualHost.getId() != null && virtualHost.getId().length() != 0) { | ||
170 | + // 根据 id 查询出原来的 虚拟主机 信息 | ||
171 | + VirtualHost oldVirtualHost = virtualHostService.selectByPrimaryKey(virtualHost.getId()); | ||
172 | + // 如果修改后的 virtualHostName,和原来的 virtualHostName 不一致,则校验 该 virtualHostName 是否已存在 | ||
173 | + if (!oldVirtualHost.getVirtualHostName().equals(virtualHost.getVirtualHostName())) { | ||
174 | + // 根据 virtualHostName,进行查询校验 | ||
175 | + List<VirtualHost> info = virtualHostService.validateVirtualHost(virtualHost); | ||
176 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
177 | + if (info.size() > 0) { | ||
178 | + return "该-虚拟主机(虚拟主机名称)-信息已存在,请谨慎输入"; | ||
179 | + } | ||
180 | + return null; | ||
181 | + } | ||
182 | + // virtualHostName 一致,则代表着没有修改 virtualHostName,校验通过 | ||
183 | + return null; | ||
184 | + } | ||
185 | + // 如果id为空,则是 insert 操作 | ||
186 | + else { | ||
187 | + // 根据 virtualHostName,进行查询校验 | ||
188 | + List<VirtualHost> info = virtualHostService.validateVirtualHost(virtualHost); | ||
189 | + // 多于0个,则代表已存在;否则则是,校验通过 | ||
190 | + if (info.size() > 0) { | ||
191 | + return "该-虚拟主机(虚拟主机名称)-信息已存在,请谨慎输入"; | ||
192 | + } | ||
193 | + return null; | ||
194 | + } | ||
195 | + } | ||
196 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:MQ路由交换表 | ||
14 | + * 时间:2020/7/1 10:08 | ||
15 | + */ | ||
16 | + | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@NoArgsConstructor | ||
20 | +public class BusExchange implements Serializable { | ||
21 | + | ||
22 | + private static final long serialVersionUID = -8533771450468596177L; | ||
23 | + | ||
24 | + /** | ||
25 | + * 交换机ID | ||
26 | + */ | ||
27 | + private String id; | ||
28 | + | ||
29 | + /** | ||
30 | + * 交换机名称 | ||
31 | + */ | ||
32 | + private String exchangeName; | ||
33 | + | ||
34 | + /** | ||
35 | + * 所属虚拟主机ID | ||
36 | + */ | ||
37 | + private String virtualHostId; | ||
38 | + | ||
39 | + /** | ||
40 | + * 交换机类型:Direct exchange、Fanout exchange、Topic exchange、Headers exchange | ||
41 | + */ | ||
42 | + private String exchangeType; | ||
43 | + | ||
44 | + /** | ||
45 | + * 是否持久化,默认true:1是true;0是false | ||
46 | + */ | ||
47 | + private Boolean durability; | ||
48 | + | ||
49 | + /** | ||
50 | + * 是否自动删除,默认false:1是true;0是false | ||
51 | + */ | ||
52 | + private Boolean autoDelete; | ||
53 | + | ||
54 | + /** | ||
55 | + * 是否是RabbitMQ内部使用,默认false:1是true;0是false | ||
56 | + */ | ||
57 | + private Boolean internal; | ||
58 | + | ||
59 | + /** | ||
60 | + * 扩展参数,以JSON格式存储 | ||
61 | + */ | ||
62 | + private String arguments; | ||
63 | + | ||
64 | + /** | ||
65 | + * 交换机相关描述 | ||
66 | + */ | ||
67 | + private String description; | ||
68 | + | ||
69 | + /** | ||
70 | + * 交换机创建时间 | ||
71 | + */ | ||
72 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
73 | + private Date gmtCreate; | ||
74 | + | ||
75 | + /** | ||
76 | + * 交换机修改时间 | ||
77 | + */ | ||
78 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
79 | + private Date gmtModified; | ||
80 | + | ||
81 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:队列表 | ||
14 | + * 时间:2020/7/1 10:14 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class BusQueue implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = 4347677784198350308L; | ||
22 | + | ||
23 | + /** | ||
24 | + * 队列的ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * 队列名称 | ||
30 | + */ | ||
31 | + private String queueName; | ||
32 | + | ||
33 | + /** | ||
34 | + * 所属虚拟主机ID | ||
35 | + */ | ||
36 | + private String virtualHostId; | ||
37 | + | ||
38 | + /** | ||
39 | + * 是否持久化,默认true:1是true;0是false | ||
40 | + */ | ||
41 | + private Boolean durability; | ||
42 | + | ||
43 | + /** | ||
44 | + * 是否自动删除,默认false:1是true;0是false | ||
45 | + */ | ||
46 | + private Boolean autoDelete; | ||
47 | + | ||
48 | + /** | ||
49 | + * 扩展参数,以JSON格式存储 | ||
50 | + */ | ||
51 | + private String arguments; | ||
52 | + | ||
53 | + /** | ||
54 | + * 队列相关描述 | ||
55 | + */ | ||
56 | + private String description; | ||
57 | + | ||
58 | + /** | ||
59 | + * 队列创建时间 | ||
60 | + */ | ||
61 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
62 | + private Date gmtCreate; | ||
63 | + | ||
64 | + /** | ||
65 | + * 队列修改时间 | ||
66 | + */ | ||
67 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
68 | + private Date gmtModified; | ||
69 | + | ||
70 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:MQ服务器静态信息表 | ||
14 | + * 时间:2020/7/1 10:02 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class BusServer implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = 1L; | ||
22 | + | ||
23 | + /** | ||
24 | + * 服务器ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * 服务器名称 | ||
30 | + */ | ||
31 | + private String serverName; | ||
32 | + | ||
33 | + /** | ||
34 | + * 服务器IP地址 | ||
35 | + */ | ||
36 | + private String serverIp; | ||
37 | + | ||
38 | + /** | ||
39 | + * 服务器端口号 | ||
40 | + */ | ||
41 | + private String serverPort; | ||
42 | + | ||
43 | + /** | ||
44 | + * 服务器相关描述 | ||
45 | + */ | ||
46 | + private String description; | ||
47 | + | ||
48 | + /** | ||
49 | + * 服务器创建时间 | ||
50 | + */ | ||
51 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
52 | + private Date gmtCreate; | ||
53 | + | ||
54 | + /** | ||
55 | + * 服务器修改时间 | ||
56 | + */ | ||
57 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
58 | + private Date gmtModified; | ||
59 | + | ||
60 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import lombok.AllArgsConstructor; | ||
7 | +import lombok.Data; | ||
8 | +import lombok.NoArgsConstructor; | ||
9 | + | ||
10 | +/** | ||
11 | + * @author 子诚 | ||
12 | + * Description:交换机、队列、routing_key绑定关系表 | ||
13 | + * 时间:2020/7/2 16:47 | ||
14 | + */ | ||
15 | + | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class ExchangeQueueRouting implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = 3765854915972798115L; | ||
22 | + | ||
23 | + /** | ||
24 | + * 交换机、队列、routing_key绑定关系的ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * 对应交换机ID | ||
30 | + */ | ||
31 | + private String exchangeId; | ||
32 | + | ||
33 | + /** | ||
34 | + * 对应队列的ID | ||
35 | + */ | ||
36 | + private String queueId; | ||
37 | + | ||
38 | + /** | ||
39 | + * 对应路由键的ID | ||
40 | + */ | ||
41 | + private String routingKeyId; | ||
42 | + | ||
43 | + /** | ||
44 | + * 对应路由键的名称 | ||
45 | + */ | ||
46 | + private String routingKeyName; | ||
47 | + | ||
48 | + /** | ||
49 | + * 创建时间 | ||
50 | + */ | ||
51 | + private Date gmtCreate; | ||
52 | + | ||
53 | + /** | ||
54 | + * 修改时间 | ||
55 | + */ | ||
56 | + private Date gmtModified; | ||
57 | + | ||
58 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:消息收发记录表(存储七天) | ||
14 | + * 时间:2020/7/2 15:21 | ||
15 | + */ | ||
16 | + | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@NoArgsConstructor | ||
20 | +public class MessageNote implements Serializable { | ||
21 | + | ||
22 | + private static final long serialVersionUID = 6971204112114471516L; | ||
23 | + | ||
24 | + /** | ||
25 | + * 消息收发记录表的ID | ||
26 | + */ | ||
27 | + private String id; | ||
28 | + | ||
29 | + /** | ||
30 | + * 用户的ID | ||
31 | + */ | ||
32 | + private String userId; | ||
33 | + | ||
34 | + /** | ||
35 | + * 用户登陆名称 | ||
36 | + */ | ||
37 | + private String username; | ||
38 | + | ||
39 | + /** | ||
40 | + * 服务器名称 | ||
41 | + */ | ||
42 | + private String serverName; | ||
43 | + | ||
44 | + /** | ||
45 | + * 虚拟主机名称 | ||
46 | + */ | ||
47 | + private String virtualHostName; | ||
48 | + | ||
49 | + /** | ||
50 | + * 交换机名称 | ||
51 | + */ | ||
52 | + private String exchangeName; | ||
53 | + | ||
54 | + /** | ||
55 | + * routing_key的名称 | ||
56 | + */ | ||
57 | + private String routingKeyName; | ||
58 | + | ||
59 | + /** | ||
60 | + * 队列名称 | ||
61 | + */ | ||
62 | + private String queueName; | ||
63 | + | ||
64 | + /** | ||
65 | + * 消息发送时间 | ||
66 | + */ | ||
67 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
68 | + private Date sendTime; | ||
69 | + | ||
70 | + /** | ||
71 | + * 消息获取时间 | ||
72 | + */ | ||
73 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
74 | + private Date receiveTime; | ||
75 | + | ||
76 | + /** | ||
77 | + * 发送消息内容 | ||
78 | + */ | ||
79 | + private byte[] sendContent; | ||
80 | + | ||
81 | + /** | ||
82 | + * 创建时间 | ||
83 | + */ | ||
84 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
85 | + private Date gmtCreate; | ||
86 | + | ||
87 | + /** | ||
88 | + * 修改时间 | ||
89 | + */ | ||
90 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
91 | + private Date gmtModified; | ||
92 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:Routing key静态配置表/二级类 | ||
14 | + * 时间:2020/6/29 16:45 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class RoutingKey implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = 4318583918719126325L; | ||
22 | + | ||
23 | + /** | ||
24 | + * routing_key的ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * routing_key的名称 | ||
30 | + */ | ||
31 | + private String routingKeyName; | ||
32 | + | ||
33 | + /** | ||
34 | + * 所属交换机ID | ||
35 | + */ | ||
36 | + private String exchangeId; | ||
37 | + | ||
38 | + /** | ||
39 | + * routing_key相关描述 | ||
40 | + */ | ||
41 | + private String description; | ||
42 | + | ||
43 | + /** | ||
44 | + * routing_key创建时间 | ||
45 | + */ | ||
46 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
47 | + private Date gmtCreate; | ||
48 | + | ||
49 | + /** | ||
50 | + * routing_key修改时间 | ||
51 | + */ | ||
52 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
53 | + private Date gmtModified; | ||
54 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:MQ账户信息表 | ||
14 | + * 时间:2020/6/29 17:17 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class UserInfo implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = -7311881151729617686L; | ||
22 | + | ||
23 | + /** | ||
24 | + * 用户的ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * 用户登陆名称 | ||
30 | + */ | ||
31 | + private String username; | ||
32 | + | ||
33 | + /** | ||
34 | + * 用户登陆密码 | ||
35 | + */ | ||
36 | + private String password; | ||
37 | + | ||
38 | + /** | ||
39 | + * 用户信息相关描述 | ||
40 | + */ | ||
41 | + private String description; | ||
42 | + | ||
43 | + /** | ||
44 | + * 用户信息创建时间 | ||
45 | + */ | ||
46 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
47 | + private Date gmtCreate; | ||
48 | + | ||
49 | + /** | ||
50 | + * 用户信息修改时间 | ||
51 | + */ | ||
52 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
53 | + private Date gmtModified; | ||
54 | + | ||
55 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:账户消息绑定配置表 | ||
14 | + * 时间:2020/6/29 17:37 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class UserMessageBinding implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = 1L; | ||
22 | + | ||
23 | + /** | ||
24 | + * 账户消息绑定配置表的ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * 所属用户登陆名称 | ||
30 | + */ | ||
31 | + private String username; | ||
32 | + | ||
33 | + /** | ||
34 | + * 所属虚拟主机名称 | ||
35 | + */ | ||
36 | + private String virtualHostName; | ||
37 | + | ||
38 | + /** | ||
39 | + * 所属交换机名称 | ||
40 | + */ | ||
41 | + private String exchangeName; | ||
42 | + | ||
43 | + /** | ||
44 | + * 所属队列名称 | ||
45 | + */ | ||
46 | + private String queueName; | ||
47 | + | ||
48 | + /** | ||
49 | + * 所属routing_key的名称 | ||
50 | + */ | ||
51 | + private String routingKeyName; | ||
52 | + | ||
53 | + /** | ||
54 | + * 订阅者 | ||
55 | + */ | ||
56 | + private String subscriber; | ||
57 | + | ||
58 | + /** | ||
59 | + * 创建时间 | ||
60 | + */ | ||
61 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
62 | + private Date gmtCreate; | ||
63 | + | ||
64 | + /** | ||
65 | + * 修改时间 | ||
66 | + */ | ||
67 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
68 | + private Date gmtModified; | ||
69 | + | ||
70 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:用户、服务器、虚拟机信息绑定关系表 | ||
14 | + * 时间:2020/7/2 11:35 | ||
15 | + */ | ||
16 | + | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@NoArgsConstructor | ||
20 | +public class UserServerVirtualHost implements Serializable { | ||
21 | + | ||
22 | + private static final long serialVersionUID = -7376053283857221145L; | ||
23 | + | ||
24 | + /** | ||
25 | + * 用户、服务器、虚拟机信息绑定关系的ID | ||
26 | + */ | ||
27 | + private String id; | ||
28 | + | ||
29 | + /** | ||
30 | + * 所属用户登陆名称 | ||
31 | + */ | ||
32 | + private String username; | ||
33 | + | ||
34 | + /** | ||
35 | + * 所属服务器ID | ||
36 | + */ | ||
37 | + private String serverId; | ||
38 | + | ||
39 | + /** | ||
40 | + * 所属虚拟主机ID | ||
41 | + */ | ||
42 | + private String virtualHostId; | ||
43 | + | ||
44 | + /** | ||
45 | + * 创建时间 | ||
46 | + */ | ||
47 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
48 | + private Date gmtCreate; | ||
49 | + | ||
50 | + /** | ||
51 | + * 修改时间 | ||
52 | + */ | ||
53 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
54 | + private Date gmtModified; | ||
55 | + | ||
56 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.domain; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Date; | ||
5 | + | ||
6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description:MQ虚拟主机名称表 | ||
14 | + * 时间:2020/6/29 16:36 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@NoArgsConstructor | ||
19 | +public class VirtualHost implements Serializable { | ||
20 | + | ||
21 | + private static final long serialVersionUID = -3174914872904776153L; | ||
22 | + | ||
23 | + /** | ||
24 | + * 虚拟主机ID | ||
25 | + */ | ||
26 | + private String id; | ||
27 | + | ||
28 | + /** | ||
29 | + * 虚拟主机名称 | ||
30 | + */ | ||
31 | + private String virtualHostName; | ||
32 | + | ||
33 | + /** | ||
34 | + * 所属服务器ID | ||
35 | + */ | ||
36 | + private String serverId; | ||
37 | + | ||
38 | + /** | ||
39 | + * 虚拟主机相关描述 | ||
40 | + */ | ||
41 | + private String description; | ||
42 | + | ||
43 | + /** | ||
44 | + * 虚拟主机创建时间 | ||
45 | + */ | ||
46 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
47 | + private Date gmtCreate; | ||
48 | + | ||
49 | + /** | ||
50 | + * 虚拟主机修改时间 | ||
51 | + */ | ||
52 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
53 | + private Date gmtModified; | ||
54 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/7/1 10:08 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface BusExchangeMapper { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(BusExchange record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(BusExchange record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + BusExchange selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,选择性,根据主键 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(BusExchange record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(BusExchange record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 查询交换机列表,选择性 | ||
66 | + * | ||
67 | + * @param busExchange 交换机以及参数 | ||
68 | + * @return 交换机列表 | ||
69 | + */ | ||
70 | + List<BusExchange> selectBusExchangeList(BusExchange busExchange); | ||
71 | + | ||
72 | + /** | ||
73 | + * 校验该服务器信息是否存在 | ||
74 | + * | ||
75 | + * @param busExchange {@link BusExchange} | ||
76 | + * @return List<BusExchange> | ||
77 | + */ | ||
78 | + List<BusExchange> validateBusExchange(BusExchange busExchange); | ||
79 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/7/1 10:14 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface BusQueueMapper { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(BusQueue record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(BusQueue record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + BusQueue selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,选择性,根据主键 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(BusQueue record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(BusQueue record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 查询,消息队列列表,选择性 | ||
66 | + * | ||
67 | + * @param busQueue 消息队列 {@link BusQueue} | ||
68 | + * @return List<BusQueue> | ||
69 | + */ | ||
70 | + List<BusQueue> selectBusQueueList(BusQueue busQueue); | ||
71 | + | ||
72 | + /** | ||
73 | + * 校验-消息队列,是否已存在 | ||
74 | + * | ||
75 | + * @param busQueue {@link BusQueue} | ||
76 | + * @return List<BusQueue> | ||
77 | + */ | ||
78 | + List<BusQueue> validateBusQueue(BusQueue busQueue); | ||
79 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/7/1 10:02 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface BusServerMapper { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(BusServer record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(BusServer record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + BusServer selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 查询服务器列表,选择性 | ||
50 | + * | ||
51 | + * @param busServer 服务器以及参数 | ||
52 | + * @return 服务器列表 | ||
53 | + */ | ||
54 | + List<BusServer> selectBusServerList(BusServer busServer); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,选择性,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKeySelective(BusServer record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 更新,根据主键 | ||
66 | + * | ||
67 | + * @param record the updated record | ||
68 | + * @return update count | ||
69 | + */ | ||
70 | + int updateByPrimaryKey(BusServer record); | ||
71 | + | ||
72 | + /** | ||
73 | + * 校验该服务器信息是否存在 | ||
74 | + * | ||
75 | + * @param busServer {@link BusServer} | ||
76 | + * @return List<BusServer> | ||
77 | + */ | ||
78 | + List<BusServer> validateBusServer(BusServer busServer); | ||
79 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * @author 子诚 | ||
8 | + * Description: | ||
9 | + * 时间:2020/7/2 16:47 | ||
10 | + */ | ||
11 | +@Mapper | ||
12 | +public interface ExchangeQueueRoutingMapper { | ||
13 | + /** | ||
14 | + * 删除,根据主键 | ||
15 | + * | ||
16 | + * @param id primaryKey | ||
17 | + * @return deleteCount | ||
18 | + */ | ||
19 | + int deleteByPrimaryKey(String id); | ||
20 | + | ||
21 | + /** | ||
22 | + * 新增 | ||
23 | + * | ||
24 | + * @param record the record | ||
25 | + * @return insert count | ||
26 | + */ | ||
27 | + int insert(ExchangeQueueRouting record); | ||
28 | + | ||
29 | + /** | ||
30 | + * 新增,选择性 | ||
31 | + * | ||
32 | + * @param record the record | ||
33 | + * @return insert count | ||
34 | + */ | ||
35 | + int insertSelective(ExchangeQueueRouting record); | ||
36 | + | ||
37 | + /** | ||
38 | + * 查询,根据主键 | ||
39 | + * | ||
40 | + * @param id primary key | ||
41 | + * @return object by primary key | ||
42 | + */ | ||
43 | + ExchangeQueueRouting selectByPrimaryKey(String id); | ||
44 | + | ||
45 | + /** | ||
46 | + * 更新,根据主键,选择性 | ||
47 | + * | ||
48 | + * @param record the updated record | ||
49 | + * @return update count | ||
50 | + */ | ||
51 | + int updateByPrimaryKeySelective(ExchangeQueueRouting record); | ||
52 | + | ||
53 | + /** | ||
54 | + * 更新,根据主键 | ||
55 | + * | ||
56 | + * @param record the updated record | ||
57 | + * @return update count | ||
58 | + */ | ||
59 | + int updateByPrimaryKey(ExchangeQueueRouting record); | ||
60 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.MessageNote; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/7/2 15:21 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface MessageNoteMapper { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(MessageNote record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(MessageNote record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + MessageNote selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,根据主键,选择性 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(MessageNote record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(MessageNote record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 获取,消息收发记录-列表 | ||
66 | + * | ||
67 | + * @param messageNote {@link MessageNote} | ||
68 | + * @return List<MessageNote> | ||
69 | + */ | ||
70 | + List<MessageNote> selectMessageNoteList(MessageNote messageNote); | ||
71 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.RoutingKey; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/6/29 16:45 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface RoutingKeyMapper { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(RoutingKey record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(RoutingKey record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + RoutingKey selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,选择性,根据主键 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(RoutingKey record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(RoutingKey record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 查询,路由键列表,选择性 | ||
66 | + * | ||
67 | + * @param routingKey 路由键参数类 | ||
68 | + * @return List<RoutingKey> {@link RoutingKey} | ||
69 | + */ | ||
70 | + List<RoutingKey> selectRoutingKeyList(RoutingKey routingKey); | ||
71 | + | ||
72 | + /** | ||
73 | + * 校验,路由键是否已存在 | ||
74 | + * | ||
75 | + * @param routingKey 路由键 {@link RoutingKey} | ||
76 | + * @return List<RoutingKey> | ||
77 | + */ | ||
78 | + List<RoutingKey> validateRoutingKey(RoutingKey routingKey); | ||
79 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.UserInfo; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * @author 子诚 | ||
8 | + * Description: | ||
9 | + * 时间:2020/6/29 17:17 | ||
10 | + */ | ||
11 | +@Mapper | ||
12 | +public interface UserInfoMapper { | ||
13 | + | ||
14 | + /** | ||
15 | + * 删除,根据主键 | ||
16 | + * | ||
17 | + * @param id primaryKey | ||
18 | + * @return deleteCount | ||
19 | + */ | ||
20 | + int deleteByPrimaryKey(String id); | ||
21 | + | ||
22 | + /** | ||
23 | + * 新增 | ||
24 | + * | ||
25 | + * @param record the record | ||
26 | + * @return insert count | ||
27 | + */ | ||
28 | + int insert(UserInfo record); | ||
29 | + | ||
30 | + /** | ||
31 | + * 新增,选择性 | ||
32 | + * | ||
33 | + * @param record the record | ||
34 | + * @return insert count | ||
35 | + */ | ||
36 | + int insertSelective(UserInfo record); | ||
37 | + | ||
38 | + /** | ||
39 | + * 查询,根据主键 | ||
40 | + * | ||
41 | + * @param id primary key | ||
42 | + * @return object by primary key | ||
43 | + */ | ||
44 | + UserInfo selectByPrimaryKey(String id); | ||
45 | + | ||
46 | + /** | ||
47 | + * 更新,选择性,根据主键 | ||
48 | + * | ||
49 | + * @param record the updated record | ||
50 | + * @return update count | ||
51 | + */ | ||
52 | + int updateByPrimaryKeySelective(UserInfo record); | ||
53 | + | ||
54 | + /** | ||
55 | + * 更新,根据主键 | ||
56 | + * | ||
57 | + * @param record the updated record | ||
58 | + * @return update count | ||
59 | + */ | ||
60 | + int updateByPrimaryKey(UserInfo record); | ||
61 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/6/29 17:37 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface UserMessageBindingMapper { | ||
15 | + /** | ||
16 | + * 根据主键删除 | ||
17 | + * | ||
18 | + * @param id primaryKey | ||
19 | + * @return deleteCount | ||
20 | + */ | ||
21 | + int deleteByPrimaryKey(String id); | ||
22 | + | ||
23 | + /** | ||
24 | + * 新增 | ||
25 | + * | ||
26 | + * @param record the record | ||
27 | + * @return insert count | ||
28 | + */ | ||
29 | + int insert(UserMessageBinding record); | ||
30 | + | ||
31 | + /** | ||
32 | + * 选择性增加 | ||
33 | + * | ||
34 | + * @param record the record | ||
35 | + * @return insert count | ||
36 | + */ | ||
37 | + int insertSelective(UserMessageBinding record); | ||
38 | + | ||
39 | + /** | ||
40 | + * 根据主键查询 | ||
41 | + * | ||
42 | + * @param id primary key | ||
43 | + * @return object by primary key | ||
44 | + */ | ||
45 | + UserMessageBinding selectByPrimaryKey(String id); | ||
46 | + | ||
47 | + /** | ||
48 | + * 选择性更新,根据主键 | ||
49 | + * | ||
50 | + * @param record the updated record | ||
51 | + * @return update count | ||
52 | + */ | ||
53 | + int updateByPrimaryKeySelective(UserMessageBinding record); | ||
54 | + | ||
55 | + /** | ||
56 | + * 根据主键更新 | ||
57 | + * | ||
58 | + * @param record the updated record | ||
59 | + * @return update count | ||
60 | + */ | ||
61 | + int updateByPrimaryKey(UserMessageBinding record); | ||
62 | + | ||
63 | + /** | ||
64 | + * 分页查询,获取账户信息绑定配置列表 | ||
65 | + * | ||
66 | + * @param userMessageBinding {@link UserMessageBinding} | ||
67 | + * @return List<UserMessageBinding> | ||
68 | + */ | ||
69 | + List<UserMessageBinding> selectUserMessageBindingList(UserMessageBinding userMessageBinding); | ||
70 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * @author 子诚 | ||
8 | + * Description: | ||
9 | + * 时间:2020/7/2 11:35 | ||
10 | + */ | ||
11 | +@Mapper | ||
12 | +public interface UserServerVirtualHostMapper { | ||
13 | + /** | ||
14 | + * 删除,根据主键 | ||
15 | + * | ||
16 | + * @param id primaryKey | ||
17 | + * @return deleteCount | ||
18 | + */ | ||
19 | + int deleteByPrimaryKey(String id); | ||
20 | + | ||
21 | + /** | ||
22 | + * 新增 | ||
23 | + * | ||
24 | + * @param record the record | ||
25 | + * @return insert count | ||
26 | + */ | ||
27 | + int insert(UserServerVirtualHost record); | ||
28 | + | ||
29 | + /** | ||
30 | + * 新增,选择性 | ||
31 | + * | ||
32 | + * @param record the record | ||
33 | + * @return insert count | ||
34 | + */ | ||
35 | + int insertSelective(UserServerVirtualHost record); | ||
36 | + | ||
37 | + /** | ||
38 | + * 查询,根据主键 | ||
39 | + * | ||
40 | + * @param id primary key | ||
41 | + * @return object by primary key | ||
42 | + */ | ||
43 | + UserServerVirtualHost selectByPrimaryKey(String id); | ||
44 | + | ||
45 | + /** | ||
46 | + * 更新,选择性,根据主键 | ||
47 | + * | ||
48 | + * @param record the updated record | ||
49 | + * @return update count | ||
50 | + */ | ||
51 | + int updateByPrimaryKeySelective(UserServerVirtualHost record); | ||
52 | + | ||
53 | + /** | ||
54 | + * 更新,根据主键 | ||
55 | + * | ||
56 | + * @param record the updated record | ||
57 | + * @return update count | ||
58 | + */ | ||
59 | + int updateByPrimaryKey(UserServerVirtualHost record); | ||
60 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.mapper; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.VirtualHost; | ||
4 | +import org.apache.ibatis.annotations.Mapper; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/6/29 16:36 | ||
12 | + */ | ||
13 | +@Mapper | ||
14 | +public interface VirtualHostMapper { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(VirtualHost record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(VirtualHost record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + VirtualHost selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,选择性,根据主键 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(VirtualHost record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(VirtualHost record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 查询虚拟主机列表,选择性 | ||
66 | + * | ||
67 | + * @param virtualHost 虚拟主机,参数 | ||
68 | + * @return 虚拟主机列表 | ||
69 | + */ | ||
70 | + List<VirtualHost> selectVirtualHostList(VirtualHost virtualHost); | ||
71 | + | ||
72 | + /** | ||
73 | + * 校验该服务器信息是否存在 | ||
74 | + * | ||
75 | + * @param virtualHost {@link VirtualHost} | ||
76 | + * @return List<VirtualHost> | ||
77 | + */ | ||
78 | + List<VirtualHost> validateVirtualHost(VirtualHost virtualHost); | ||
79 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.rabbit; | ||
2 | + | ||
3 | +import com.rabbitmq.client.Channel; | ||
4 | +import com.rabbitmq.client.Connection; | ||
5 | +import com.rabbitmq.client.ConnectionFactory; | ||
6 | + | ||
7 | +/** | ||
8 | + * @author 子诚 | ||
9 | + * Description:RabbitMQ 的工具类 | ||
10 | + * 时间:2020/6/30 9:39 | ||
11 | + */ | ||
12 | +public class RabbitUtils { | ||
13 | + | ||
14 | + /** | ||
15 | + * 链接 RabbitMQ | ||
16 | + * | ||
17 | + * @param hostIp mq服务器Ip地址 | ||
18 | + * @param hostPort mq服务器端口号 | ||
19 | + * @param vHostName VirtualHost名称 | ||
20 | + * @param userName 登录账号 | ||
21 | + * @param password 登录密码 | ||
22 | + * @return 返回链接 | ||
23 | + * @throws Exception | ||
24 | + */ | ||
25 | + public static Connection getConnection(String hostIp, int hostPort, String vHostName, String userName, String password) throws Exception { | ||
26 | + //定义连接工厂 | ||
27 | + ConnectionFactory factory = new ConnectionFactory(); | ||
28 | + //设置服务地址 | ||
29 | + factory.setHost(hostIp); | ||
30 | + //端口 | ||
31 | + factory.setPort(hostPort); | ||
32 | + //设置账号信息,用户名、密码、vhost | ||
33 | + factory.setVirtualHost(vHostName); | ||
34 | + factory.setUsername(userName); | ||
35 | + factory.setPassword(password); | ||
36 | + // 通过工程获取连接 | ||
37 | + Connection connection = factory.newConnection(); | ||
38 | + return connection; | ||
39 | + } | ||
40 | + | ||
41 | + /** | ||
42 | + * 关闭通道和关闭连接的工具方法 | ||
43 | + * | ||
44 | + * @param channel 通道 | ||
45 | + * @param conn 连接 | ||
46 | + */ | ||
47 | + public static void closeConnectionAndChanel(Channel channel, Connection conn) { | ||
48 | + try { | ||
49 | + if (channel != null) { | ||
50 | + channel.close(); | ||
51 | + } | ||
52 | + if (conn != null) { | ||
53 | + conn.close(); | ||
54 | + } | ||
55 | + } catch (Exception e) { | ||
56 | + e.printStackTrace(); | ||
57 | + } | ||
58 | + } | ||
59 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.response; | ||
2 | + | ||
3 | +import lombok.Data; | ||
4 | + | ||
5 | +import java.io.Serializable; | ||
6 | + | ||
7 | +/** | ||
8 | + * @author 子诚 | ||
9 | + * Description:返回结果封装类 | ||
10 | + * 时间:2020/7/01 10:06 | ||
11 | + */ | ||
12 | +@Data | ||
13 | +public class ResultJson<T> implements Serializable { | ||
14 | + | ||
15 | + private static final long serialVersionUID = 1L; | ||
16 | + | ||
17 | + /** | ||
18 | + * 响应业务状态,默认为200 | ||
19 | + */ | ||
20 | + private String code; | ||
21 | + | ||
22 | + /** | ||
23 | + * 响应消息 | ||
24 | + */ | ||
25 | + private String msg = ""; | ||
26 | + | ||
27 | + /** | ||
28 | + * 错误消息内容 | ||
29 | + */ | ||
30 | + private String error; | ||
31 | + | ||
32 | + /** | ||
33 | + * 响应数据 | ||
34 | + */ | ||
35 | + private T data; | ||
36 | + | ||
37 | + /** | ||
38 | + * JWT令牌 | ||
39 | + */ | ||
40 | + private String jwtToken; | ||
41 | + | ||
42 | + /** | ||
43 | + * 无参,构造方法 | ||
44 | + */ | ||
45 | + public ResultJson() { | ||
46 | + } | ||
47 | + | ||
48 | + /** | ||
49 | + * 有参,构造方法; | ||
50 | + * 重载 | ||
51 | + */ | ||
52 | + public ResultJson(String code) { | ||
53 | + this.code = code; | ||
54 | + } | ||
55 | + | ||
56 | + public ResultJson(T data) { | ||
57 | + this.data = data; | ||
58 | + } | ||
59 | + | ||
60 | + public ResultJson(String code, String msg) { | ||
61 | + this.code = code; | ||
62 | + this.msg = msg; | ||
63 | + } | ||
64 | + | ||
65 | + public ResultJson(String code, String msg, T data) { | ||
66 | + this.code = code; | ||
67 | + this.msg = msg; | ||
68 | + this.data = data; | ||
69 | + } | ||
70 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.VirtualHost; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * @author 子诚 | ||
11 | + * Description: | ||
12 | + * 时间:2020/7/1 10:08 | ||
13 | + */ | ||
14 | +public interface BusExchangeService { | ||
15 | + | ||
16 | + | ||
17 | + /** | ||
18 | + * 删除,根据主键 | ||
19 | + * | ||
20 | + * @param id primaryKey | ||
21 | + * @return deleteCount | ||
22 | + */ | ||
23 | + int deleteByPrimaryKey(String id); | ||
24 | + | ||
25 | + /** | ||
26 | + * 新增 | ||
27 | + * | ||
28 | + * @param record the record | ||
29 | + * @return insert count | ||
30 | + */ | ||
31 | + int insert(BusExchange record); | ||
32 | + | ||
33 | + /** | ||
34 | + * 新增,选择性 | ||
35 | + * | ||
36 | + * @param record the record | ||
37 | + * @return insert count | ||
38 | + */ | ||
39 | + int insertSelective(BusExchange record); | ||
40 | + | ||
41 | + /** | ||
42 | + * 查询,根据主键 | ||
43 | + * | ||
44 | + * @param id primary key | ||
45 | + * @return object by primary key | ||
46 | + */ | ||
47 | + BusExchange selectByPrimaryKey(String id); | ||
48 | + | ||
49 | + /** | ||
50 | + * 更新,选择性,根据主键 | ||
51 | + * | ||
52 | + * @param record the updated record | ||
53 | + * @return update count | ||
54 | + */ | ||
55 | + int updateByPrimaryKeySelective(BusExchange record); | ||
56 | + | ||
57 | + /** | ||
58 | + * 更新,根据主键 | ||
59 | + * | ||
60 | + * @param record the updated record | ||
61 | + * @return update count | ||
62 | + */ | ||
63 | + int updateByPrimaryKey(BusExchange record); | ||
64 | + | ||
65 | + /** | ||
66 | + * 分页查询交换机列表 | ||
67 | + * | ||
68 | + * @param busExchange {@link BusExchange} | ||
69 | + * @param pageNum 当前页数 | ||
70 | + * @param pageSize 每页数量 | ||
71 | + * @return MQ交换机列表 | ||
72 | + */ | ||
73 | + PageInfo selectBusExchangeList(BusExchange busExchange, Integer pageNum, Integer pageSize); | ||
74 | + | ||
75 | + /** | ||
76 | + * 校验该服务器信息是否存在 | ||
77 | + * | ||
78 | + * @param busExchange {@link BusExchange} | ||
79 | + * @return List<BusExchange> | ||
80 | + */ | ||
81 | + List<BusExchange> validateBusExchange(BusExchange busExchange); | ||
82 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/7/1 10:14 | ||
12 | + */ | ||
13 | +public interface BusQueueService { | ||
14 | + | ||
15 | + /** | ||
16 | + * 删除,根据主键 | ||
17 | + * | ||
18 | + * @param id primaryKey | ||
19 | + * @return deleteCount | ||
20 | + */ | ||
21 | + int deleteByPrimaryKey(String id); | ||
22 | + | ||
23 | + /** | ||
24 | + * 新增 | ||
25 | + * | ||
26 | + * @param record the record | ||
27 | + * @return insert count | ||
28 | + */ | ||
29 | + int insert(BusQueue record); | ||
30 | + | ||
31 | + /** | ||
32 | + * 新增,选择性 | ||
33 | + * | ||
34 | + * @param record the record | ||
35 | + * @return insert count | ||
36 | + */ | ||
37 | + int insertSelective(BusQueue record); | ||
38 | + | ||
39 | + /** | ||
40 | + * 查询,根据主键 | ||
41 | + * | ||
42 | + * @param id primary key | ||
43 | + * @return object by primary key | ||
44 | + */ | ||
45 | + BusQueue selectByPrimaryKey(String id); | ||
46 | + | ||
47 | + /** | ||
48 | + * 更新,选择性,根据主键 | ||
49 | + * | ||
50 | + * @param record the updated record | ||
51 | + * @return update count | ||
52 | + */ | ||
53 | + int updateByPrimaryKeySelective(BusQueue record); | ||
54 | + | ||
55 | + /** | ||
56 | + * 更新,根据主键 | ||
57 | + * | ||
58 | + * @param record the updated record | ||
59 | + * @return update count | ||
60 | + */ | ||
61 | + int updateByPrimaryKey(BusQueue record); | ||
62 | + | ||
63 | + /** | ||
64 | + * 分页查询,消息队列-列表 | ||
65 | + * | ||
66 | + * @param busQueue 消息队列 | ||
67 | + * @param pageNum 当前页数 | ||
68 | + * @param pageSize 每页条数 | ||
69 | + * @return 消息队列-列表 | ||
70 | + */ | ||
71 | + PageInfo selectBusQueueList(BusQueue busQueue, Integer pageNum, Integer pageSize); | ||
72 | + | ||
73 | + /** | ||
74 | + * 校验-消息队列,是否已存在 | ||
75 | + * | ||
76 | + * @param busQueue {@link BusQueue} | ||
77 | + * @return List<BusQueue> | ||
78 | + */ | ||
79 | + List<BusQueue> validateBusQueue(BusQueue busQueue); | ||
80 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author 子诚 | ||
10 | + * Description: | ||
11 | + * 时间:2020/7/1 10:02 | ||
12 | + */ | ||
13 | +public interface BusServerService { | ||
14 | + | ||
15 | + /** | ||
16 | + * 删除,根据主键 | ||
17 | + * | ||
18 | + * @param id primaryKey | ||
19 | + * @return deleteCount | ||
20 | + */ | ||
21 | + int deleteByPrimaryKey(String id); | ||
22 | + | ||
23 | + /** | ||
24 | + * 新增 | ||
25 | + * | ||
26 | + * @param record the record | ||
27 | + * @return insert count | ||
28 | + */ | ||
29 | + int insert(BusServer record); | ||
30 | + | ||
31 | + /** | ||
32 | + * 新增,选择性 | ||
33 | + * | ||
34 | + * @param record the record | ||
35 | + * @return insert count | ||
36 | + */ | ||
37 | + int insertSelective(BusServer record); | ||
38 | + | ||
39 | + /** | ||
40 | + * 查询,根据主键 | ||
41 | + * | ||
42 | + * @param id primary key | ||
43 | + * @return object by primary key | ||
44 | + */ | ||
45 | + BusServer selectByPrimaryKey(String id); | ||
46 | + | ||
47 | + /** | ||
48 | + * 更新,选择性,根据主键 | ||
49 | + * | ||
50 | + * @param record the updated record | ||
51 | + * @return update count | ||
52 | + */ | ||
53 | + int updateByPrimaryKeySelective(BusServer record); | ||
54 | + | ||
55 | + /** | ||
56 | + * 更新,根据主键 | ||
57 | + * | ||
58 | + * @param record the updated record | ||
59 | + * @return update count | ||
60 | + */ | ||
61 | + int updateByPrimaryKey(BusServer record); | ||
62 | + | ||
63 | + /** | ||
64 | + * 分页查询服务器列表 | ||
65 | + * | ||
66 | + * @param busServer 参数 | ||
67 | + * @param pageNum 当前页数 | ||
68 | + * @param pageSize 每页数量 | ||
69 | + * @return MQ服务器列表 | ||
70 | + */ | ||
71 | + PageInfo selectBusServerList(BusServer busServer, Integer pageNum, Integer pageSize); | ||
72 | + | ||
73 | + /** | ||
74 | + * 校验该服务器信息是否存在 | ||
75 | + * | ||
76 | + * @param busServer {@link BusServer} | ||
77 | + * @return List<BusServer> | ||
78 | + */ | ||
79 | + List<BusServer> validateBusServer(BusServer busServer); | ||
80 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/ExchangeQueueRoutingService.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting; | ||
4 | + | ||
5 | +/** | ||
6 | + * @author 子诚 | ||
7 | + * Description: | ||
8 | + * 时间:2020/6/29 17:07 | ||
9 | + */ | ||
10 | +public interface ExchangeQueueRoutingService { | ||
11 | + | ||
12 | + /** | ||
13 | + * 删除,根据主键 | ||
14 | + * | ||
15 | + * @param id primaryKey | ||
16 | + * @return deleteCount | ||
17 | + */ | ||
18 | + int deleteByPrimaryKey(String id); | ||
19 | + | ||
20 | + /** | ||
21 | + * 新增 | ||
22 | + * | ||
23 | + * @param record the record | ||
24 | + * @return insert count | ||
25 | + */ | ||
26 | + int insert(ExchangeQueueRouting record); | ||
27 | + | ||
28 | + /** | ||
29 | + * 新增,选择性 | ||
30 | + * | ||
31 | + * @param record the record | ||
32 | + * @return insert count | ||
33 | + */ | ||
34 | + int insertSelective(ExchangeQueueRouting record); | ||
35 | + | ||
36 | + /** | ||
37 | + * 查询,根据主键 | ||
38 | + * | ||
39 | + * @param id primary key | ||
40 | + * @return object by primary key | ||
41 | + */ | ||
42 | + ExchangeQueueRouting selectByPrimaryKey(String id); | ||
43 | + | ||
44 | + /** | ||
45 | + * 更新,选择性,根据主键 | ||
46 | + * | ||
47 | + * @param record the updated record | ||
48 | + * @return update count | ||
49 | + */ | ||
50 | + int updateByPrimaryKeySelective(ExchangeQueueRouting record); | ||
51 | + | ||
52 | + /** | ||
53 | + * 更新,根据主键 | ||
54 | + * | ||
55 | + * @param record the updated record | ||
56 | + * @return update count | ||
57 | + */ | ||
58 | + int updateByPrimaryKey(ExchangeQueueRouting record); | ||
59 | + | ||
60 | +} | ||
61 | + | ||
62 | + |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.MessageNote; | ||
5 | + | ||
6 | +/** | ||
7 | + * @author 子诚 | ||
8 | + * Description: | ||
9 | + * 时间:2020/6/29 17:46 | ||
10 | + */ | ||
11 | +public interface MessageNoteService { | ||
12 | + | ||
13 | + /** | ||
14 | + * 删除,根据主键 | ||
15 | + * | ||
16 | + * @param id primaryKey | ||
17 | + * @return deleteCount | ||
18 | + */ | ||
19 | + int deleteByPrimaryKey(String id); | ||
20 | + | ||
21 | + /** | ||
22 | + * 新增 | ||
23 | + * | ||
24 | + * @param record the record | ||
25 | + * @return insert count | ||
26 | + */ | ||
27 | + int insert(MessageNote record); | ||
28 | + | ||
29 | + /** | ||
30 | + * 新增,选择性 | ||
31 | + * | ||
32 | + * @param record the record | ||
33 | + * @return insert count | ||
34 | + */ | ||
35 | + int insertSelective(MessageNote record); | ||
36 | + | ||
37 | + /** | ||
38 | + * 查询,根据主键 | ||
39 | + * | ||
40 | + * @param id primary key | ||
41 | + * @return object by primary key | ||
42 | + */ | ||
43 | + MessageNote selectByPrimaryKey(String id); | ||
44 | + | ||
45 | + /** | ||
46 | + * 更新,选择性,根据主键 | ||
47 | + * | ||
48 | + * @param record the updated record | ||
49 | + * @return update count | ||
50 | + */ | ||
51 | + int updateByPrimaryKeySelective(MessageNote record); | ||
52 | + | ||
53 | + /** | ||
54 | + * 更新,根据主键 | ||
55 | + * | ||
56 | + * @param record the updated record | ||
57 | + * @return update count | ||
58 | + */ | ||
59 | + int updateByPrimaryKey(MessageNote record); | ||
60 | + | ||
61 | + /** | ||
62 | + * 分页查询,消息收发记录 | ||
63 | + * | ||
64 | + * @param messageNote {@link MessageNote} | ||
65 | + * @param pageNum 当前页数,默认 1 | ||
66 | + * @param pageSize 每页条数,默认 10 | ||
67 | + * @return 消息收发记录-列表 | ||
68 | + */ | ||
69 | + PageInfo selectMessageNoteList(MessageNote messageNote, Integer pageNum, Integer pageSize); | ||
70 | +} | ||
71 | + |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.RoutingKey; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * @author 子诚 | ||
11 | + * Description: | ||
12 | + * 时间:2020/6/29 16:45 | ||
13 | + */ | ||
14 | +public interface RoutingKeyService { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(RoutingKey record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(RoutingKey record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + RoutingKey selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,选择性,根据主键 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(RoutingKey record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(RoutingKey record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 分页查询,路由键列表 | ||
66 | + * | ||
67 | + * @param routingKey 路由键 {@link RoutingKey} | ||
68 | + * @param pageNum 当前页数 | ||
69 | + * @param pageSize 每页数量 | ||
70 | + * @return 路由键列表 | ||
71 | + */ | ||
72 | + PageInfo selectRoutingKeyList(RoutingKey routingKey, Integer pageNum, Integer pageSize); | ||
73 | + | ||
74 | + /** | ||
75 | + * 校验,路由键是否已存在 | ||
76 | + * | ||
77 | + * @param routingKey 路由键 {@link RoutingKey} | ||
78 | + * @return List<RoutingKey> | ||
79 | + */ | ||
80 | + List<RoutingKey> validateRoutingKey(RoutingKey routingKey); | ||
81 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.UserInfo; | ||
4 | + | ||
5 | +/** | ||
6 | + * @author 子诚 | ||
7 | + * Description: | ||
8 | + * 时间:2020/6/29 17:15 | ||
9 | + */ | ||
10 | +public interface UserInfoService { | ||
11 | + | ||
12 | + /** | ||
13 | + * 删除,根据主键 | ||
14 | + * | ||
15 | + * @param id primaryKey | ||
16 | + * @return deleteCount | ||
17 | + */ | ||
18 | + int deleteByPrimaryKey(String id); | ||
19 | + | ||
20 | + /** | ||
21 | + * 新增 | ||
22 | + * | ||
23 | + * @param record the record | ||
24 | + * @return insert count | ||
25 | + */ | ||
26 | + int insert(UserInfo record); | ||
27 | + | ||
28 | + /** | ||
29 | + * 新增,选择性 | ||
30 | + * | ||
31 | + * @param record the record | ||
32 | + * @return insert count | ||
33 | + */ | ||
34 | + int insertSelective(UserInfo record); | ||
35 | + | ||
36 | + /** | ||
37 | + * 查询,根据主键 | ||
38 | + * | ||
39 | + * @param id primary key | ||
40 | + * @return object by primary key | ||
41 | + */ | ||
42 | + UserInfo selectByPrimaryKey(String id); | ||
43 | + | ||
44 | + /** | ||
45 | + * 更新,选择性,根据主键 | ||
46 | + * | ||
47 | + * @param record the updated record | ||
48 | + * @return update count | ||
49 | + */ | ||
50 | + int updateByPrimaryKeySelective(UserInfo record); | ||
51 | + | ||
52 | + /** | ||
53 | + * 更新,根据主键 | ||
54 | + * | ||
55 | + * @param record the updated record | ||
56 | + * @return update count | ||
57 | + */ | ||
58 | + int updateByPrimaryKey(UserInfo record); | ||
59 | +} | ||
60 | + |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding; | ||
5 | + | ||
6 | +/** | ||
7 | + * @author 子诚 | ||
8 | + * Description: | ||
9 | + * 时间:2020/6/29 17:37 | ||
10 | + */ | ||
11 | +public interface UserMessageBindingService { | ||
12 | + /** | ||
13 | + * 根据主键删除 | ||
14 | + * | ||
15 | + * @param id primaryKey | ||
16 | + * @return deleteCount | ||
17 | + */ | ||
18 | + int deleteByPrimaryKey(String id); | ||
19 | + | ||
20 | + /** | ||
21 | + * 新增 | ||
22 | + * | ||
23 | + * @param record the record | ||
24 | + * @return insert count | ||
25 | + */ | ||
26 | + int insert(UserMessageBinding record); | ||
27 | + | ||
28 | + /** | ||
29 | + * 选择性增加 | ||
30 | + * | ||
31 | + * @param record the record | ||
32 | + * @return insert count | ||
33 | + */ | ||
34 | + int insertSelective(UserMessageBinding record); | ||
35 | + | ||
36 | + /** | ||
37 | + * 根据主键查询 | ||
38 | + * | ||
39 | + * @param id primary key | ||
40 | + * @return object by primary key | ||
41 | + */ | ||
42 | + UserMessageBinding selectByPrimaryKey(String id); | ||
43 | + | ||
44 | + /** | ||
45 | + * 选择性更新,根据主键 | ||
46 | + * | ||
47 | + * @param record the updated record | ||
48 | + * @return update count | ||
49 | + */ | ||
50 | + int updateByPrimaryKeySelective(UserMessageBinding record); | ||
51 | + | ||
52 | + /** | ||
53 | + * 根据主键更新 | ||
54 | + * | ||
55 | + * @param record the updated record | ||
56 | + * @return update count | ||
57 | + */ | ||
58 | + int updateByPrimaryKey(UserMessageBinding record); | ||
59 | + | ||
60 | + /** | ||
61 | + * 分页查询 | ||
62 | + * | ||
63 | + * @param userMessageBinding {@link UserMessageBinding} | ||
64 | + * @param pageNum 当前页数 | ||
65 | + * @param pageSize 每页条数 | ||
66 | + * @return PageInfo | ||
67 | + */ | ||
68 | + PageInfo selectUserMessageBindingList(UserMessageBinding userMessageBinding, Integer pageNum, Integer pageSize); | ||
69 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/UserServerVirtualHostService.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost; | ||
4 | + | ||
5 | +/** | ||
6 | + * @author 子诚 | ||
7 | + * Description: | ||
8 | + * 时间:2020/6/29 17:31 | ||
9 | + */ | ||
10 | +public interface UserServerVirtualHostService { | ||
11 | + /** | ||
12 | + * 根据主键删除 | ||
13 | + * | ||
14 | + * @param id primaryKey | ||
15 | + * @return deleteCount | ||
16 | + */ | ||
17 | + int deleteByPrimaryKey(String id); | ||
18 | + | ||
19 | + /** | ||
20 | + * 新增 | ||
21 | + * | ||
22 | + * @param record the record | ||
23 | + * @return insert count | ||
24 | + */ | ||
25 | + int insert(UserServerVirtualHost record); | ||
26 | + | ||
27 | + /** | ||
28 | + * 选择性增加 | ||
29 | + * | ||
30 | + * @param record the record | ||
31 | + * @return insert count | ||
32 | + */ | ||
33 | + int insertSelective(UserServerVirtualHost record); | ||
34 | + | ||
35 | + /** | ||
36 | + * 根据主键查询 | ||
37 | + * | ||
38 | + * @param id primary key | ||
39 | + * @return object by primary key | ||
40 | + */ | ||
41 | + UserServerVirtualHost selectByPrimaryKey(String id); | ||
42 | + | ||
43 | + /** | ||
44 | + * 选择性更新,根据主键 | ||
45 | + * | ||
46 | + * @param record the updated record | ||
47 | + * @return update count | ||
48 | + */ | ||
49 | + int updateByPrimaryKeySelective(UserServerVirtualHost record); | ||
50 | + | ||
51 | + /** | ||
52 | + * 根据主键更新 | ||
53 | + * | ||
54 | + * @param record the updated record | ||
55 | + * @return update count | ||
56 | + */ | ||
57 | + int updateByPrimaryKey(UserServerVirtualHost record); | ||
58 | + | ||
59 | +} | ||
60 | + |
1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageInfo; | ||
4 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.VirtualHost; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * @author 子诚 | ||
11 | + * Description: | ||
12 | + * 时间:2020/6/29 16:36 | ||
13 | + */ | ||
14 | +public interface VirtualHostService { | ||
15 | + | ||
16 | + /** | ||
17 | + * 删除,根据主键 | ||
18 | + * | ||
19 | + * @param id primaryKey | ||
20 | + * @return deleteCount | ||
21 | + */ | ||
22 | + int deleteByPrimaryKey(String id); | ||
23 | + | ||
24 | + /** | ||
25 | + * 新增 | ||
26 | + * | ||
27 | + * @param record the record | ||
28 | + * @return insert count | ||
29 | + */ | ||
30 | + int insert(VirtualHost record); | ||
31 | + | ||
32 | + /** | ||
33 | + * 新增,选择性 | ||
34 | + * | ||
35 | + * @param record the record | ||
36 | + * @return insert count | ||
37 | + */ | ||
38 | + int insertSelective(VirtualHost record); | ||
39 | + | ||
40 | + /** | ||
41 | + * 查询,根据主键 | ||
42 | + * | ||
43 | + * @param id primary key | ||
44 | + * @return object by primary key | ||
45 | + */ | ||
46 | + VirtualHost selectByPrimaryKey(String id); | ||
47 | + | ||
48 | + /** | ||
49 | + * 更新,选择性,根据主键 | ||
50 | + * | ||
51 | + * @param record the updated record | ||
52 | + * @return update count | ||
53 | + */ | ||
54 | + int updateByPrimaryKeySelective(VirtualHost record); | ||
55 | + | ||
56 | + /** | ||
57 | + * 更新,根据主键 | ||
58 | + * | ||
59 | + * @param record the updated record | ||
60 | + * @return update count | ||
61 | + */ | ||
62 | + int updateByPrimaryKey(VirtualHost record); | ||
63 | + | ||
64 | + /** | ||
65 | + * 分页查询,虚拟主机列表 | ||
66 | + * | ||
67 | + * @param virtualHost 参数 | ||
68 | + * @param pageNum 当前页数 | ||
69 | + * @param pageSize 每页数量 | ||
70 | + * @return 虚拟主机列表 | ||
71 | + */ | ||
72 | + PageInfo selectVirtualHostList(VirtualHost virtualHost, Integer pageNum, Integer pageSize); | ||
73 | + | ||
74 | + /** | ||
75 | + * 校验该服务器信息是否存在 | ||
76 | + * | ||
77 | + * @param virtualHost {@link VirtualHost} | ||
78 | + * @return List<VirtualHost> | ||
79 | + */ | ||
80 | + List<VirtualHost> validateVirtualHost(VirtualHost virtualHost); | ||
81 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/BusExchangeServiceImpl.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import org.springframework.stereotype.Service; | ||
6 | + | ||
7 | +import javax.annotation.Resource; | ||
8 | + | ||
9 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
10 | +import com.sunyo.wlpt.message.bus.service.mapper.BusExchangeMapper; | ||
11 | +import com.sunyo.wlpt.message.bus.service.service.BusExchangeService; | ||
12 | +import org.springframework.transaction.annotation.Propagation; | ||
13 | +import org.springframework.transaction.annotation.Transactional; | ||
14 | + | ||
15 | +import java.util.List; | ||
16 | + | ||
17 | +/** | ||
18 | + * @author 子诚 | ||
19 | + * Description: | ||
20 | + * 时间:2020/7/1 10:08 | ||
21 | + */ | ||
22 | +@Service | ||
23 | +public class BusExchangeServiceImpl implements BusExchangeService { | ||
24 | + | ||
25 | + @Resource | ||
26 | + private BusExchangeMapper busExchangeMapper; | ||
27 | + | ||
28 | + @Override | ||
29 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
30 | + public int deleteByPrimaryKey(String id) { | ||
31 | + // 判断删除的个数,需被删除的个数是否一致 | ||
32 | + int index = 0; | ||
33 | + String splitItem = ","; | ||
34 | + //如果id,传过来多个,以','分割,即批量删除 | ||
35 | + if (id.contains(splitItem)) { | ||
36 | + try { | ||
37 | + String[] split = id.split(splitItem); | ||
38 | + for (int i = 0; i < split.length; i++) { | ||
39 | + int num = busExchangeMapper.deleteByPrimaryKey(split[i]); | ||
40 | + if (num > 0) { | ||
41 | + index = index + num; | ||
42 | + } | ||
43 | + } | ||
44 | + if (index == split.length) { | ||
45 | + return 1; | ||
46 | + } else { | ||
47 | + return 0; | ||
48 | + } | ||
49 | + } catch (Exception e) { | ||
50 | + e.printStackTrace(); | ||
51 | + return 0; | ||
52 | + } | ||
53 | + } else { | ||
54 | + return busExchangeMapper.deleteByPrimaryKey(id); | ||
55 | + } | ||
56 | + } | ||
57 | + | ||
58 | + @Override | ||
59 | + public int insert(BusExchange record) { | ||
60 | + return busExchangeMapper.insert(record); | ||
61 | + } | ||
62 | + | ||
63 | + @Override | ||
64 | + public int insertSelective(BusExchange record) { | ||
65 | + return busExchangeMapper.insertSelective(record); | ||
66 | + } | ||
67 | + | ||
68 | + @Override | ||
69 | + public BusExchange selectByPrimaryKey(String id) { | ||
70 | + return busExchangeMapper.selectByPrimaryKey(id); | ||
71 | + } | ||
72 | + | ||
73 | + @Override | ||
74 | + public int updateByPrimaryKeySelective(BusExchange record) { | ||
75 | + return busExchangeMapper.updateByPrimaryKeySelective(record); | ||
76 | + } | ||
77 | + | ||
78 | + @Override | ||
79 | + public int updateByPrimaryKey(BusExchange record) { | ||
80 | + return busExchangeMapper.updateByPrimaryKey(record); | ||
81 | + } | ||
82 | + | ||
83 | + @Override | ||
84 | + public PageInfo selectBusExchangeList(BusExchange busExchange, Integer pageNum, Integer pageSize) { | ||
85 | + PageHelper.startPage(pageNum, pageSize); | ||
86 | + List<BusExchange> busExchangeList = busExchangeMapper.selectBusExchangeList(busExchange); | ||
87 | + PageInfo<BusExchange> pageInfo = new PageInfo<>(busExchangeList); | ||
88 | + return pageInfo; | ||
89 | + } | ||
90 | + | ||
91 | + @Override | ||
92 | + public List<BusExchange> validateBusExchange(BusExchange busExchange) { | ||
93 | + return busExchangeMapper.validateBusExchange(busExchange); | ||
94 | + } | ||
95 | + | ||
96 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusExchange; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import javax.annotation.Resource; | ||
9 | + | ||
10 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
11 | +import com.sunyo.wlpt.message.bus.service.mapper.BusQueueMapper; | ||
12 | +import com.sunyo.wlpt.message.bus.service.service.BusQueueService; | ||
13 | +import org.springframework.transaction.annotation.Propagation; | ||
14 | +import org.springframework.transaction.annotation.Transactional; | ||
15 | + | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * @author 子诚 | ||
20 | + * Description: | ||
21 | + * 时间:2020/7/1 10:14 | ||
22 | + */ | ||
23 | +@Service | ||
24 | +public class BusQueueServiceImpl implements BusQueueService { | ||
25 | + | ||
26 | + @Resource | ||
27 | + private BusQueueMapper busQueueMapper; | ||
28 | + | ||
29 | + @Override | ||
30 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
31 | + public int deleteByPrimaryKey(String id) { | ||
32 | + // 判断删除的个数,需被删除的个数是否一致 | ||
33 | + int index = 0; | ||
34 | + String splitItem = ","; | ||
35 | + //如果id,传过来多个,以','分割,即批量删除 | ||
36 | + if (id.contains(splitItem)) { | ||
37 | + try { | ||
38 | + String[] split = id.split(splitItem); | ||
39 | + for (int i = 0; i < split.length; i++) { | ||
40 | + int num = busQueueMapper.deleteByPrimaryKey(split[i]); | ||
41 | + if (num > 0) { | ||
42 | + index = index + num; | ||
43 | + } | ||
44 | + } | ||
45 | + if (index == split.length) { | ||
46 | + return 1; | ||
47 | + } else { | ||
48 | + return 0; | ||
49 | + } | ||
50 | + } catch (Exception e) { | ||
51 | + e.printStackTrace(); | ||
52 | + return 0; | ||
53 | + } | ||
54 | + } else { | ||
55 | + return busQueueMapper.deleteByPrimaryKey(id); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public int insert(BusQueue record) { | ||
61 | + return busQueueMapper.insert(record); | ||
62 | + } | ||
63 | + | ||
64 | + @Override | ||
65 | + public int insertSelective(BusQueue record) { | ||
66 | + return busQueueMapper.insertSelective(record); | ||
67 | + } | ||
68 | + | ||
69 | + @Override | ||
70 | + public BusQueue selectByPrimaryKey(String id) { | ||
71 | + return busQueueMapper.selectByPrimaryKey(id); | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public int updateByPrimaryKeySelective(BusQueue record) { | ||
76 | + return busQueueMapper.updateByPrimaryKeySelective(record); | ||
77 | + } | ||
78 | + | ||
79 | + @Override | ||
80 | + public int updateByPrimaryKey(BusQueue record) { | ||
81 | + return busQueueMapper.updateByPrimaryKey(record); | ||
82 | + } | ||
83 | + | ||
84 | + @Override | ||
85 | + public PageInfo selectBusQueueList(BusQueue busQueue, Integer pageNum, Integer pageSize) { | ||
86 | + PageHelper.startPage(pageNum, pageSize); | ||
87 | + List<BusQueue> busQueueList = busQueueMapper.selectBusQueueList(busQueue); | ||
88 | + PageInfo<BusQueue> pageInfo = new PageInfo<>(busQueueList); | ||
89 | + return pageInfo; | ||
90 | + } | ||
91 | + | ||
92 | + @Override | ||
93 | + public List<BusQueue> validateBusQueue(BusQueue busQueue) { | ||
94 | + return busQueueMapper.validateBusQueue(busQueue); | ||
95 | + } | ||
96 | + | ||
97 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import org.springframework.stereotype.Service; | ||
6 | + | ||
7 | +import javax.annotation.Resource; | ||
8 | + | ||
9 | +import com.sunyo.wlpt.message.bus.service.mapper.BusServerMapper; | ||
10 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
11 | +import com.sunyo.wlpt.message.bus.service.service.BusServerService; | ||
12 | +import org.springframework.transaction.annotation.Propagation; | ||
13 | +import org.springframework.transaction.annotation.Transactional; | ||
14 | + | ||
15 | +import java.util.List; | ||
16 | + | ||
17 | +/** | ||
18 | + * @author 子诚 | ||
19 | + * Description: | ||
20 | + * 时间:2020/7/1 10:02 | ||
21 | + */ | ||
22 | +@Service | ||
23 | +public class BusServerServiceImpl implements BusServerService { | ||
24 | + | ||
25 | + @Resource | ||
26 | + private BusServerMapper busServerMapper; | ||
27 | + | ||
28 | + @Override | ||
29 | + public PageInfo selectBusServerList(BusServer busServer, Integer pageNum, Integer pageSize) { | ||
30 | + PageHelper.startPage(pageNum, pageSize); | ||
31 | + List<BusServer> busServerList = busServerMapper.selectBusServerList(busServer); | ||
32 | + PageInfo<BusServer> pageInfo = new PageInfo<>(busServerList); | ||
33 | + return pageInfo; | ||
34 | + } | ||
35 | + | ||
36 | + | ||
37 | + @Override | ||
38 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
39 | + public int deleteByPrimaryKey(String id) { | ||
40 | + // 判断删除的个数,需被删除的个数是否一致 | ||
41 | + int index = 0; | ||
42 | + String splitItem = ","; | ||
43 | + //如果id,传过来多个,以','分割,即批量删除 | ||
44 | + if (id.contains(splitItem)) { | ||
45 | + try { | ||
46 | + String[] split = id.split(splitItem); | ||
47 | + for (int i = 0; i < split.length; i++) { | ||
48 | + int num = busServerMapper.deleteByPrimaryKey(split[i]); | ||
49 | + if (num > 0) { | ||
50 | + index = index + num; | ||
51 | + } | ||
52 | + } | ||
53 | + if (index == split.length) { | ||
54 | + return 1; | ||
55 | + } else { | ||
56 | + return 0; | ||
57 | + } | ||
58 | + } catch (Exception e) { | ||
59 | + e.printStackTrace(); | ||
60 | + return 0; | ||
61 | + } | ||
62 | + } else { | ||
63 | + return busServerMapper.deleteByPrimaryKey(id); | ||
64 | + } | ||
65 | + } | ||
66 | + | ||
67 | + @Override | ||
68 | + public int insert(BusServer record) { | ||
69 | + return busServerMapper.insert(record); | ||
70 | + } | ||
71 | + | ||
72 | + @Override | ||
73 | + public int insertSelective(BusServer record) { | ||
74 | + return busServerMapper.insertSelective(record); | ||
75 | + } | ||
76 | + | ||
77 | + @Override | ||
78 | + public BusServer selectByPrimaryKey(String id) { | ||
79 | + return busServerMapper.selectByPrimaryKey(id); | ||
80 | + } | ||
81 | + | ||
82 | + @Override | ||
83 | + public int updateByPrimaryKeySelective(BusServer record) { | ||
84 | + return busServerMapper.updateByPrimaryKeySelective(record); | ||
85 | + } | ||
86 | + | ||
87 | + @Override | ||
88 | + public int updateByPrimaryKey(BusServer record) { | ||
89 | + return busServerMapper.updateByPrimaryKey(record); | ||
90 | + } | ||
91 | + | ||
92 | + @Override | ||
93 | + public List<BusServer> validateBusServer(BusServer busServer) { | ||
94 | + return busServerMapper.validateBusServer(busServer); | ||
95 | + } | ||
96 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/ExchangeQueueRoutingServiceImpl.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import org.springframework.stereotype.Service; | ||
4 | +import javax.annotation.Resource; | ||
5 | +import com.sunyo.wlpt.message.bus.service.mapper.ExchangeQueueRoutingMapper; | ||
6 | +import com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting; | ||
7 | +import com.sunyo.wlpt.message.bus.service.service.ExchangeQueueRoutingService; | ||
8 | + | ||
9 | +/** | ||
10 | + * @author 子诚 | ||
11 | + * Description: | ||
12 | + * 时间:2020/6/29 17:07 | ||
13 | + */ | ||
14 | +@Service | ||
15 | +public class ExchangeQueueRoutingServiceImpl implements ExchangeQueueRoutingService { | ||
16 | + | ||
17 | + @Resource | ||
18 | + private ExchangeQueueRoutingMapper exchangeQueueRoutingMapper; | ||
19 | + | ||
20 | + @Override | ||
21 | + public int deleteByPrimaryKey(String id) { | ||
22 | + return exchangeQueueRoutingMapper.deleteByPrimaryKey(id); | ||
23 | + } | ||
24 | + | ||
25 | + @Override | ||
26 | + public int insert(ExchangeQueueRouting record) { | ||
27 | + return exchangeQueueRoutingMapper.insert(record); | ||
28 | + } | ||
29 | + | ||
30 | + @Override | ||
31 | + public int insertSelective(ExchangeQueueRouting record) { | ||
32 | + return exchangeQueueRoutingMapper.insertSelective(record); | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + public ExchangeQueueRouting selectByPrimaryKey(String id) { | ||
37 | + return exchangeQueueRoutingMapper.selectByPrimaryKey(id); | ||
38 | + } | ||
39 | + | ||
40 | + @Override | ||
41 | + public int updateByPrimaryKeySelective(ExchangeQueueRouting record) { | ||
42 | + return exchangeQueueRoutingMapper.updateByPrimaryKeySelective(record); | ||
43 | + } | ||
44 | + | ||
45 | + @Override | ||
46 | + public int updateByPrimaryKey(ExchangeQueueRouting record) { | ||
47 | + return exchangeQueueRoutingMapper.updateByPrimaryKey(record); | ||
48 | + } | ||
49 | + | ||
50 | +} | ||
51 | + | ||
52 | + |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/MessageNoteServiceImpl.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import javax.annotation.Resource; | ||
9 | + | ||
10 | +import com.sunyo.wlpt.message.bus.service.mapper.MessageNoteMapper; | ||
11 | +import com.sunyo.wlpt.message.bus.service.domain.MessageNote; | ||
12 | +import com.sunyo.wlpt.message.bus.service.service.MessageNoteService; | ||
13 | +import org.springframework.transaction.annotation.Propagation; | ||
14 | +import org.springframework.transaction.annotation.Transactional; | ||
15 | + | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * @author 子诚 | ||
20 | + * Description: | ||
21 | + * 时间:2020/6/29 17:46 | ||
22 | + */ | ||
23 | +@Service | ||
24 | +public class MessageNoteServiceImpl implements MessageNoteService { | ||
25 | + | ||
26 | + @Resource | ||
27 | + private MessageNoteMapper messageNoteMapper; | ||
28 | + | ||
29 | + @Override | ||
30 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
31 | + public int deleteByPrimaryKey(String id) { | ||
32 | + // 判断删除的个数,需被删除的个数是否一致 | ||
33 | + int index = 0; | ||
34 | + String splitItem = ","; | ||
35 | + //如果id,传过来多个,以','分割,即批量删除 | ||
36 | + if (id.contains(splitItem)) { | ||
37 | + try { | ||
38 | + String[] split = id.split(splitItem); | ||
39 | + for (int i = 0; i < split.length; i++) { | ||
40 | + int num = messageNoteMapper.deleteByPrimaryKey(split[i]); | ||
41 | + if (num > 0) { | ||
42 | + index = index + num; | ||
43 | + } | ||
44 | + } | ||
45 | + if (index == split.length) { | ||
46 | + return 1; | ||
47 | + } else { | ||
48 | + return 0; | ||
49 | + } | ||
50 | + } catch (Exception e) { | ||
51 | + e.printStackTrace(); | ||
52 | + return 0; | ||
53 | + } | ||
54 | + } else { | ||
55 | + return messageNoteMapper.deleteByPrimaryKey(id); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public int insert(MessageNote record) { | ||
61 | + return messageNoteMapper.insert(record); | ||
62 | + } | ||
63 | + | ||
64 | + @Override | ||
65 | + public int insertSelective(MessageNote record) { | ||
66 | + return messageNoteMapper.insertSelective(record); | ||
67 | + } | ||
68 | + | ||
69 | + @Override | ||
70 | + public MessageNote selectByPrimaryKey(String id) { | ||
71 | + return messageNoteMapper.selectByPrimaryKey(id); | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public int updateByPrimaryKeySelective(MessageNote record) { | ||
76 | + return messageNoteMapper.updateByPrimaryKeySelective(record); | ||
77 | + } | ||
78 | + | ||
79 | + @Override | ||
80 | + public int updateByPrimaryKey(MessageNote record) { | ||
81 | + return messageNoteMapper.updateByPrimaryKey(record); | ||
82 | + } | ||
83 | + | ||
84 | + @Override | ||
85 | + public PageInfo selectMessageNoteList(MessageNote messageNote, Integer pageNum, Integer pageSize) { | ||
86 | + PageHelper.startPage(pageNum, pageSize); | ||
87 | + List<MessageNote> messageNoteList = messageNoteMapper.selectMessageNoteList(messageNote); | ||
88 | + PageInfo<MessageNote> pageInfo = new PageInfo<>(messageNoteList); | ||
89 | + return pageInfo; | ||
90 | + } | ||
91 | + | ||
92 | +} | ||
93 | + |
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import javax.annotation.Resource; | ||
9 | + | ||
10 | +import com.sunyo.wlpt.message.bus.service.mapper.RoutingKeyMapper; | ||
11 | +import com.sunyo.wlpt.message.bus.service.domain.RoutingKey; | ||
12 | +import com.sunyo.wlpt.message.bus.service.service.RoutingKeyService; | ||
13 | +import org.springframework.transaction.annotation.Propagation; | ||
14 | +import org.springframework.transaction.annotation.Transactional; | ||
15 | + | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * @author 子诚 | ||
20 | + * Description: | ||
21 | + * 时间:2020/6/29 16:45 | ||
22 | + */ | ||
23 | +@Service | ||
24 | +public class RoutingKeyServiceImpl implements RoutingKeyService { | ||
25 | + | ||
26 | + @Resource | ||
27 | + private RoutingKeyMapper routingKeyMapper; | ||
28 | + | ||
29 | + @Override | ||
30 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
31 | + public int deleteByPrimaryKey(String id) { | ||
32 | + // 判断删除的个数,需被删除的个数是否一致 | ||
33 | + int index = 0; | ||
34 | + String splitItem = ","; | ||
35 | + //如果id,传过来多个,以','分割,即批量删除 | ||
36 | + if (id.contains(splitItem)) { | ||
37 | + try { | ||
38 | + String[] split = id.split(splitItem); | ||
39 | + for (int i = 0; i < split.length; i++) { | ||
40 | + int num = routingKeyMapper.deleteByPrimaryKey(split[i]); | ||
41 | + if (num > 0) { | ||
42 | + index = index + num; | ||
43 | + } | ||
44 | + } | ||
45 | + if (index == split.length) { | ||
46 | + return 1; | ||
47 | + } else { | ||
48 | + return 0; | ||
49 | + } | ||
50 | + } catch (Exception e) { | ||
51 | + e.printStackTrace(); | ||
52 | + return 0; | ||
53 | + } | ||
54 | + } else { | ||
55 | + return routingKeyMapper.deleteByPrimaryKey(id); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public int insert(RoutingKey record) { | ||
61 | + return routingKeyMapper.insert(record); | ||
62 | + } | ||
63 | + | ||
64 | + @Override | ||
65 | + public int insertSelective(RoutingKey record) { | ||
66 | + return routingKeyMapper.insertSelective(record); | ||
67 | + } | ||
68 | + | ||
69 | + @Override | ||
70 | + public RoutingKey selectByPrimaryKey(String id) { | ||
71 | + return routingKeyMapper.selectByPrimaryKey(id); | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public int updateByPrimaryKeySelective(RoutingKey record) { | ||
76 | + return routingKeyMapper.updateByPrimaryKeySelective(record); | ||
77 | + } | ||
78 | + | ||
79 | + @Override | ||
80 | + public int updateByPrimaryKey(RoutingKey record) { | ||
81 | + return routingKeyMapper.updateByPrimaryKey(record); | ||
82 | + } | ||
83 | + | ||
84 | + @Override | ||
85 | + public PageInfo selectRoutingKeyList(RoutingKey routingKey, Integer pageNum, Integer pageSize) { | ||
86 | + PageHelper.startPage(pageNum, pageSize); | ||
87 | + List<RoutingKey> routingKeyList = routingKeyMapper.selectRoutingKeyList(routingKey); | ||
88 | + PageInfo<RoutingKey> pageInfo = new PageInfo<>(routingKeyList); | ||
89 | + return pageInfo; | ||
90 | + } | ||
91 | + | ||
92 | + @Override | ||
93 | + public List<RoutingKey> validateRoutingKey(RoutingKey routingKey) { | ||
94 | + return routingKeyMapper.validateRoutingKey(routingKey); | ||
95 | + } | ||
96 | + | ||
97 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import org.springframework.stereotype.Service; | ||
4 | +import javax.annotation.Resource; | ||
5 | +import com.sunyo.wlpt.message.bus.service.mapper.UserInfoMapper; | ||
6 | +import com.sunyo.wlpt.message.bus.service.domain.UserInfo; | ||
7 | +import com.sunyo.wlpt.message.bus.service.service.UserInfoService; | ||
8 | + | ||
9 | +/** | ||
10 | + * @author 子诚 | ||
11 | + * Description: | ||
12 | + * 时间:2020/6/29 17:15 | ||
13 | + */ | ||
14 | +@Service | ||
15 | +public class UserInfoServiceImpl implements UserInfoService { | ||
16 | + | ||
17 | + @Resource | ||
18 | + private UserInfoMapper userInfoMapper; | ||
19 | + | ||
20 | + @Override | ||
21 | + public int deleteByPrimaryKey(String id) { | ||
22 | + return userInfoMapper.deleteByPrimaryKey(id); | ||
23 | + } | ||
24 | + | ||
25 | + @Override | ||
26 | + public int insert(UserInfo record) { | ||
27 | + return userInfoMapper.insert(record); | ||
28 | + } | ||
29 | + | ||
30 | + @Override | ||
31 | + public int insertSelective(UserInfo record) { | ||
32 | + return userInfoMapper.insertSelective(record); | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + public UserInfo selectByPrimaryKey(String id) { | ||
37 | + return userInfoMapper.selectByPrimaryKey(id); | ||
38 | + } | ||
39 | + | ||
40 | + @Override | ||
41 | + public int updateByPrimaryKeySelective(UserInfo record) { | ||
42 | + return userInfoMapper.updateByPrimaryKeySelective(record); | ||
43 | + } | ||
44 | + | ||
45 | + @Override | ||
46 | + public int updateByPrimaryKey(UserInfo record) { | ||
47 | + return userInfoMapper.updateByPrimaryKey(record); | ||
48 | + } | ||
49 | + | ||
50 | +} | ||
51 | + |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/UserMessageBindingServiceImpl.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusQueue; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import javax.annotation.Resource; | ||
9 | + | ||
10 | +import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding; | ||
11 | +import com.sunyo.wlpt.message.bus.service.mapper.UserMessageBindingMapper; | ||
12 | +import com.sunyo.wlpt.message.bus.service.service.UserMessageBindingService; | ||
13 | +import org.springframework.transaction.annotation.Propagation; | ||
14 | +import org.springframework.transaction.annotation.Transactional; | ||
15 | + | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * @author 子诚 | ||
20 | + * Description: | ||
21 | + * 时间:2020/6/29 17:37 | ||
22 | + */ | ||
23 | +@Service | ||
24 | +public class UserMessageBindingServiceImpl implements UserMessageBindingService { | ||
25 | + | ||
26 | + @Resource | ||
27 | + private UserMessageBindingMapper userMessageBindingMapper; | ||
28 | + | ||
29 | + @Override | ||
30 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
31 | + public int deleteByPrimaryKey(String id) { | ||
32 | + // 判断删除的个数,需被删除的个数是否一致 | ||
33 | + int index = 0; | ||
34 | + String splitItem = ","; | ||
35 | + //如果id,传过来多个,以','分割,即批量删除 | ||
36 | + if (id.contains(splitItem)) { | ||
37 | + try { | ||
38 | + String[] split = id.split(splitItem); | ||
39 | + for (int i = 0; i < split.length; i++) { | ||
40 | + int num = userMessageBindingMapper.deleteByPrimaryKey(split[i]); | ||
41 | + if (num > 0) { | ||
42 | + index = index + num; | ||
43 | + } | ||
44 | + } | ||
45 | + if (index == split.length) { | ||
46 | + return 1; | ||
47 | + } else { | ||
48 | + return 0; | ||
49 | + } | ||
50 | + } catch (Exception e) { | ||
51 | + e.printStackTrace(); | ||
52 | + return 0; | ||
53 | + } | ||
54 | + } else { | ||
55 | + return userMessageBindingMapper.deleteByPrimaryKey(id); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public int insert(UserMessageBinding record) { | ||
61 | + return userMessageBindingMapper.insert(record); | ||
62 | + } | ||
63 | + | ||
64 | + @Override | ||
65 | + public int insertSelective(UserMessageBinding record) { | ||
66 | + return userMessageBindingMapper.insertSelective(record); | ||
67 | + } | ||
68 | + | ||
69 | + @Override | ||
70 | + public UserMessageBinding selectByPrimaryKey(String id) { | ||
71 | + return userMessageBindingMapper.selectByPrimaryKey(id); | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public int updateByPrimaryKeySelective(UserMessageBinding record) { | ||
76 | + return userMessageBindingMapper.updateByPrimaryKeySelective(record); | ||
77 | + } | ||
78 | + | ||
79 | + @Override | ||
80 | + public int updateByPrimaryKey(UserMessageBinding record) { | ||
81 | + return userMessageBindingMapper.updateByPrimaryKey(record); | ||
82 | + } | ||
83 | + | ||
84 | + @Override | ||
85 | + public PageInfo selectUserMessageBindingList(UserMessageBinding userMessageBinding, Integer pageNum, Integer pageSize) { | ||
86 | + PageHelper.startPage(pageNum, pageSize); | ||
87 | + List<UserMessageBinding> userMessageBindingList = userMessageBindingMapper.selectUserMessageBindingList(userMessageBinding); | ||
88 | + PageInfo<UserMessageBinding> pageInfo = new PageInfo<>(userMessageBindingList); | ||
89 | + return pageInfo; | ||
90 | + } | ||
91 | + | ||
92 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/UserServerVirtualHostServiceImpl.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import org.springframework.stereotype.Service; | ||
4 | + | ||
5 | +import javax.annotation.Resource; | ||
6 | + | ||
7 | +import com.sunyo.wlpt.message.bus.service.mapper.UserServerVirtualHostMapper; | ||
8 | +import com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost; | ||
9 | +import com.sunyo.wlpt.message.bus.service.service.UserServerVirtualHostService; | ||
10 | + | ||
11 | +/** | ||
12 | + * @author 子诚 | ||
13 | + * Description: | ||
14 | + * 时间:2020/6/29 17:31 | ||
15 | + */ | ||
16 | +@Service | ||
17 | +public class UserServerVirtualHostServiceImpl implements UserServerVirtualHostService { | ||
18 | + | ||
19 | + @Resource | ||
20 | + private UserServerVirtualHostMapper userServerVirtualHostMapper; | ||
21 | + | ||
22 | + @Override | ||
23 | + public int deleteByPrimaryKey(String id) { | ||
24 | + return userServerVirtualHostMapper.deleteByPrimaryKey(id); | ||
25 | + } | ||
26 | + | ||
27 | + @Override | ||
28 | + public int insert(UserServerVirtualHost record) { | ||
29 | + return userServerVirtualHostMapper.insert(record); | ||
30 | + } | ||
31 | + | ||
32 | + @Override | ||
33 | + public int insertSelective(UserServerVirtualHost record) { | ||
34 | + return userServerVirtualHostMapper.insertSelective(record); | ||
35 | + } | ||
36 | + | ||
37 | + @Override | ||
38 | + public UserServerVirtualHost selectByPrimaryKey(String id) { | ||
39 | + return userServerVirtualHostMapper.selectByPrimaryKey(id); | ||
40 | + } | ||
41 | + | ||
42 | + @Override | ||
43 | + public int updateByPrimaryKeySelective(UserServerVirtualHost record) { | ||
44 | + return userServerVirtualHostMapper.updateByPrimaryKeySelective(record); | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + public int updateByPrimaryKey(UserServerVirtualHost record) { | ||
49 | + return userServerVirtualHostMapper.updateByPrimaryKey(record); | ||
50 | + } | ||
51 | + | ||
52 | +} | ||
53 | + |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/VirtualHostServiceImpl.java
0 → 100644
1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
2 | + | ||
3 | +import com.github.pagehelper.PageHelper; | ||
4 | +import com.github.pagehelper.PageInfo; | ||
5 | +import com.sunyo.wlpt.message.bus.service.domain.BusServer; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import javax.annotation.Resource; | ||
9 | + | ||
10 | +import com.sunyo.wlpt.message.bus.service.mapper.VirtualHostMapper; | ||
11 | +import com.sunyo.wlpt.message.bus.service.domain.VirtualHost; | ||
12 | +import com.sunyo.wlpt.message.bus.service.service.VirtualHostService; | ||
13 | +import org.springframework.transaction.annotation.Propagation; | ||
14 | +import org.springframework.transaction.annotation.Transactional; | ||
15 | + | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * @author 子诚 | ||
20 | + * Description: | ||
21 | + * 时间:2020/6/29 16:36 | ||
22 | + */ | ||
23 | +@Service | ||
24 | +public class VirtualHostServiceImpl implements VirtualHostService { | ||
25 | + | ||
26 | + @Resource | ||
27 | + private VirtualHostMapper virtualHostMapper; | ||
28 | + | ||
29 | + @Override | ||
30 | + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) | ||
31 | + public int deleteByPrimaryKey(String id) { | ||
32 | + // 判断删除的个数,需被删除的个数是否一致 | ||
33 | + int index = 0; | ||
34 | + String splitItem = ","; | ||
35 | + //如果id,传过来多个,以','分割,即批量删除 | ||
36 | + if (id.contains(splitItem)) { | ||
37 | + try { | ||
38 | + String[] split = id.split(splitItem); | ||
39 | + for (int i = 0; i < split.length; i++) { | ||
40 | + int num = virtualHostMapper.deleteByPrimaryKey(split[i]); | ||
41 | + if (num > 0) { | ||
42 | + index = index + num; | ||
43 | + } | ||
44 | + } | ||
45 | + if (index == split.length) { | ||
46 | + return 1; | ||
47 | + } else { | ||
48 | + return 0; | ||
49 | + } | ||
50 | + } catch (Exception e) { | ||
51 | + e.printStackTrace(); | ||
52 | + return 0; | ||
53 | + } | ||
54 | + } else { | ||
55 | + return virtualHostMapper.deleteByPrimaryKey(id); | ||
56 | + } | ||
57 | + | ||
58 | + } | ||
59 | + | ||
60 | + @Override | ||
61 | + public int insert(VirtualHost record) { | ||
62 | + return virtualHostMapper.insert(record); | ||
63 | + } | ||
64 | + | ||
65 | + @Override | ||
66 | + public int insertSelective(VirtualHost record) { | ||
67 | + return virtualHostMapper.insertSelective(record); | ||
68 | + } | ||
69 | + | ||
70 | + @Override | ||
71 | + public VirtualHost selectByPrimaryKey(String id) { | ||
72 | + return virtualHostMapper.selectByPrimaryKey(id); | ||
73 | + } | ||
74 | + | ||
75 | + @Override | ||
76 | + public int updateByPrimaryKeySelective(VirtualHost record) { | ||
77 | + return virtualHostMapper.updateByPrimaryKeySelective(record); | ||
78 | + } | ||
79 | + | ||
80 | + @Override | ||
81 | + public int updateByPrimaryKey(VirtualHost record) { | ||
82 | + return virtualHostMapper.updateByPrimaryKey(record); | ||
83 | + } | ||
84 | + | ||
85 | + @Override | ||
86 | + public PageInfo selectVirtualHostList(VirtualHost virtualHost, Integer pageNum, Integer pageSize) { | ||
87 | + PageHelper.startPage(pageNum, pageSize); | ||
88 | + List<VirtualHost> virtualHostList = virtualHostMapper.selectVirtualHostList(virtualHost); | ||
89 | + PageInfo<VirtualHost> pageInfo = new PageInfo<>(virtualHostList); | ||
90 | + return pageInfo; | ||
91 | + } | ||
92 | + | ||
93 | + @Override | ||
94 | + public List<VirtualHost> validateVirtualHost(VirtualHost virtualHost) { | ||
95 | + return virtualHostMapper.validateVirtualHost(virtualHost); | ||
96 | + } | ||
97 | + | ||
98 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.utils; | ||
2 | + | ||
3 | +/** | ||
4 | + * @author 子诚 | ||
5 | + * Description:生成雪花算法唯一id | ||
6 | + * 时间:2020/7/1 9:26 | ||
7 | + */ | ||
8 | +public class IdUtils { | ||
9 | + /** | ||
10 | + * 静态工具类 | ||
11 | + * | ||
12 | + * @return id | ||
13 | + */ | ||
14 | + public static synchronized String generateId() { | ||
15 | + IdWorker idWorker = new IdWorker(); | ||
16 | + long nextId = idWorker.nextId(); | ||
17 | + String id = String.valueOf(nextId); | ||
18 | + return id; | ||
19 | + } | ||
20 | + | ||
21 | + public static void main(String[] args) { | ||
22 | + System.out.println(IdUtils.generateId()); | ||
23 | + } | ||
24 | +} |
1 | +package com.sunyo.wlpt.message.bus.service.utils; | ||
2 | + | ||
3 | +import java.lang.management.ManagementFactory; | ||
4 | +import java.net.InetAddress; | ||
5 | +import java.net.NetworkInterface; | ||
6 | + | ||
7 | +/** | ||
8 | + * @author 子诚 | ||
9 | + * Description:雪花算法生成唯一ID | ||
10 | + * 时间:2020/6/30 19:19 | ||
11 | + */ | ||
12 | +public final class IdWorker { | ||
13 | + | ||
14 | + /** | ||
15 | + * 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动) | ||
16 | + */ | ||
17 | + private final static long TWEPOCH = 1288834974657L; | ||
18 | + | ||
19 | + /** | ||
20 | + * 机器标识位数 | ||
21 | + */ | ||
22 | + private final static long WORKER_ID_BITS = 5L; | ||
23 | + | ||
24 | + /** | ||
25 | + * 数据中心标识位数 | ||
26 | + */ | ||
27 | + private final static long DATA_CENTER_ID_BITS = 5L; | ||
28 | + | ||
29 | + /** | ||
30 | + * 机器ID最大值 | ||
31 | + */ | ||
32 | + private final static long MAX_WORKER_ID = ~(-1L << WORKER_ID_BITS); | ||
33 | + | ||
34 | + /** | ||
35 | + * 数据中心ID最大值 | ||
36 | + */ | ||
37 | + private final static long MAX_DATA_CENTER_ID = ~(-1L << DATA_CENTER_ID_BITS); | ||
38 | + | ||
39 | + /** | ||
40 | + * 毫秒内自增位 | ||
41 | + */ | ||
42 | + private final static long SEQUENCE_BITS = 12L; | ||
43 | + | ||
44 | + /** | ||
45 | + * 机器ID偏左移12位 | ||
46 | + */ | ||
47 | + private final static long WORKER_ID_SHIFT = SEQUENCE_BITS; | ||
48 | + | ||
49 | + /** | ||
50 | + * 数据中心ID左移17位 | ||
51 | + */ | ||
52 | + private final static long DATA_CENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS; | ||
53 | + | ||
54 | + /** | ||
55 | + * 时间毫秒左移22位 | ||
56 | + */ | ||
57 | + private final static long TIME_STAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATA_CENTER_ID_BITS; | ||
58 | + | ||
59 | + private final static long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS); | ||
60 | + | ||
61 | + /** | ||
62 | + * 上次生产id时间戳 | ||
63 | + */ | ||
64 | + private static long LAST_TIME_STAMP = -1L; | ||
65 | + | ||
66 | + /** | ||
67 | + * 0,并发控制 | ||
68 | + */ | ||
69 | + private long sequence = 0L; | ||
70 | + | ||
71 | + private final long workerId; | ||
72 | + | ||
73 | + /** | ||
74 | + * 数据标识id部分 | ||
75 | + */ | ||
76 | + private final long DATA_CENTER_ID; | ||
77 | + | ||
78 | + public IdWorker() { | ||
79 | + this.DATA_CENTER_ID = getDatacenterId(MAX_DATA_CENTER_ID); | ||
80 | + this.workerId = getMaxWorkerId(DATA_CENTER_ID, MAX_WORKER_ID); | ||
81 | + } | ||
82 | + | ||
83 | + public IdWorker(long workerId, long datacenterId) { | ||
84 | + if (workerId > MAX_WORKER_ID || workerId < 0) { | ||
85 | + throw new IllegalArgumentException(String.format("id不能大于最大值 %d 或者小于 0", MAX_WORKER_ID)); | ||
86 | + } | ||
87 | + if (datacenterId > MAX_DATA_CENTER_ID || datacenterId < 0) { | ||
88 | + throw new IllegalArgumentException(String.format("数据中心id不能大于最大值 %d 或者小于 0", MAX_DATA_CENTER_ID)); | ||
89 | + } | ||
90 | + this.workerId = workerId; | ||
91 | + this.DATA_CENTER_ID = datacenterId; | ||
92 | + } | ||
93 | + | ||
94 | + /** | ||
95 | + * 获取下一个ID | ||
96 | + * | ||
97 | + * @return id | ||
98 | + */ | ||
99 | + public synchronized long nextId() { | ||
100 | + long timestamp = timeGen(); | ||
101 | + if (timestamp < LAST_TIME_STAMP) { | ||
102 | + throw new RuntimeException(String.format("时间生成异常 %d", LAST_TIME_STAMP - timestamp)); | ||
103 | + } | ||
104 | + | ||
105 | + if (LAST_TIME_STAMP == timestamp) { | ||
106 | + // 当前毫秒内,则+1 | ||
107 | + sequence = (sequence + 1) & SEQUENCE_MASK; | ||
108 | + if (sequence == 0) { | ||
109 | + // 当前毫秒内计数满了,则等待下一秒 | ||
110 | + timestamp = tilNextMillis(LAST_TIME_STAMP); | ||
111 | + } | ||
112 | + } else { | ||
113 | + sequence = 0L; | ||
114 | + } | ||
115 | + LAST_TIME_STAMP = timestamp; | ||
116 | + // ID偏移组合生成最终的ID,并返回ID | ||
117 | + | ||
118 | + return ((timestamp - TWEPOCH) << TIME_STAMP_LEFT_SHIFT) | ||
119 | + | (DATA_CENTER_ID << DATA_CENTER_ID_SHIFT) | ||
120 | + | (workerId << WORKER_ID_SHIFT) | sequence; | ||
121 | + } | ||
122 | + | ||
123 | + private long tilNextMillis(final long lastTimestamp) { | ||
124 | + long timestamp = this.timeGen(); | ||
125 | + while (timestamp <= lastTimestamp) { | ||
126 | + timestamp = this.timeGen(); | ||
127 | + } | ||
128 | + return timestamp; | ||
129 | + } | ||
130 | + | ||
131 | + private long timeGen() { | ||
132 | + return System.currentTimeMillis(); | ||
133 | + } | ||
134 | + | ||
135 | + /** | ||
136 | + * <p> | ||
137 | + * 获取 maxWorkerId | ||
138 | + * </p> | ||
139 | + */ | ||
140 | + private static long getMaxWorkerId(long dataCenterId, long maxWorkerId) { | ||
141 | + StringBuilder mpid = new StringBuilder(); | ||
142 | + mpid.append(dataCenterId); | ||
143 | + String name = ManagementFactory.getRuntimeMXBean().getName(); | ||
144 | + if (!name.isEmpty()) { | ||
145 | + /* | ||
146 | + * GET jvmPid | ||
147 | + */ | ||
148 | + mpid.append(name.split("@")[0]); | ||
149 | + } | ||
150 | + /* | ||
151 | + * MAC + PID 的 hashcode 获取16个低位 | ||
152 | + */ | ||
153 | + return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1); | ||
154 | + } | ||
155 | + | ||
156 | + /** | ||
157 | + * <p> | ||
158 | + * 数据标识id部分 | ||
159 | + * </p> | ||
160 | + */ | ||
161 | + private static long getDatacenterId(long maxDatacenterId) { | ||
162 | + long id = 0L; | ||
163 | + try { | ||
164 | + InetAddress ip = InetAddress.getLocalHost(); | ||
165 | + NetworkInterface network = NetworkInterface.getByInetAddress(ip); | ||
166 | + if (network == null) { | ||
167 | + id = 1L; | ||
168 | + } else { | ||
169 | + byte[] mac = network.getHardwareAddress(); | ||
170 | + id = ((0x000000FF & (long) mac[mac.length - 1]) | ||
171 | + | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6; | ||
172 | + id = id % (maxDatacenterId + 1); | ||
173 | + } | ||
174 | + } catch (Exception e) { | ||
175 | + System.out.println(" getDatacenterId: " + e.getMessage()); | ||
176 | + } | ||
177 | + return id; | ||
178 | + } | ||
179 | + | ||
180 | + /** | ||
181 | + * 静态工具类 | ||
182 | + * | ||
183 | + * @return id | ||
184 | + | ||
185 | + public static synchronized String generateId() { | ||
186 | + String id = String.valueOf(new IdWorker().nextId()); | ||
187 | + return id; | ||
188 | + } | ||
189 | + */ | ||
190 | + /** | ||
191 | + * 测试 | ||
192 | + | ||
193 | + public static void main(String[] args) { | ||
194 | + System.out.println("当前时间戳:" + System.currentTimeMillis()); | ||
195 | + for (int i = 0; i < 10; i++) { | ||
196 | + //生成唯一雪花id | ||
197 | + String id = IdWorker.generateId(); | ||
198 | + System.out.println("第" + i + "个:" + id + ";长度为:" + id.length()); | ||
199 | + } | ||
200 | + } | ||
201 | + */ | ||
202 | +} |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.BusExchangeMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.BusExchange"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table bus_exchange--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="exchange_name" jdbcType="VARCHAR" property="exchangeName"/> | ||
9 | + <result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId"/> | ||
10 | + <result column="exchange_type" jdbcType="VARCHAR" property="exchangeType"/> | ||
11 | + <result column="durability" jdbcType="BOOLEAN" property="durability"/> | ||
12 | + <result column="auto_delete" jdbcType="BOOLEAN" property="autoDelete"/> | ||
13 | + <result column="internal" jdbcType="BOOLEAN" property="internal"/> | ||
14 | + <result column="arguments" jdbcType="VARCHAR" property="arguments"/> | ||
15 | + <result column="description" jdbcType="VARCHAR" property="description"/> | ||
16 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
17 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
18 | + </resultMap> | ||
19 | + <sql id="Base_Column_List"> | ||
20 | + <!--@mbg.generated--> | ||
21 | + id, exchange_name, virtual_host_id, exchange_type, durability, auto_delete, internal, | ||
22 | + arguments, description, gmt_create, gmt_modified | ||
23 | + </sql> | ||
24 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
25 | + <!--@mbg.generated--> | ||
26 | + select | ||
27 | + <include refid="Base_Column_List"/> | ||
28 | + from bus_exchange | ||
29 | + where id = #{id,jdbcType=VARCHAR} | ||
30 | + </select> | ||
31 | + <!-- 获取交换机列表 --> | ||
32 | + <select id="selectBusExchangeList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange" | ||
33 | + resultMap="BaseResultMap"> | ||
34 | + select | ||
35 | + <include refid="Base_Column_List"/> | ||
36 | + from bus_exchange | ||
37 | + <where> | ||
38 | + <!-- 交换机名称 --> | ||
39 | + <if test="exchangeName != null and exchangeName !=''"> | ||
40 | + exchange_name = #{exchangeName,jdbcType=VARCHAR} | ||
41 | + </if> | ||
42 | + </where> | ||
43 | + </select> | ||
44 | + <!-- 校验交换机是否已存在 --> | ||
45 | + <select id="validateBusExchange" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange" | ||
46 | + resultMap="BaseResultMap"> | ||
47 | + select | ||
48 | + <include refid="Base_Column_List"/> | ||
49 | + from bus_exchange | ||
50 | + <where> | ||
51 | + <!-- 交换机名称 --> | ||
52 | + <if test="exchangeName != null and exchangeName !=''"> | ||
53 | + exchange_name = #{exchangeName,jdbcType=VARCHAR} | ||
54 | + </if> | ||
55 | + </where> | ||
56 | + </select> | ||
57 | + | ||
58 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
59 | + <!--@mbg.generated--> | ||
60 | + delete from bus_exchange | ||
61 | + where id = #{id,jdbcType=VARCHAR} | ||
62 | + </delete> | ||
63 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange"> | ||
64 | + <!--@mbg.generated--> | ||
65 | + insert into bus_exchange (id, exchange_name, virtual_host_id, | ||
66 | + exchange_type, durability, auto_delete, | ||
67 | + internal, arguments, description, | ||
68 | + gmt_create, gmt_modified) | ||
69 | + values (#{id,jdbcType=VARCHAR}, #{exchangeName,jdbcType=VARCHAR}, #{virtualHostId,jdbcType=VARCHAR}, | ||
70 | + #{exchangeType,jdbcType=VARCHAR}, #{durability,jdbcType=BOOLEAN}, #{autoDelete,jdbcType=BOOLEAN}, | ||
71 | + #{internal,jdbcType=BOOLEAN}, #{arguments,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, | ||
72 | + #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}) | ||
73 | + </insert> | ||
74 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange"> | ||
75 | + <!--@mbg.generated--> | ||
76 | + insert into bus_exchange | ||
77 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
78 | + <if test="id != null"> | ||
79 | + id, | ||
80 | + </if> | ||
81 | + <if test="exchangeName != null"> | ||
82 | + exchange_name, | ||
83 | + </if> | ||
84 | + <if test="virtualHostId != null"> | ||
85 | + virtual_host_id, | ||
86 | + </if> | ||
87 | + <if test="exchangeType != null"> | ||
88 | + exchange_type, | ||
89 | + </if> | ||
90 | + <if test="durability != null"> | ||
91 | + durability, | ||
92 | + </if> | ||
93 | + <if test="autoDelete != null"> | ||
94 | + auto_delete, | ||
95 | + </if> | ||
96 | + <if test="internal != null"> | ||
97 | + internal, | ||
98 | + </if> | ||
99 | + <if test="arguments != null"> | ||
100 | + arguments, | ||
101 | + </if> | ||
102 | + <if test="description != null"> | ||
103 | + description, | ||
104 | + </if> | ||
105 | + <if test="gmtCreate != null"> | ||
106 | + gmt_create, | ||
107 | + </if> | ||
108 | + <if test="gmtModified != null"> | ||
109 | + gmt_modified, | ||
110 | + </if> | ||
111 | + </trim> | ||
112 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
113 | + <if test="id != null"> | ||
114 | + #{id,jdbcType=VARCHAR}, | ||
115 | + </if> | ||
116 | + <if test="exchangeName != null"> | ||
117 | + #{exchangeName,jdbcType=VARCHAR}, | ||
118 | + </if> | ||
119 | + <if test="virtualHostId != null"> | ||
120 | + #{virtualHostId,jdbcType=VARCHAR}, | ||
121 | + </if> | ||
122 | + <if test="exchangeType != null"> | ||
123 | + #{exchangeType,jdbcType=VARCHAR}, | ||
124 | + </if> | ||
125 | + <if test="durability != null"> | ||
126 | + #{durability,jdbcType=BOOLEAN}, | ||
127 | + </if> | ||
128 | + <if test="autoDelete != null"> | ||
129 | + #{autoDelete,jdbcType=BOOLEAN}, | ||
130 | + </if> | ||
131 | + <if test="internal != null"> | ||
132 | + #{internal,jdbcType=BOOLEAN}, | ||
133 | + </if> | ||
134 | + <if test="arguments != null"> | ||
135 | + #{arguments,jdbcType=VARCHAR}, | ||
136 | + </if> | ||
137 | + <if test="description != null"> | ||
138 | + #{description,jdbcType=VARCHAR}, | ||
139 | + </if> | ||
140 | + <if test="gmtCreate != null"> | ||
141 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
142 | + </if> | ||
143 | + <if test="gmtModified != null"> | ||
144 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
145 | + </if> | ||
146 | + </trim> | ||
147 | + </insert> | ||
148 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange"> | ||
149 | + <!--@mbg.generated--> | ||
150 | + update bus_exchange | ||
151 | + <set> | ||
152 | + <if test="exchangeName != null"> | ||
153 | + exchange_name = #{exchangeName,jdbcType=VARCHAR}, | ||
154 | + </if> | ||
155 | + <if test="virtualHostId != null"> | ||
156 | + virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}, | ||
157 | + </if> | ||
158 | + <if test="exchangeType != null"> | ||
159 | + exchange_type = #{exchangeType,jdbcType=VARCHAR}, | ||
160 | + </if> | ||
161 | + <if test="durability != null"> | ||
162 | + durability = #{durability,jdbcType=BOOLEAN}, | ||
163 | + </if> | ||
164 | + <if test="autoDelete != null"> | ||
165 | + auto_delete = #{autoDelete,jdbcType=BOOLEAN}, | ||
166 | + </if> | ||
167 | + <if test="internal != null"> | ||
168 | + internal = #{internal,jdbcType=BOOLEAN}, | ||
169 | + </if> | ||
170 | + <if test="arguments != null"> | ||
171 | + arguments = #{arguments,jdbcType=VARCHAR}, | ||
172 | + </if> | ||
173 | + <if test="description != null"> | ||
174 | + description = #{description,jdbcType=VARCHAR}, | ||
175 | + </if> | ||
176 | + <if test="gmtCreate != null"> | ||
177 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
178 | + </if> | ||
179 | + <if test="gmtModified != null"> | ||
180 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
181 | + </if> | ||
182 | + </set> | ||
183 | + where id = #{id,jdbcType=VARCHAR} | ||
184 | + </update> | ||
185 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange"> | ||
186 | + <!--@mbg.generated--> | ||
187 | + update bus_exchange | ||
188 | + set exchange_name = #{exchangeName,jdbcType=VARCHAR}, | ||
189 | + virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}, | ||
190 | + exchange_type = #{exchangeType,jdbcType=VARCHAR}, | ||
191 | + durability = #{durability,jdbcType=BOOLEAN}, | ||
192 | + auto_delete = #{autoDelete,jdbcType=BOOLEAN}, | ||
193 | + internal = #{internal,jdbcType=BOOLEAN}, | ||
194 | + arguments = #{arguments,jdbcType=VARCHAR}, | ||
195 | + description = #{description,jdbcType=VARCHAR}, | ||
196 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
197 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
198 | + where id = #{id,jdbcType=VARCHAR} | ||
199 | + </update> | ||
200 | + | ||
201 | +</mapper> |
src/main/resources/mapper/BusQueueMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.BusQueueMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.BusQueue"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table bus_queue--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="queue_name" jdbcType="VARCHAR" property="queueName"/> | ||
9 | + <result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId"/> | ||
10 | + <result column="durability" jdbcType="BOOLEAN" property="durability"/> | ||
11 | + <result column="auto_delete" jdbcType="BOOLEAN" property="autoDelete"/> | ||
12 | + <result column="arguments" jdbcType="VARCHAR" property="arguments"/> | ||
13 | + <result column="description" jdbcType="VARCHAR" property="description"/> | ||
14 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
15 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
16 | + </resultMap> | ||
17 | + <sql id="Base_Column_List"> | ||
18 | + <!--@mbg.generated--> | ||
19 | + id, queue_name, virtual_host_id, durability, auto_delete, arguments, description, | ||
20 | + gmt_create, gmt_modified | ||
21 | + </sql> | ||
22 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
23 | + <!--@mbg.generated--> | ||
24 | + select | ||
25 | + <include refid="Base_Column_List"/> | ||
26 | + from bus_queue | ||
27 | + where id = #{id,jdbcType=VARCHAR} | ||
28 | + </select> | ||
29 | + <!-- 获取消息队列,列表 --> | ||
30 | + <select id="selectBusQueueList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue" | ||
31 | + resultMap="BaseResultMap"> | ||
32 | + select | ||
33 | + <include refid="Base_Column_List"/> | ||
34 | + from bus_queue | ||
35 | + <where> | ||
36 | + <!-- 消息队列名称 --> | ||
37 | + <if test="queueName != null and queueName !=''"> | ||
38 | + queue_name = #{queueName,jdbcType=VARCHAR} | ||
39 | + </if> | ||
40 | + </where> | ||
41 | + </select> | ||
42 | + <!-- 校验消息队列是否已存在--> | ||
43 | + <select id="validateBusQueue" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue" | ||
44 | + resultMap="BaseResultMap"> | ||
45 | + select | ||
46 | + <include refid="Base_Column_List"/> | ||
47 | + from bus_queue | ||
48 | + <where> | ||
49 | + <!-- 消息队列名称 --> | ||
50 | + <if test="queueName != null and queueName !=''"> | ||
51 | + queue_name = #{queueName,jdbcType=VARCHAR} | ||
52 | + </if> | ||
53 | + </where> | ||
54 | + </select> | ||
55 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
56 | + <!--@mbg.generated--> | ||
57 | + delete from bus_queue | ||
58 | + where id = #{id,jdbcType=VARCHAR} | ||
59 | + </delete> | ||
60 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"> | ||
61 | + <!--@mbg.generated--> | ||
62 | + insert into bus_queue (id, queue_name, virtual_host_id, | ||
63 | + durability, auto_delete, arguments, | ||
64 | + description, gmt_create, gmt_modified | ||
65 | + ) | ||
66 | + values (#{id,jdbcType=VARCHAR}, #{queueName,jdbcType=VARCHAR}, #{virtualHostId,jdbcType=VARCHAR}, | ||
67 | + #{durability,jdbcType=BOOLEAN}, #{autoDelete,jdbcType=BOOLEAN}, #{arguments,jdbcType=VARCHAR}, | ||
68 | + #{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP} | ||
69 | + ) | ||
70 | + </insert> | ||
71 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"> | ||
72 | + <!--@mbg.generated--> | ||
73 | + insert into bus_queue | ||
74 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
75 | + <if test="id != null"> | ||
76 | + id, | ||
77 | + </if> | ||
78 | + <if test="queueName != null"> | ||
79 | + queue_name, | ||
80 | + </if> | ||
81 | + <if test="virtualHostId != null"> | ||
82 | + virtual_host_id, | ||
83 | + </if> | ||
84 | + <if test="durability != null"> | ||
85 | + durability, | ||
86 | + </if> | ||
87 | + <if test="autoDelete != null"> | ||
88 | + auto_delete, | ||
89 | + </if> | ||
90 | + <if test="arguments != null"> | ||
91 | + arguments, | ||
92 | + </if> | ||
93 | + <if test="description != null"> | ||
94 | + description, | ||
95 | + </if> | ||
96 | + <if test="gmtCreate != null"> | ||
97 | + gmt_create, | ||
98 | + </if> | ||
99 | + <if test="gmtModified != null"> | ||
100 | + gmt_modified, | ||
101 | + </if> | ||
102 | + </trim> | ||
103 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
104 | + <if test="id != null"> | ||
105 | + #{id,jdbcType=VARCHAR}, | ||
106 | + </if> | ||
107 | + <if test="queueName != null"> | ||
108 | + #{queueName,jdbcType=VARCHAR}, | ||
109 | + </if> | ||
110 | + <if test="virtualHostId != null"> | ||
111 | + #{virtualHostId,jdbcType=VARCHAR}, | ||
112 | + </if> | ||
113 | + <if test="durability != null"> | ||
114 | + #{durability,jdbcType=BOOLEAN}, | ||
115 | + </if> | ||
116 | + <if test="autoDelete != null"> | ||
117 | + #{autoDelete,jdbcType=BOOLEAN}, | ||
118 | + </if> | ||
119 | + <if test="arguments != null"> | ||
120 | + #{arguments,jdbcType=VARCHAR}, | ||
121 | + </if> | ||
122 | + <if test="description != null"> | ||
123 | + #{description,jdbcType=VARCHAR}, | ||
124 | + </if> | ||
125 | + <if test="gmtCreate != null"> | ||
126 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
127 | + </if> | ||
128 | + <if test="gmtModified != null"> | ||
129 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
130 | + </if> | ||
131 | + </trim> | ||
132 | + </insert> | ||
133 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"> | ||
134 | + <!--@mbg.generated--> | ||
135 | + update bus_queue | ||
136 | + <set> | ||
137 | + <if test="queueName != null"> | ||
138 | + queue_name = #{queueName,jdbcType=VARCHAR}, | ||
139 | + </if> | ||
140 | + <if test="virtualHostId != null"> | ||
141 | + virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}, | ||
142 | + </if> | ||
143 | + <if test="durability != null"> | ||
144 | + durability = #{durability,jdbcType=BOOLEAN}, | ||
145 | + </if> | ||
146 | + <if test="autoDelete != null"> | ||
147 | + auto_delete = #{autoDelete,jdbcType=BOOLEAN}, | ||
148 | + </if> | ||
149 | + <if test="arguments != null"> | ||
150 | + arguments = #{arguments,jdbcType=VARCHAR}, | ||
151 | + </if> | ||
152 | + <if test="description != null"> | ||
153 | + description = #{description,jdbcType=VARCHAR}, | ||
154 | + </if> | ||
155 | + <if test="gmtCreate != null"> | ||
156 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
157 | + </if> | ||
158 | + <if test="gmtModified != null"> | ||
159 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
160 | + </if> | ||
161 | + </set> | ||
162 | + where id = #{id,jdbcType=VARCHAR} | ||
163 | + </update> | ||
164 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"> | ||
165 | + <!--@mbg.generated--> | ||
166 | + update bus_queue | ||
167 | + set queue_name = #{queueName,jdbcType=VARCHAR}, | ||
168 | + virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}, | ||
169 | + durability = #{durability,jdbcType=BOOLEAN}, | ||
170 | + auto_delete = #{autoDelete,jdbcType=BOOLEAN}, | ||
171 | + arguments = #{arguments,jdbcType=VARCHAR}, | ||
172 | + description = #{description,jdbcType=VARCHAR}, | ||
173 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
174 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
175 | + where id = #{id,jdbcType=VARCHAR} | ||
176 | + </update> | ||
177 | + | ||
178 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.BusServerMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.BusServer"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table bus_server--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="server_name" jdbcType="VARCHAR" property="serverName"/> | ||
9 | + <result column="server_ip" jdbcType="VARCHAR" property="serverIp"/> | ||
10 | + <result column="server_port" jdbcType="VARCHAR" property="serverPort"/> | ||
11 | + <result column="description" jdbcType="VARCHAR" property="description"/> | ||
12 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
13 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
14 | + </resultMap> | ||
15 | + <sql id="Base_Column_List"> | ||
16 | + <!--@mbg.generated--> | ||
17 | + id, `server_name`, server_ip, server_port, description, gmt_create, gmt_modified | ||
18 | + </sql> | ||
19 | + | ||
20 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
21 | + <!--@mbg.generated--> | ||
22 | + select | ||
23 | + <include refid="Base_Column_List"/> | ||
24 | + from bus_server | ||
25 | + where id = #{id,jdbcType=VARCHAR} | ||
26 | + </select> | ||
27 | + | ||
28 | + <!-- 获取服务器列表 --> | ||
29 | + <select id="selectBusServerList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer" | ||
30 | + resultMap="BaseResultMap"> | ||
31 | + select | ||
32 | + <include refid="Base_Column_List"/> | ||
33 | + from bus_server | ||
34 | + <where> | ||
35 | + <!-- 服务器名称 --> | ||
36 | + <if test="serverName != null and serverName !=''"> | ||
37 | + server_name = #{serverName,jdbcType=VARCHAR} | ||
38 | + </if> | ||
39 | + </where> | ||
40 | + </select> | ||
41 | + | ||
42 | + <!-- 校验服务器信息是否存在 --> | ||
43 | + <select id="validateBusServer" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer" | ||
44 | + resultMap="BaseResultMap"> | ||
45 | + select | ||
46 | + <include refid="Base_Column_List"/> | ||
47 | + from bus_server | ||
48 | + <where> | ||
49 | + <!-- 服务器的ip --> | ||
50 | + <if test="serverIp != null and serverIp !=''"> | ||
51 | + server_ip = #{serverIp,jdbcType=VARCHAR} | ||
52 | + </if> | ||
53 | + <!-- 服务器的port --> | ||
54 | + <if test="serverPort != null and serverPort !=''"> | ||
55 | + AND server_port = #{serverPort,jdbcType=VARCHAR} | ||
56 | + </if> | ||
57 | + </where> | ||
58 | + </select> | ||
59 | + | ||
60 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
61 | + <!--@mbg.generated--> | ||
62 | + delete from bus_server | ||
63 | + where id = #{id,jdbcType=VARCHAR} | ||
64 | + </delete> | ||
65 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer"> | ||
66 | + <!--@mbg.generated--> | ||
67 | + insert into bus_server (id, `server_name`, server_ip, | ||
68 | + server_port, description, gmt_create, | ||
69 | + gmt_modified) | ||
70 | + values (#{id,jdbcType=VARCHAR}, #{serverName,jdbcType=VARCHAR}, #{serverIp,jdbcType=VARCHAR}, | ||
71 | + #{serverPort,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, | ||
72 | + #{gmtModified,jdbcType=TIMESTAMP}) | ||
73 | + </insert> | ||
74 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer"> | ||
75 | + <!--@mbg.generated--> | ||
76 | + insert into bus_server | ||
77 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
78 | + <if test="id != null"> | ||
79 | + id, | ||
80 | + </if> | ||
81 | + <if test="serverName != null"> | ||
82 | + `server_name`, | ||
83 | + </if> | ||
84 | + <if test="serverIp != null"> | ||
85 | + server_ip, | ||
86 | + </if> | ||
87 | + <if test="serverPort != null"> | ||
88 | + server_port, | ||
89 | + </if> | ||
90 | + <if test="description != null"> | ||
91 | + description, | ||
92 | + </if> | ||
93 | + <if test="gmtCreate != null"> | ||
94 | + gmt_create, | ||
95 | + </if> | ||
96 | + <if test="gmtModified != null"> | ||
97 | + gmt_modified, | ||
98 | + </if> | ||
99 | + </trim> | ||
100 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
101 | + <if test="id != null"> | ||
102 | + #{id,jdbcType=VARCHAR}, | ||
103 | + </if> | ||
104 | + <if test="serverName != null"> | ||
105 | + #{serverName,jdbcType=VARCHAR}, | ||
106 | + </if> | ||
107 | + <if test="serverIp != null"> | ||
108 | + #{serverIp,jdbcType=VARCHAR}, | ||
109 | + </if> | ||
110 | + <if test="serverPort != null"> | ||
111 | + #{serverPort,jdbcType=VARCHAR}, | ||
112 | + </if> | ||
113 | + <if test="description != null"> | ||
114 | + #{description,jdbcType=VARCHAR}, | ||
115 | + </if> | ||
116 | + <if test="gmtCreate != null"> | ||
117 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
118 | + </if> | ||
119 | + <if test="gmtModified != null"> | ||
120 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
121 | + </if> | ||
122 | + </trim> | ||
123 | + </insert> | ||
124 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer"> | ||
125 | + <!--@mbg.generated--> | ||
126 | + update bus_server | ||
127 | + <set> | ||
128 | + <if test="serverName != null"> | ||
129 | + `server_name` = #{serverName,jdbcType=VARCHAR}, | ||
130 | + </if> | ||
131 | + <if test="serverIp != null"> | ||
132 | + server_ip = #{serverIp,jdbcType=VARCHAR}, | ||
133 | + </if> | ||
134 | + <if test="serverPort != null"> | ||
135 | + server_port = #{serverPort,jdbcType=VARCHAR}, | ||
136 | + </if> | ||
137 | + <if test="description != null"> | ||
138 | + description = #{description,jdbcType=VARCHAR}, | ||
139 | + </if> | ||
140 | + <if test="gmtCreate != null"> | ||
141 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
142 | + </if> | ||
143 | + <if test="gmtModified != null"> | ||
144 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
145 | + </if> | ||
146 | + </set> | ||
147 | + where id = #{id,jdbcType=VARCHAR} | ||
148 | + </update> | ||
149 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer"> | ||
150 | + <!--@mbg.generated--> | ||
151 | + update bus_server | ||
152 | + set `server_name` = #{serverName,jdbcType=VARCHAR}, | ||
153 | + server_ip = #{serverIp,jdbcType=VARCHAR}, | ||
154 | + server_port = #{serverPort,jdbcType=VARCHAR}, | ||
155 | + description = #{description,jdbcType=VARCHAR}, | ||
156 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
157 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
158 | + where id = #{id,jdbcType=VARCHAR} | ||
159 | + </update> | ||
160 | + | ||
161 | + | ||
162 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.ExchangeQueueRoutingMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table exchange_queue_routing--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id" /> | ||
8 | + <result column="exchange_id" jdbcType="VARCHAR" property="exchangeId" /> | ||
9 | + <result column="queue_id" jdbcType="VARCHAR" property="queueId" /> | ||
10 | + <result column="routing_key_id" jdbcType="VARCHAR" property="routingKeyId" /> | ||
11 | + <result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName" /> | ||
12 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" /> | ||
13 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" /> | ||
14 | + </resultMap> | ||
15 | + <sql id="Base_Column_List"> | ||
16 | + <!--@mbg.generated--> | ||
17 | + id, exchange_id, queue_id, routing_key_id, routing_key_name, gmt_create, gmt_modified | ||
18 | + </sql> | ||
19 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
20 | + <!--@mbg.generated--> | ||
21 | + select | ||
22 | + <include refid="Base_Column_List" /> | ||
23 | + from exchange_queue_routing | ||
24 | + where id = #{id,jdbcType=VARCHAR} | ||
25 | + </select> | ||
26 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
27 | + <!--@mbg.generated--> | ||
28 | + delete from exchange_queue_routing | ||
29 | + where id = #{id,jdbcType=VARCHAR} | ||
30 | + </delete> | ||
31 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting"> | ||
32 | + <!--@mbg.generated--> | ||
33 | + insert into exchange_queue_routing (id, exchange_id, queue_id, | ||
34 | + routing_key_id, routing_key_name, gmt_create, | ||
35 | + gmt_modified) | ||
36 | + values (#{id,jdbcType=VARCHAR}, #{exchangeId,jdbcType=VARCHAR}, #{queueId,jdbcType=VARCHAR}, | ||
37 | + #{routingKeyId,jdbcType=VARCHAR}, #{routingKeyName,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, | ||
38 | + #{gmtModified,jdbcType=TIMESTAMP}) | ||
39 | + </insert> | ||
40 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting"> | ||
41 | + <!--@mbg.generated--> | ||
42 | + insert into exchange_queue_routing | ||
43 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
44 | + <if test="id != null"> | ||
45 | + id, | ||
46 | + </if> | ||
47 | + <if test="exchangeId != null"> | ||
48 | + exchange_id, | ||
49 | + </if> | ||
50 | + <if test="queueId != null"> | ||
51 | + queue_id, | ||
52 | + </if> | ||
53 | + <if test="routingKeyId != null"> | ||
54 | + routing_key_id, | ||
55 | + </if> | ||
56 | + <if test="routingKeyName != null"> | ||
57 | + routing_key_name, | ||
58 | + </if> | ||
59 | + <if test="gmtCreate != null"> | ||
60 | + gmt_create, | ||
61 | + </if> | ||
62 | + <if test="gmtModified != null"> | ||
63 | + gmt_modified, | ||
64 | + </if> | ||
65 | + </trim> | ||
66 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
67 | + <if test="id != null"> | ||
68 | + #{id,jdbcType=VARCHAR}, | ||
69 | + </if> | ||
70 | + <if test="exchangeId != null"> | ||
71 | + #{exchangeId,jdbcType=VARCHAR}, | ||
72 | + </if> | ||
73 | + <if test="queueId != null"> | ||
74 | + #{queueId,jdbcType=VARCHAR}, | ||
75 | + </if> | ||
76 | + <if test="routingKeyId != null"> | ||
77 | + #{routingKeyId,jdbcType=VARCHAR}, | ||
78 | + </if> | ||
79 | + <if test="routingKeyName != null"> | ||
80 | + #{routingKeyName,jdbcType=VARCHAR}, | ||
81 | + </if> | ||
82 | + <if test="gmtCreate != null"> | ||
83 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
84 | + </if> | ||
85 | + <if test="gmtModified != null"> | ||
86 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
87 | + </if> | ||
88 | + </trim> | ||
89 | + </insert> | ||
90 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting"> | ||
91 | + <!--@mbg.generated--> | ||
92 | + update exchange_queue_routing | ||
93 | + <set> | ||
94 | + <if test="exchangeId != null"> | ||
95 | + exchange_id = #{exchangeId,jdbcType=VARCHAR}, | ||
96 | + </if> | ||
97 | + <if test="queueId != null"> | ||
98 | + queue_id = #{queueId,jdbcType=VARCHAR}, | ||
99 | + </if> | ||
100 | + <if test="routingKeyId != null"> | ||
101 | + routing_key_id = #{routingKeyId,jdbcType=VARCHAR}, | ||
102 | + </if> | ||
103 | + <if test="routingKeyName != null"> | ||
104 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
105 | + </if> | ||
106 | + <if test="gmtCreate != null"> | ||
107 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
108 | + </if> | ||
109 | + <if test="gmtModified != null"> | ||
110 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
111 | + </if> | ||
112 | + </set> | ||
113 | + where id = #{id,jdbcType=VARCHAR} | ||
114 | + </update> | ||
115 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.ExchangeQueueRouting"> | ||
116 | + <!--@mbg.generated--> | ||
117 | + update exchange_queue_routing | ||
118 | + set exchange_id = #{exchangeId,jdbcType=VARCHAR}, | ||
119 | + queue_id = #{queueId,jdbcType=VARCHAR}, | ||
120 | + routing_key_id = #{routingKeyId,jdbcType=VARCHAR}, | ||
121 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
122 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
123 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
124 | + where id = #{id,jdbcType=VARCHAR} | ||
125 | + </update> | ||
126 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.MessageNoteMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.MessageNote"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table message_note--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="user_id" jdbcType="VARCHAR" property="userId"/> | ||
9 | + <result column="username" jdbcType="VARCHAR" property="username"/> | ||
10 | + <result column="server_name" jdbcType="VARCHAR" property="serverName"/> | ||
11 | + <result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName"/> | ||
12 | + <result column="exchange_name" jdbcType="VARCHAR" property="exchangeName"/> | ||
13 | + <result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName"/> | ||
14 | + <result column="queue_name" jdbcType="VARCHAR" property="queueName"/> | ||
15 | + <result column="send_time" jdbcType="TIMESTAMP" property="sendTime"/> | ||
16 | + <result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime"/> | ||
17 | + <result column="send_content" jdbcType="BLOB" property="sendContent"/> | ||
18 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
19 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
20 | + </resultMap> | ||
21 | + <sql id="Base_Column_List"> | ||
22 | + <!--@mbg.generated--> | ||
23 | + id, user_id, username, `server_name`, virtual_host_name, exchange_name, routing_key_name, | ||
24 | + queue_name, send_time, receive_time, send_content, gmt_create, gmt_modified | ||
25 | + </sql> | ||
26 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
27 | + <!--@mbg.generated--> | ||
28 | + select | ||
29 | + <include refid="Base_Column_List"/> | ||
30 | + from message_note | ||
31 | + where id = #{id,jdbcType=VARCHAR} | ||
32 | + </select> | ||
33 | + <!-- 获取,消息收发记录列表 --> | ||
34 | + <select id="selectMessageNoteList" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote" | ||
35 | + resultMap="BaseResultMap"> | ||
36 | + select | ||
37 | + <include refid="Base_Column_List"/> | ||
38 | + from message_note | ||
39 | + <where> | ||
40 | + <!-- 所属用户登陆名称 --> | ||
41 | + <if test="username != null and username !=''"> | ||
42 | + username = #{username,jdbcType=VARCHAR} | ||
43 | + </if> | ||
44 | + <!-- 所属服务器名称 --> | ||
45 | + <if test="serverName != null and serverName !=''"> | ||
46 | + AND server_name = #{serverName,jdbcType=VARCHAR} | ||
47 | + </if> | ||
48 | + <!-- 所属虚拟主机名称 --> | ||
49 | + <if test="virtualHostName != null and virtualHostName !=''"> | ||
50 | + AND virtual_host_name = #{virtualHostName,jdbcType=VARCHAR} | ||
51 | + </if> | ||
52 | + <!-- 所属交换机名称 --> | ||
53 | + <if test="exchangeName != null and exchangeName !=''"> | ||
54 | + AND exchange_name = #{exchangeName,jdbcType=VARCHAR} | ||
55 | + </if> | ||
56 | + <!-- 所属路由键名称 --> | ||
57 | + <if test="routingKeyName != null and routingKeyName !=''"> | ||
58 | + AND routing_key_name = #{routingKeyName,jdbcType=VARCHAR} | ||
59 | + </if> | ||
60 | + <!-- 所属队列名称 --> | ||
61 | + <if test="queueName != null and queueName !=''"> | ||
62 | + AND queue_name = #{queueName,jdbcType=VARCHAR} | ||
63 | + </if> | ||
64 | + <!-- 消息发送时间 --> | ||
65 | + <if test="sendTime != null"> | ||
66 | + AND DATE_FORMAT(send_time,'%Y-%m-%d') = #{sendTime,jdbcType=DATE} | ||
67 | + </if> | ||
68 | + <!-- 消息接收时间 --> | ||
69 | + <if test="receiveTime != null"> | ||
70 | + AND DATE_FORMAT(receive_time,'%Y-%m-%d') = #{receiveTime,jdbcType=DATE} | ||
71 | + </if> | ||
72 | + </where> | ||
73 | + </select> | ||
74 | + | ||
75 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
76 | + <!--@mbg.generated--> | ||
77 | + delete from message_note | ||
78 | + where id = #{id,jdbcType=VARCHAR} | ||
79 | + </delete> | ||
80 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote"> | ||
81 | + <!--@mbg.generated--> | ||
82 | + insert into message_note (id, user_id, username, | ||
83 | + `server_name`, virtual_host_name, exchange_name, | ||
84 | + routing_key_name, queue_name, send_time, | ||
85 | + receive_time, send_content, gmt_create, | ||
86 | + gmt_modified) | ||
87 | + values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, | ||
88 | + #{serverName,jdbcType=VARCHAR}, #{virtualHostName,jdbcType=VARCHAR}, #{exchangeName,jdbcType=VARCHAR}, | ||
89 | + #{routingKeyName,jdbcType=VARCHAR}, #{queueName,jdbcType=VARCHAR}, #{sendTime,jdbcType=TIMESTAMP}, | ||
90 | + #{receiveTime,jdbcType=TIMESTAMP}, #{sendContent,jdbcType=BLOB}, #{gmtCreate,jdbcType=TIMESTAMP}, | ||
91 | + #{gmtModified,jdbcType=TIMESTAMP}) | ||
92 | + </insert> | ||
93 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote"> | ||
94 | + <!--@mbg.generated--> | ||
95 | + insert into message_note | ||
96 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
97 | + <if test="id != null"> | ||
98 | + id, | ||
99 | + </if> | ||
100 | + <if test="userId != null"> | ||
101 | + user_id, | ||
102 | + </if> | ||
103 | + <if test="username != null"> | ||
104 | + username, | ||
105 | + </if> | ||
106 | + <if test="serverName != null"> | ||
107 | + `server_name`, | ||
108 | + </if> | ||
109 | + <if test="virtualHostName != null"> | ||
110 | + virtual_host_name, | ||
111 | + </if> | ||
112 | + <if test="exchangeName != null"> | ||
113 | + exchange_name, | ||
114 | + </if> | ||
115 | + <if test="routingKeyName != null"> | ||
116 | + routing_key_name, | ||
117 | + </if> | ||
118 | + <if test="queueName != null"> | ||
119 | + queue_name, | ||
120 | + </if> | ||
121 | + <if test="sendTime != null"> | ||
122 | + send_time, | ||
123 | + </if> | ||
124 | + <if test="receiveTime != null"> | ||
125 | + receive_time, | ||
126 | + </if> | ||
127 | + <if test="sendContent != null"> | ||
128 | + send_content, | ||
129 | + </if> | ||
130 | + <if test="gmtCreate != null"> | ||
131 | + gmt_create, | ||
132 | + </if> | ||
133 | + <if test="gmtModified != null"> | ||
134 | + gmt_modified, | ||
135 | + </if> | ||
136 | + </trim> | ||
137 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
138 | + <if test="id != null"> | ||
139 | + #{id,jdbcType=VARCHAR}, | ||
140 | + </if> | ||
141 | + <if test="userId != null"> | ||
142 | + #{userId,jdbcType=VARCHAR}, | ||
143 | + </if> | ||
144 | + <if test="username != null"> | ||
145 | + #{username,jdbcType=VARCHAR}, | ||
146 | + </if> | ||
147 | + <if test="serverName != null"> | ||
148 | + #{serverName,jdbcType=VARCHAR}, | ||
149 | + </if> | ||
150 | + <if test="virtualHostName != null"> | ||
151 | + #{virtualHostName,jdbcType=VARCHAR}, | ||
152 | + </if> | ||
153 | + <if test="exchangeName != null"> | ||
154 | + #{exchangeName,jdbcType=VARCHAR}, | ||
155 | + </if> | ||
156 | + <if test="routingKeyName != null"> | ||
157 | + #{routingKeyName,jdbcType=VARCHAR}, | ||
158 | + </if> | ||
159 | + <if test="queueName != null"> | ||
160 | + #{queueName,jdbcType=VARCHAR}, | ||
161 | + </if> | ||
162 | + <if test="sendTime != null"> | ||
163 | + #{sendTime,jdbcType=TIMESTAMP}, | ||
164 | + </if> | ||
165 | + <if test="receiveTime != null"> | ||
166 | + #{receiveTime,jdbcType=TIMESTAMP}, | ||
167 | + </if> | ||
168 | + <if test="sendContent != null"> | ||
169 | + #{sendContent,jdbcType=BLOB}, | ||
170 | + </if> | ||
171 | + <if test="gmtCreate != null"> | ||
172 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
173 | + </if> | ||
174 | + <if test="gmtModified != null"> | ||
175 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
176 | + </if> | ||
177 | + </trim> | ||
178 | + </insert> | ||
179 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote"> | ||
180 | + <!--@mbg.generated--> | ||
181 | + update message_note | ||
182 | + <set> | ||
183 | + <if test="userId != null"> | ||
184 | + user_id = #{userId,jdbcType=VARCHAR}, | ||
185 | + </if> | ||
186 | + <if test="username != null"> | ||
187 | + username = #{username,jdbcType=VARCHAR}, | ||
188 | + </if> | ||
189 | + <if test="serverName != null"> | ||
190 | + `server_name` = #{serverName,jdbcType=VARCHAR}, | ||
191 | + </if> | ||
192 | + <if test="virtualHostName != null"> | ||
193 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}, | ||
194 | + </if> | ||
195 | + <if test="exchangeName != null"> | ||
196 | + exchange_name = #{exchangeName,jdbcType=VARCHAR}, | ||
197 | + </if> | ||
198 | + <if test="routingKeyName != null"> | ||
199 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
200 | + </if> | ||
201 | + <if test="queueName != null"> | ||
202 | + queue_name = #{queueName,jdbcType=VARCHAR}, | ||
203 | + </if> | ||
204 | + <if test="sendTime != null"> | ||
205 | + send_time = #{sendTime,jdbcType=TIMESTAMP}, | ||
206 | + </if> | ||
207 | + <if test="receiveTime != null"> | ||
208 | + receive_time = #{receiveTime,jdbcType=TIMESTAMP}, | ||
209 | + </if> | ||
210 | + <if test="sendContent != null"> | ||
211 | + send_content = #{sendContent,jdbcType=BLOB}, | ||
212 | + </if> | ||
213 | + <if test="gmtCreate != null"> | ||
214 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
215 | + </if> | ||
216 | + <if test="gmtModified != null"> | ||
217 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
218 | + </if> | ||
219 | + </set> | ||
220 | + where id = #{id,jdbcType=VARCHAR} | ||
221 | + </update> | ||
222 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote"> | ||
223 | + <!--@mbg.generated--> | ||
224 | + update message_note | ||
225 | + set user_id = #{userId,jdbcType=VARCHAR}, | ||
226 | + username = #{username,jdbcType=VARCHAR}, | ||
227 | + `server_name` = #{serverName,jdbcType=VARCHAR}, | ||
228 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}, | ||
229 | + exchange_name = #{exchangeName,jdbcType=VARCHAR}, | ||
230 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
231 | + queue_name = #{queueName,jdbcType=VARCHAR}, | ||
232 | + send_time = #{sendTime,jdbcType=TIMESTAMP}, | ||
233 | + receive_time = #{receiveTime,jdbcType=TIMESTAMP}, | ||
234 | + send_content = #{sendContent,jdbcType=BLOB}, | ||
235 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
236 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
237 | + where id = #{id,jdbcType=VARCHAR} | ||
238 | + </update> | ||
239 | + | ||
240 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.RoutingKeyMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table routing_key--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName"/> | ||
9 | + <result column="exchange_id" jdbcType="VARCHAR" property="exchangeId"/> | ||
10 | + <result column="description" jdbcType="VARCHAR" property="description"/> | ||
11 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
12 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
13 | + </resultMap> | ||
14 | + <sql id="Base_Column_List"> | ||
15 | + <!--@mbg.generated--> | ||
16 | + id, routing_key_name, exchange_id, description, gmt_create, gmt_modified | ||
17 | + </sql> | ||
18 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
19 | + <!--@mbg.generated--> | ||
20 | + select | ||
21 | + <include refid="Base_Column_List"/> | ||
22 | + from routing_key | ||
23 | + where id = #{id,jdbcType=VARCHAR} | ||
24 | + </select> | ||
25 | + | ||
26 | + <!-- 查询路由键列表 --> | ||
27 | + <select id="selectRoutingKeyList" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey" | ||
28 | + resultMap="BaseResultMap"> | ||
29 | + select | ||
30 | + <include refid="Base_Column_List"/> | ||
31 | + from routing_key | ||
32 | + <where> | ||
33 | + <!-- 路由键名称 --> | ||
34 | + <if test="routingKeyName != null and routingKeyName !=''"> | ||
35 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR} | ||
36 | + </if> | ||
37 | + </where> | ||
38 | + </select> | ||
39 | + <!-- 校验路由键是否已存在 --> | ||
40 | + <select id="validateRoutingKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey" | ||
41 | + resultMap="BaseResultMap"> | ||
42 | + select | ||
43 | + <include refid="Base_Column_List"/> | ||
44 | + from routing_key | ||
45 | + <where> | ||
46 | + <!-- 路由键名称 --> | ||
47 | + <if test="routingKeyName != null and routingKeyName !=''"> | ||
48 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR} | ||
49 | + </if> | ||
50 | + </where> | ||
51 | + </select> | ||
52 | + | ||
53 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
54 | + <!--@mbg.generated--> | ||
55 | + delete from routing_key | ||
56 | + where id = #{id,jdbcType=VARCHAR} | ||
57 | + </delete> | ||
58 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"> | ||
59 | + <!--@mbg.generated--> | ||
60 | + insert into routing_key (id, routing_key_name, exchange_id, | ||
61 | + description, gmt_create, gmt_modified | ||
62 | + ) | ||
63 | + values (#{id,jdbcType=VARCHAR}, #{routingKeyName,jdbcType=VARCHAR}, #{exchangeId,jdbcType=VARCHAR}, | ||
64 | + #{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP} | ||
65 | + ) | ||
66 | + </insert> | ||
67 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"> | ||
68 | + <!--@mbg.generated--> | ||
69 | + insert into routing_key | ||
70 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
71 | + <if test="id != null"> | ||
72 | + id, | ||
73 | + </if> | ||
74 | + <if test="routingKeyName != null"> | ||
75 | + routing_key_name, | ||
76 | + </if> | ||
77 | + <if test="exchangeId != null"> | ||
78 | + exchange_id, | ||
79 | + </if> | ||
80 | + <if test="description != null"> | ||
81 | + description, | ||
82 | + </if> | ||
83 | + <if test="gmtCreate != null"> | ||
84 | + gmt_create, | ||
85 | + </if> | ||
86 | + <if test="gmtModified != null"> | ||
87 | + gmt_modified, | ||
88 | + </if> | ||
89 | + </trim> | ||
90 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
91 | + <if test="id != null"> | ||
92 | + #{id,jdbcType=VARCHAR}, | ||
93 | + </if> | ||
94 | + <if test="routingKeyName != null"> | ||
95 | + #{routingKeyName,jdbcType=VARCHAR}, | ||
96 | + </if> | ||
97 | + <if test="exchangeId != null"> | ||
98 | + #{exchangeId,jdbcType=VARCHAR}, | ||
99 | + </if> | ||
100 | + <if test="description != null"> | ||
101 | + #{description,jdbcType=VARCHAR}, | ||
102 | + </if> | ||
103 | + <if test="gmtCreate != null"> | ||
104 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
105 | + </if> | ||
106 | + <if test="gmtModified != null"> | ||
107 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
108 | + </if> | ||
109 | + </trim> | ||
110 | + </insert> | ||
111 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"> | ||
112 | + <!--@mbg.generated--> | ||
113 | + update routing_key | ||
114 | + <set> | ||
115 | + <if test="routingKeyName != null"> | ||
116 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
117 | + </if> | ||
118 | + <if test="exchangeId != null"> | ||
119 | + exchange_id = #{exchangeId,jdbcType=VARCHAR}, | ||
120 | + </if> | ||
121 | + <if test="description != null"> | ||
122 | + description = #{description,jdbcType=VARCHAR}, | ||
123 | + </if> | ||
124 | + <if test="gmtCreate != null"> | ||
125 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
126 | + </if> | ||
127 | + <if test="gmtModified != null"> | ||
128 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
129 | + </if> | ||
130 | + </set> | ||
131 | + where id = #{id,jdbcType=VARCHAR} | ||
132 | + </update> | ||
133 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"> | ||
134 | + <!--@mbg.generated--> | ||
135 | + update routing_key | ||
136 | + set routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
137 | + exchange_id = #{exchangeId,jdbcType=VARCHAR}, | ||
138 | + description = #{description,jdbcType=VARCHAR}, | ||
139 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
140 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
141 | + where id = #{id,jdbcType=VARCHAR} | ||
142 | + </update> | ||
143 | + | ||
144 | +</mapper> |
src/main/resources/mapper/UserInfoMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.UserInfoMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.UserInfo"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table user_info--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="username" jdbcType="VARCHAR" property="username"/> | ||
9 | + <result column="password" jdbcType="VARCHAR" property="password"/> | ||
10 | + <result column="description" jdbcType="VARCHAR" property="description"/> | ||
11 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
12 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
13 | + </resultMap> | ||
14 | + <sql id="Base_Column_List"> | ||
15 | + <!--@mbg.generated--> | ||
16 | + id, username, `password`, description, gmt_create, gmt_modified | ||
17 | + </sql> | ||
18 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
19 | + <!--@mbg.generated--> | ||
20 | + select | ||
21 | + <include refid="Base_Column_List"/> | ||
22 | + from user_info | ||
23 | + where id = #{id,jdbcType=VARCHAR} | ||
24 | + </select> | ||
25 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
26 | + <!--@mbg.generated--> | ||
27 | + delete from user_info | ||
28 | + where id = #{id,jdbcType=VARCHAR} | ||
29 | + </delete> | ||
30 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserInfo"> | ||
31 | + <!--@mbg.generated--> | ||
32 | + insert into user_info (id, username, `password`, | ||
33 | + description, gmt_create, gmt_modified | ||
34 | + ) | ||
35 | + values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, | ||
36 | + #{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP} | ||
37 | + ) | ||
38 | + </insert> | ||
39 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserInfo"> | ||
40 | + <!--@mbg.generated--> | ||
41 | + insert into user_info | ||
42 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
43 | + <if test="id != null"> | ||
44 | + id, | ||
45 | + </if> | ||
46 | + <if test="username != null"> | ||
47 | + username, | ||
48 | + </if> | ||
49 | + <if test="password != null"> | ||
50 | + `password`, | ||
51 | + </if> | ||
52 | + <if test="description != null"> | ||
53 | + description, | ||
54 | + </if> | ||
55 | + <if test="gmtCreate != null"> | ||
56 | + gmt_create, | ||
57 | + </if> | ||
58 | + <if test="gmtModified != null"> | ||
59 | + gmt_modified, | ||
60 | + </if> | ||
61 | + </trim> | ||
62 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
63 | + <if test="id != null"> | ||
64 | + #{id,jdbcType=VARCHAR}, | ||
65 | + </if> | ||
66 | + <if test="username != null"> | ||
67 | + #{username,jdbcType=VARCHAR}, | ||
68 | + </if> | ||
69 | + <if test="password != null"> | ||
70 | + #{password,jdbcType=VARCHAR}, | ||
71 | + </if> | ||
72 | + <if test="description != null"> | ||
73 | + #{description,jdbcType=VARCHAR}, | ||
74 | + </if> | ||
75 | + <if test="gmtCreate != null"> | ||
76 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
77 | + </if> | ||
78 | + <if test="gmtModified != null"> | ||
79 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
80 | + </if> | ||
81 | + </trim> | ||
82 | + </insert> | ||
83 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserInfo"> | ||
84 | + <!--@mbg.generated--> | ||
85 | + update user_info | ||
86 | + <set> | ||
87 | + <if test="username != null"> | ||
88 | + username = #{username,jdbcType=VARCHAR}, | ||
89 | + </if> | ||
90 | + <if test="password != null"> | ||
91 | + `password` = #{password,jdbcType=VARCHAR}, | ||
92 | + </if> | ||
93 | + <if test="description != null"> | ||
94 | + description = #{description,jdbcType=VARCHAR}, | ||
95 | + </if> | ||
96 | + <if test="gmtCreate != null"> | ||
97 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
98 | + </if> | ||
99 | + <if test="gmtModified != null"> | ||
100 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
101 | + </if> | ||
102 | + </set> | ||
103 | + where id = #{id,jdbcType=VARCHAR} | ||
104 | + </update> | ||
105 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserInfo"> | ||
106 | + <!--@mbg.generated--> | ||
107 | + update user_info | ||
108 | + set username = #{username,jdbcType=VARCHAR}, | ||
109 | + `password` = #{password,jdbcType=VARCHAR}, | ||
110 | + description = #{description,jdbcType=VARCHAR}, | ||
111 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
112 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
113 | + where id = #{id,jdbcType=VARCHAR} | ||
114 | + </update> | ||
115 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.UserMessageBindingMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table user_message_binding--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="username" jdbcType="VARCHAR" property="username"/> | ||
9 | + <result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName"/> | ||
10 | + <result column="exchange_name" jdbcType="VARCHAR" property="exchangeName"/> | ||
11 | + <result column="queue_name" jdbcType="VARCHAR" property="queueName"/> | ||
12 | + <result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName"/> | ||
13 | + <result column="subscriber" jdbcType="VARCHAR" property="subscriber"/> | ||
14 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
15 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
16 | + </resultMap> | ||
17 | + <sql id="Base_Column_List"> | ||
18 | + <!--@mbg.generated--> | ||
19 | + id, username, virtual_host_name, exchange_name, queue_name, routing_key_name, subscriber, gmt_create, | ||
20 | + gmt_modified | ||
21 | + </sql> | ||
22 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
23 | + <!--@mbg.generated--> | ||
24 | + select | ||
25 | + <include refid="Base_Column_List"/> | ||
26 | + from user_message_binding | ||
27 | + where id = #{id,jdbcType=VARCHAR} | ||
28 | + </select> | ||
29 | + <!-- 查询列表,选择性 --> | ||
30 | + <select id="selectUserMessageBindingList" | ||
31 | + parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding" resultMap="BaseResultMap"> | ||
32 | + select | ||
33 | + <include refid="Base_Column_List"/> | ||
34 | + from user_message_binding | ||
35 | + <where> | ||
36 | + <!-- 所属用户登陆名称 --> | ||
37 | + <if test="username != null and username !=''"> | ||
38 | + username = #{username,jdbcType=VARCHAR} | ||
39 | + </if> | ||
40 | + <!-- 所属虚拟主机名称 --> | ||
41 | + <if test="virtualHostName != null and virtualHostName !=''"> | ||
42 | + AND virtual_host_name = #{virtualHostName,jdbcType=VARCHAR} | ||
43 | + </if> | ||
44 | + <!-- 所属交换机名称 --> | ||
45 | + <if test="exchangeName != null and exchangeName !=''"> | ||
46 | + AND exchange_name = #{exchangeName,jdbcType=VARCHAR} | ||
47 | + </if> | ||
48 | + <!-- 所属队列名称 --> | ||
49 | + <if test="queueName != null and queueName !=''"> | ||
50 | + AND queue_name = #{queueName,jdbcType=VARCHAR} | ||
51 | + </if> | ||
52 | + <!-- 所属路由键名称 --> | ||
53 | + <if test="routingKeyName != null and routingKeyName !=''"> | ||
54 | + AND routing_key_name = #{routingKeyName,jdbcType=VARCHAR} | ||
55 | + </if> | ||
56 | + <!-- 订阅者 --> | ||
57 | + <if test="subscriber != null and subscriber !=''"> | ||
58 | + AND subscriber = #{subscriber,jdbcType=VARCHAR} | ||
59 | + </if> | ||
60 | + </where> | ||
61 | + </select> | ||
62 | + | ||
63 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
64 | + <!--@mbg.generated--> | ||
65 | + delete from user_message_binding | ||
66 | + where id = #{id,jdbcType=VARCHAR} | ||
67 | + </delete> | ||
68 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding"> | ||
69 | + <!--@mbg.generated--> | ||
70 | + insert into user_message_binding (id, username, virtual_host_name, | ||
71 | + exchange_name, routing_key_name, subscriber, | ||
72 | + gmt_create, gmt_modified) | ||
73 | + values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{virtualHostName,jdbcType=VARCHAR}, | ||
74 | + #{exchangeName,jdbcType=VARCHAR}, #{routingKeyName,jdbcType=VARCHAR}, #{subscriber,jdbcType=VARCHAR}, | ||
75 | + #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}) | ||
76 | + </insert> | ||
77 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding"> | ||
78 | + <!--@mbg.generated--> | ||
79 | + insert into user_message_binding | ||
80 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
81 | + <if test="id != null"> | ||
82 | + id, | ||
83 | + </if> | ||
84 | + <if test="username != null"> | ||
85 | + username, | ||
86 | + </if> | ||
87 | + <if test="virtualHostName != null"> | ||
88 | + virtual_host_name, | ||
89 | + </if> | ||
90 | + <if test="exchangeName != null"> | ||
91 | + exchange_name, | ||
92 | + </if> | ||
93 | + <if test="routingKeyName != null"> | ||
94 | + routing_key_name, | ||
95 | + </if> | ||
96 | + <if test="subscriber != null"> | ||
97 | + subscriber, | ||
98 | + </if> | ||
99 | + <if test="gmtCreate != null"> | ||
100 | + gmt_create, | ||
101 | + </if> | ||
102 | + <if test="gmtModified != null"> | ||
103 | + gmt_modified, | ||
104 | + </if> | ||
105 | + </trim> | ||
106 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
107 | + <if test="id != null"> | ||
108 | + #{id,jdbcType=VARCHAR}, | ||
109 | + </if> | ||
110 | + <if test="username != null"> | ||
111 | + #{username,jdbcType=VARCHAR}, | ||
112 | + </if> | ||
113 | + <if test="virtualHostName != null"> | ||
114 | + #{virtualHostName,jdbcType=VARCHAR}, | ||
115 | + </if> | ||
116 | + <if test="exchangeName != null"> | ||
117 | + #{exchangeName,jdbcType=VARCHAR}, | ||
118 | + </if> | ||
119 | + <if test="routingKeyName != null"> | ||
120 | + #{routingKeyName,jdbcType=VARCHAR}, | ||
121 | + </if> | ||
122 | + <if test="subscriber != null"> | ||
123 | + #{subscriber,jdbcType=VARCHAR}, | ||
124 | + </if> | ||
125 | + <if test="gmtCreate != null"> | ||
126 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
127 | + </if> | ||
128 | + <if test="gmtModified != null"> | ||
129 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
130 | + </if> | ||
131 | + </trim> | ||
132 | + </insert> | ||
133 | + <update id="updateByPrimaryKeySelective" | ||
134 | + parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding"> | ||
135 | + <!--@mbg.generated--> | ||
136 | + update user_message_binding | ||
137 | + <set> | ||
138 | + <if test="username != null"> | ||
139 | + username = #{username,jdbcType=VARCHAR}, | ||
140 | + </if> | ||
141 | + <if test="virtualHostName != null"> | ||
142 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}, | ||
143 | + </if> | ||
144 | + <if test="exchangeName != null"> | ||
145 | + exchange_name = #{exchangeName,jdbcType=VARCHAR}, | ||
146 | + </if> | ||
147 | + <if test="routingKeyName != null"> | ||
148 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
149 | + </if> | ||
150 | + <if test="subscriber != null"> | ||
151 | + subscriber = #{subscriber,jdbcType=VARCHAR}, | ||
152 | + </if> | ||
153 | + <if test="gmtCreate != null"> | ||
154 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
155 | + </if> | ||
156 | + <if test="gmtModified != null"> | ||
157 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
158 | + </if> | ||
159 | + </set> | ||
160 | + where id = #{id,jdbcType=VARCHAR} | ||
161 | + </update> | ||
162 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding"> | ||
163 | + <!--@mbg.generated--> | ||
164 | + update user_message_binding | ||
165 | + set username = #{username,jdbcType=VARCHAR}, | ||
166 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}, | ||
167 | + exchange_name = #{exchangeName,jdbcType=VARCHAR}, | ||
168 | + routing_key_name = #{routingKeyName,jdbcType=VARCHAR}, | ||
169 | + subscriber = #{subscriber,jdbcType=VARCHAR}, | ||
170 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
171 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
172 | + where id = #{id,jdbcType=VARCHAR} | ||
173 | + </update> | ||
174 | + | ||
175 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.UserServerVirtualHostMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table user_server_virtual_host--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id" /> | ||
8 | + <result column="username" jdbcType="VARCHAR" property="username" /> | ||
9 | + <result column="server_id" jdbcType="VARCHAR" property="serverId" /> | ||
10 | + <result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId" /> | ||
11 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" /> | ||
12 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" /> | ||
13 | + </resultMap> | ||
14 | + <sql id="Base_Column_List"> | ||
15 | + <!--@mbg.generated--> | ||
16 | + id, username, server_id, virtual_host_id, gmt_create, gmt_modified | ||
17 | + </sql> | ||
18 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
19 | + <!--@mbg.generated--> | ||
20 | + select | ||
21 | + <include refid="Base_Column_List" /> | ||
22 | + from user_server_virtual_host | ||
23 | + where id = #{id,jdbcType=VARCHAR} | ||
24 | + </select> | ||
25 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
26 | + <!--@mbg.generated--> | ||
27 | + delete from user_server_virtual_host | ||
28 | + where id = #{id,jdbcType=VARCHAR} | ||
29 | + </delete> | ||
30 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost"> | ||
31 | + <!--@mbg.generated--> | ||
32 | + insert into user_server_virtual_host (id, username, server_id, | ||
33 | + virtual_host_id, gmt_create, gmt_modified | ||
34 | + ) | ||
35 | + values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{serverId,jdbcType=VARCHAR}, | ||
36 | + #{virtualHostId,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP} | ||
37 | + ) | ||
38 | + </insert> | ||
39 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost"> | ||
40 | + <!--@mbg.generated--> | ||
41 | + insert into user_server_virtual_host | ||
42 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
43 | + <if test="id != null"> | ||
44 | + id, | ||
45 | + </if> | ||
46 | + <if test="username != null"> | ||
47 | + username, | ||
48 | + </if> | ||
49 | + <if test="serverId != null"> | ||
50 | + server_id, | ||
51 | + </if> | ||
52 | + <if test="virtualHostId != null"> | ||
53 | + virtual_host_id, | ||
54 | + </if> | ||
55 | + <if test="gmtCreate != null"> | ||
56 | + gmt_create, | ||
57 | + </if> | ||
58 | + <if test="gmtModified != null"> | ||
59 | + gmt_modified, | ||
60 | + </if> | ||
61 | + </trim> | ||
62 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
63 | + <if test="id != null"> | ||
64 | + #{id,jdbcType=VARCHAR}, | ||
65 | + </if> | ||
66 | + <if test="username != null"> | ||
67 | + #{username,jdbcType=VARCHAR}, | ||
68 | + </if> | ||
69 | + <if test="serverId != null"> | ||
70 | + #{serverId,jdbcType=VARCHAR}, | ||
71 | + </if> | ||
72 | + <if test="virtualHostId != null"> | ||
73 | + #{virtualHostId,jdbcType=VARCHAR}, | ||
74 | + </if> | ||
75 | + <if test="gmtCreate != null"> | ||
76 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
77 | + </if> | ||
78 | + <if test="gmtModified != null"> | ||
79 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
80 | + </if> | ||
81 | + </trim> | ||
82 | + </insert> | ||
83 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost"> | ||
84 | + <!--@mbg.generated--> | ||
85 | + update user_server_virtual_host | ||
86 | + <set> | ||
87 | + <if test="username != null"> | ||
88 | + username = #{username,jdbcType=VARCHAR}, | ||
89 | + </if> | ||
90 | + <if test="serverId != null"> | ||
91 | + server_id = #{serverId,jdbcType=VARCHAR}, | ||
92 | + </if> | ||
93 | + <if test="virtualHostId != null"> | ||
94 | + virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}, | ||
95 | + </if> | ||
96 | + <if test="gmtCreate != null"> | ||
97 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
98 | + </if> | ||
99 | + <if test="gmtModified != null"> | ||
100 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
101 | + </if> | ||
102 | + </set> | ||
103 | + where id = #{id,jdbcType=VARCHAR} | ||
104 | + </update> | ||
105 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost"> | ||
106 | + <!--@mbg.generated--> | ||
107 | + update user_server_virtual_host | ||
108 | + set username = #{username,jdbcType=VARCHAR}, | ||
109 | + server_id = #{serverId,jdbcType=VARCHAR}, | ||
110 | + virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}, | ||
111 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
112 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
113 | + where id = #{id,jdbcType=VARCHAR} | ||
114 | + </update> | ||
115 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.VirtualHostMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.VirtualHost"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <!--@Table virtual_host--> | ||
7 | + <id column="id" jdbcType="VARCHAR" property="id"/> | ||
8 | + <result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName"/> | ||
9 | + <result column="server_id" jdbcType="VARCHAR" property="serverId"/> | ||
10 | + <result column="description" jdbcType="VARCHAR" property="description"/> | ||
11 | + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/> | ||
12 | + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/> | ||
13 | + </resultMap> | ||
14 | + <sql id="Base_Column_List"> | ||
15 | + <!--@mbg.generated--> | ||
16 | + id, virtual_host_name, server_id, description, gmt_create, gmt_modified | ||
17 | + </sql> | ||
18 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
19 | + <!--@mbg.generated--> | ||
20 | + select | ||
21 | + <include refid="Base_Column_List"/> | ||
22 | + from virtual_host | ||
23 | + where id = #{id,jdbcType=VARCHAR} | ||
24 | + </select> | ||
25 | + <!-- 查询虚拟主机列表,选择性 --> | ||
26 | + <select id="selectVirtualHostList" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost" | ||
27 | + resultMap="BaseResultMap"> | ||
28 | + select | ||
29 | + <include refid="Base_Column_List"/> | ||
30 | + from virtual_host | ||
31 | + <where> | ||
32 | + <!-- 所属服务器ID --> | ||
33 | + <if test="serverId != null and serverId !=''"> | ||
34 | + server_id = #{serverId,jdbcType=VARCHAR} | ||
35 | + </if> | ||
36 | + <!-- 虚拟主机名称 --> | ||
37 | + <if test="virtualHostName != null and virtualHostName !=''"> | ||
38 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR} | ||
39 | + </if> | ||
40 | + </where> | ||
41 | + </select> | ||
42 | + | ||
43 | + <!-- 校验虚拟主机信息是否存在 --> | ||
44 | + <select id="validateVirtualHost" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost" | ||
45 | + resultMap="BaseResultMap"> | ||
46 | + select | ||
47 | + <include refid="Base_Column_List"/> | ||
48 | + from virtual_host | ||
49 | + <where> | ||
50 | + <!-- 虚拟主机名称 --> | ||
51 | + <if test="virtualHostName != null and virtualHostName !=''"> | ||
52 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR} | ||
53 | + </if> | ||
54 | + </where> | ||
55 | + </select> | ||
56 | + | ||
57 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
58 | + <!--@mbg.generated--> | ||
59 | + delete from virtual_host | ||
60 | + where id = #{id,jdbcType=VARCHAR} | ||
61 | + </delete> | ||
62 | + <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost"> | ||
63 | + <!--@mbg.generated--> | ||
64 | + insert into virtual_host (id, virtual_host_name, server_id, | ||
65 | + description, gmt_create, gmt_modified | ||
66 | + ) | ||
67 | + values (#{id,jdbcType=VARCHAR}, #{virtualHostName,jdbcType=VARCHAR}, #{serverId,jdbcType=VARCHAR}, | ||
68 | + #{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP} | ||
69 | + ) | ||
70 | + </insert> | ||
71 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost"> | ||
72 | + <!--@mbg.generated--> | ||
73 | + insert into virtual_host | ||
74 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
75 | + <if test="id != null"> | ||
76 | + id, | ||
77 | + </if> | ||
78 | + <if test="virtualHostName != null"> | ||
79 | + virtual_host_name, | ||
80 | + </if> | ||
81 | + <if test="serverId != null"> | ||
82 | + server_id, | ||
83 | + </if> | ||
84 | + <if test="description != null"> | ||
85 | + description, | ||
86 | + </if> | ||
87 | + <if test="gmtCreate != null"> | ||
88 | + gmt_create, | ||
89 | + </if> | ||
90 | + <if test="gmtModified != null"> | ||
91 | + gmt_modified, | ||
92 | + </if> | ||
93 | + </trim> | ||
94 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
95 | + <if test="id != null"> | ||
96 | + #{id,jdbcType=VARCHAR}, | ||
97 | + </if> | ||
98 | + <if test="virtualHostName != null"> | ||
99 | + #{virtualHostName,jdbcType=VARCHAR}, | ||
100 | + </if> | ||
101 | + <if test="serverId != null"> | ||
102 | + #{serverId,jdbcType=VARCHAR}, | ||
103 | + </if> | ||
104 | + <if test="description != null"> | ||
105 | + #{description,jdbcType=VARCHAR}, | ||
106 | + </if> | ||
107 | + <if test="gmtCreate != null"> | ||
108 | + #{gmtCreate,jdbcType=TIMESTAMP}, | ||
109 | + </if> | ||
110 | + <if test="gmtModified != null"> | ||
111 | + #{gmtModified,jdbcType=TIMESTAMP}, | ||
112 | + </if> | ||
113 | + </trim> | ||
114 | + </insert> | ||
115 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost"> | ||
116 | + <!--@mbg.generated--> | ||
117 | + update virtual_host | ||
118 | + <set> | ||
119 | + <if test="virtualHostName != null"> | ||
120 | + virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}, | ||
121 | + </if> | ||
122 | + <if test="serverId != null"> | ||
123 | + server_id = #{serverId,jdbcType=VARCHAR}, | ||
124 | + </if> | ||
125 | + <if test="description != null"> | ||
126 | + description = #{description,jdbcType=VARCHAR}, | ||
127 | + </if> | ||
128 | + <if test="gmtCreate != null"> | ||
129 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
130 | + </if> | ||
131 | + <if test="gmtModified != null"> | ||
132 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, | ||
133 | + </if> | ||
134 | + </set> | ||
135 | + where id = #{id,jdbcType=VARCHAR} | ||
136 | + </update> | ||
137 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost"> | ||
138 | + <!--@mbg.generated--> | ||
139 | + update virtual_host | ||
140 | + set virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}, | ||
141 | + server_id = #{serverId,jdbcType=VARCHAR}, | ||
142 | + description = #{description,jdbcType=VARCHAR}, | ||
143 | + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, | ||
144 | + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} | ||
145 | + where id = #{id,jdbcType=VARCHAR} | ||
146 | + </update> | ||
147 | + | ||
148 | +</mapper> |
1 | +package com.sunyo.wlpt.message.bus.service; | ||
2 | + | ||
3 | +import org.junit.Test; | ||
4 | +import org.junit.runner.RunWith; | ||
5 | +import org.springframework.boot.test.context.SpringBootTest; | ||
6 | +import org.springframework.test.context.junit4.SpringRunner; | ||
7 | + | ||
8 | +@RunWith(SpringRunner.class) | ||
9 | +@SpringBootTest | ||
10 | +public class MessageBusServiceApplicationTests { | ||
11 | + | ||
12 | + @Test | ||
13 | + public void contextLoads() { | ||
14 | + } | ||
15 | + | ||
16 | +} |
-
请 注册 或 登录 后发表评论