Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
1a3c22be
Commit
1a3c22be
authored
Jun 08, 2022
by
Shadow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码,解决报错
parent
3e2b90a7
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
194 additions
and
299 deletions
+194
-299
im-app/pom.xml
+1
-1
im-biz/pom.xml
+11
-2
im-biz/src/main/java/com/wecloud/im/biz/config/Swagger2Config.java
+5
-77
im-biz/src/main/java/com/wecloud/im/biz/config/constant/SysLoginRedisKey.java
+0
-31
im-biz/src/main/resources/config/logback.xml
+0
-69
im-common/im-common-bom/pom.xml
+14
-2
im-common/im-common-security/src/main/java/com/wecloud/im/security/signature/SignatureChecker.java
+0
-67
im-common/im-common-swagger/pom.xml
+76
-0
im-common/im-common-swagger/src/main/java/com/wecloud/im/swagger/SwaggerProperties.java
+1
-1
im-common/im-common-web/pom.xml
+52
-0
im-common/im-common-web/src/main/java/com/wecloud/im/web/config/JacksonConfig.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/config/RestTemplateConfig.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/config/SpringBootPlusConfig.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/config/SpringBootPlusCorsConfig.java
+2
-2
im-common/im-common-web/src/main/java/com/wecloud/im/web/config/SpringBootPlusWebMvcConfig.java
+9
-9
im-common/im-common-web/src/main/java/com/wecloud/im/web/filter/ChannelFilter.java
+2
-2
im-common/im-common-web/src/main/java/com/wecloud/im/web/filter/RequestDetailFilter.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/interceptor/DownloadInterceptor.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/interceptor/ResourceInterceptor.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/interceptor/UploadInterceptor.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/properties/SpringBootPlusCorsProperties.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/properties/SpringBootPlusFilterProperties.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/properties/SpringBootPlusInterceptorProperties.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/properties/SpringBootPlusProperties.java
+7
-22
im-common/im-common-web/src/main/java/com/wecloud/im/web/properties/SpringBootPlusStaticProperties.java
+1
-1
im-common/im-common-web/src/main/java/com/wecloud/im/web/wrapper/RequestWrapper.java
+1
-1
im-server/pom.xml
+1
-1
pom.xml
+1
-1
No files found.
im-app/pom.xml
View file @
1a3c22be
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<parent>
<artifactId>
parent
</artifactId>
<artifactId>
parent
</artifactId>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<version>
2.0
</version>
<version>
2.0
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
im-biz/pom.xml
View file @
1a3c22be
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<artifactId>
parent
</artifactId>
<artifactId>
parent
</artifactId>
<version>
2.0
</version>
<version>
2.0
</version>
</parent>
</parent>
...
@@ -36,11 +36,16 @@
...
@@ -36,11 +36,16 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-server
</artifactId>
<artifactId>
im-server
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-web
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.firebase
</groupId>
<groupId>
com.google.firebase
</groupId>
<artifactId>
firebase-admin
</artifactId>
<artifactId>
firebase-admin
</artifactId>
<version>
6.4.0
</version>
<version>
6.4.0
</version>
...
@@ -170,6 +175,10 @@
...
@@ -170,6 +175,10 @@
<version>
1.4.1
</version>
<version>
1.4.1
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-swagger
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
im-biz/src/main/java/com/wecloud/im/biz/config/Swagger2Config.java
View file @
1a3c22be
...
@@ -10,6 +10,7 @@ import springfox.documentation.builders.ApiInfoBuilder;
...
@@ -10,6 +10,7 @@ import springfox.documentation.builders.ApiInfoBuilder;
import
springfox.documentation.builders.ParameterBuilder
;
import
springfox.documentation.builders.ParameterBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.schema.Annotations
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.schema.ModelRef
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.Contact
;
import
springfox.documentation.service.Contact
;
...
@@ -20,6 +21,7 @@ import springfox.documentation.spi.schema.contexts.ModelPropertyContext;
...
@@ -20,6 +21,7 @@ import springfox.documentation.spi.schema.contexts.ModelPropertyContext;
import
springfox.documentation.spring.web.plugins.ApiSelectorBuilder
;
import
springfox.documentation.spring.web.plugins.ApiSelectorBuilder
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger.common.SwaggerPluginSupport
;
import
springfox.documentation.swagger.common.SwaggerPluginSupport
;
import
springfox.documentation.swagger.schema.ApiModelProperties
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
...
@@ -51,14 +53,11 @@ import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
...
@@ -51,14 +53,11 @@ import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import
com.google.common.base.Function
;
import
com.google.common.base.Function
;
import
com.google.common.base.Optional
;
import
com.google.common.base.Optional
;
import
com.google.common.base.Predicate
;
import
com.google.common.base.Predicate
;
import
com.wecloud.im.biz.config.properties.SwaggerProperties
;
import
com.wecloud.im.core.common.exception.SpringBootPlusConfigException
;
import
com.wecloud.im.core.common.exception.SpringBootPlusConfigException
;
import
com.wecloud.im.swagger.SwaggerProperties
;
import
com.wecloud.netty.dispatch.extend.ActionRequest
;
import
com.wecloud.netty.dispatch.extend.ActionRequest
;
import
com.wecloud.netty.dispatch.extend.ArgumentBox
;
import
com.wecloud.netty.dispatch.extend.ArgumentBox
;
import
static
springfox
.
documentation
.
schema
.
Annotations
.
findPropertyAnnotation
;
import
static
springfox
.
documentation
.
swagger
.
schema
.
ApiModelProperties
.
findApiModePropertyAnnotation
;
/**
/**
* Swagger2全局配置
* Swagger2全局配置
* 分组教程 https://sns.bladex.vip/q-342.html
* 分组教程 https://sns.bladex.vip/q-342.html
...
@@ -120,29 +119,6 @@ public class Swagger2Config {
...
@@ -120,29 +119,6 @@ public class Swagger2Config {
return
Optional
.
fromNullable
(
input
.
declaringClass
());
return
Optional
.
fromNullable
(
input
.
declaringClass
());
}
}
// @Bean
// public Docket createRestApi() {
// // 获取需要扫描的包
// String[] basePackages = getBasePackages();
// ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo("默认", "1.0"))
// .select();
// // 如果扫描的包为空,则默认扫描类上有@Api注解的类
// if (ArrayUtils.isEmpty(basePackages)) {
// apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class));
// } else {
// // 扫描指定的包
// apiSelectorBuilder.apis(basePackage(basePackages));
// }
// Docket docket = apiSelectorBuilder.paths(PathSelectors.any())
// .build()
// .enable(swaggerProperties.isEnable())
// .ignoredParameterTypes(ignoredParameterTypes)
// .globalOperationParameters(getParameters());
// return docket;
// }
@Bean
@Bean
public
Docket
restAppApi
()
{
public
Docket
restAppApi
()
{
// 获取需要扫描的包
// 获取需要扫描的包
...
@@ -165,54 +141,6 @@ public class Swagger2Config {
...
@@ -165,54 +141,6 @@ public class Swagger2Config {
.
globalOperationParameters
(
getParameters
());
.
globalOperationParameters
(
getParameters
());
return
docket
;
return
docket
;
}
}
//
// @Bean
// public Docket restSysApi() {
// // 获取需要扫描的包
// String[] basePackages = {"com.jumeirah.api.system.controlle"};
// ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo())
// .groupName("system")
//
// .select();
// // 如果扫描的包为空,则默认扫描类上有@Api注解的类
// if (ArrayUtils.isEmpty(basePackages)) {
// apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class));
// } else {
// // 扫描指定的包
// apiSelectorBuilder.apis(basePackage(basePackages));
// }
// Docket docket = apiSelectorBuilder.paths(PathSelectors.any())
// .build()
// .enable(swaggerProperties.isEnable())
// .ignoredParameterTypes(ignoredParameterTypes)
// .globalOperationParameters(getParameters());
// return docket;
// }
//
// @Bean
// public Docket restMerchantApi() {
// // 获取需要扫描的包
// String[] basePackages = {"com.jumeirah.api.merchant.controller"};
// ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo())
// .groupName("merchant")
// .select();
// // 如果扫描的包为空,则默认扫描类上有@Api注解的类
// if (ArrayUtils.isEmpty(basePackages)) {
// apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class));
// } else {
// // 扫描指定的包
// apiSelectorBuilder.apis(basePackage(basePackages));
// }
// Docket docket = apiSelectorBuilder.paths(PathSelectors.any())
// .build()
// .enable(swaggerProperties.isEnable())
// .ignoredParameterTypes(ignoredParameterTypes)
// .globalOperationParameters(getParameters());
// return docket;
// }
/**
/**
* 获取apiInfo
* 获取apiInfo
...
@@ -288,10 +216,10 @@ public class Swagger2Config {
...
@@ -288,10 +216,10 @@ public class Swagger2Config {
Optional
<
BeanPropertyDefinition
>
beanPropertyDefinitionOptional
=
context
.
getBeanPropertyDefinition
();
Optional
<
BeanPropertyDefinition
>
beanPropertyDefinitionOptional
=
context
.
getBeanPropertyDefinition
();
Optional
<
ApiModelProperty
>
annotation
=
Optional
.
absent
();
Optional
<
ApiModelProperty
>
annotation
=
Optional
.
absent
();
if
(
context
.
getAnnotatedElement
().
isPresent
())
{
if
(
context
.
getAnnotatedElement
().
isPresent
())
{
annotation
=
annotation
.
or
(
findApiModePropertyAnnotation
(
context
.
getAnnotatedElement
().
get
()));
annotation
=
annotation
.
or
(
ApiModelProperties
.
findApiModePropertyAnnotation
(
context
.
getAnnotatedElement
().
get
()));
}
}
if
(
context
.
getBeanPropertyDefinition
().
isPresent
())
{
if
(
context
.
getBeanPropertyDefinition
().
isPresent
())
{
annotation
=
annotation
.
or
(
findPropertyAnnotation
(
context
.
getBeanPropertyDefinition
().
get
(),
ApiModelProperty
.
class
));
annotation
=
annotation
.
or
(
Annotations
.
findPropertyAnnotation
(
context
.
getBeanPropertyDefinition
().
get
(),
ApiModelProperty
.
class
));
}
}
if
(
beanPropertyDefinitionOptional
.
isPresent
())
{
if
(
beanPropertyDefinitionOptional
.
isPresent
())
{
BeanPropertyDefinition
beanPropertyDefinition
=
beanPropertyDefinitionOptional
.
get
();
BeanPropertyDefinition
beanPropertyDefinition
=
beanPropertyDefinitionOptional
.
get
();
...
...
im-biz/src/main/java/com/wecloud/im/biz/config/constant/SysLoginRedisKey.java
deleted
100644 → 0
View file @
3e2b90a7
package
com
.
wecloud
.
im
.
biz
.
config
.
constant
;
/**
* <p>
* redis key 常量
* </p>
*
* @author geekidea
* @date 2019-05-23
**/
public
interface
SysLoginRedisKey
{
/**
* 登录用户信息key
* login:user:username
*/
String
LOGIN_USER
=
"sys:login:user:%s"
;
/**
* 登录用户username token
* login:user:token:username:token
*/
String
LOGIN_USER_TOKEN
=
"sys:login:user:token:%s:%s"
;
/**
* 登录用户下的所有token
* login:user:token:username:*
*/
String
LOGIN_USER_ALL_TOKEN
=
"sys:login:user:token:%s:*"
;
}
im-biz/src/main/resources/config/logback.xml
View file @
1a3c22be
...
@@ -77,68 +77,6 @@
...
@@ -77,68 +77,6 @@
</appender>
</appender>
<!-- <appender name="LOGSTASH"-->
<!-- class="net.logstash.logback.appender.LogstashTcpSocketAppender">-->
<!-- <destination>139.9.6.183:5044</destination>-->
<!-- <!– encoder必须配置,有多种可选 –>-->
<!-- <encoder charset="UTF-8"-->
<!-- class="net.logstash.logback.encoder.LogstashEncoder">-->
<!-- <!– "appname":"xxx" 的作用是指定创建索引的名字时用,并且在生成的文档中会多了这个字段 –>-->
<!-- <customFields>{"appname":"wc_im"}</customFields>-->
<!-- </encoder>-->
<!-- </appender>-->
<appender
name=
"ELASTIC"
class=
"com.internetitem.logback.elasticsearch.ElasticsearchAppender"
>
<url>
http://elastic:ZwnEAr3arDtmc8R5aFdH@139.9.6.183:9200/_bulk
</url>
<index>
wc-im-%date{yyyy-MM-dd}
</index>
<!-- <type>test</type>-->
<loggerName>
wc-im-logger
</loggerName>
<!-- optional -->
<errorLoggerName>
wc-im-error-logger
</errorLoggerName>
<!-- optional -->
<connectTimeout>
30000
</connectTimeout>
<!-- optional (in ms, default 30000) -->
<errorsToStderr>
false
</errorsToStderr>
<!-- optional (default false) -->
<includeCallerData>
false
</includeCallerData>
<!-- optional (default false) -->
<logsToStderr>
false
</logsToStderr>
<!-- optional (default false) -->
<maxQueueSize>
104857600
</maxQueueSize>
<!-- optional (default 104857600) -->
<maxRetries>
3
</maxRetries>
<!-- optional (default 3) -->
<readTimeout>
30000
</readTimeout>
<!-- optional (in ms, default 30000) -->
<sleepTime>
250
</sleepTime>
<!-- optional (in ms, default 250) -->
<rawJsonMessage>
false
</rawJsonMessage>
<!-- optional (default false) -->
<includeMdc>
false
</includeMdc>
<!-- optional (default false) -->
<maxMessageSize>
-1
</maxMessageSize>
<!-- optional (default -1 -->
<authentication
class=
"com.internetitem.logback.elasticsearch.config.BasicAuthentication"
/>
<!-- optional -->
<properties>
<property>
<name>
host
</name>
<value>
${HOSTNAME}
</value>
<allowEmpty>
false
</allowEmpty>
</property>
<property>
<name>
level
</name>
<value>
%level
</value>
</property>
<property>
<name>
thread
</name>
<value>
%thread
</value>
</property>
<property>
<name>
stacktrace
</name>
<value>
%ex
</value>
</property>
<property>
<name>
package
</name>
<value>
%logger
</value>
</property>
</properties>
<headers>
<header>
<name>
Content-Type
</name>
<value>
application/json
</value>
</header>
</headers>
</appender>
<!-- 不同环境的日志级别配置 -->
<!-- 不同环境的日志级别配置 -->
<springProfile
name=
"dev"
>
<springProfile
name=
"dev"
>
...
@@ -149,17 +87,10 @@
...
@@ -149,17 +87,10 @@
<logger
name=
"org.apache.catalina.connector.CoyoteAdapter"
level=
"OFF"
/>
<logger
name=
"org.apache.catalina.connector.CoyoteAdapter"
level=
"OFF"
/>
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<!-- <appender-ref ref="ELASTIC"/>-->
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"ASYNC_FILE"
/>
<appender-ref
ref=
"ASYNC_FILE"
/>
<appender-ref
ref=
"ASYNC_ERROR_FILE"
/>
<appender-ref
ref=
"ASYNC_ERROR_FILE"
/>
</root>
</root>
<!-- <springProfile name="eslog">-->
<!-- <root level="INFO">-->
<!-- <appender-ref ref="ELASTIC"/>-->
<!-- </root>-->
<!-- </springProfile>-->
</configuration>
</configuration>
im-common/im-common-bom/pom.xml
View file @
1a3c22be
...
@@ -280,7 +280,7 @@
...
@@ -280,7 +280,7 @@
<!-- 项目模块start -->
<!-- 项目模块start -->
<dependency>
<dependency>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<artifactId>
config
</artifactId>
<artifactId>
config
</artifactId>
<version>
${im.version}
</version>
<version>
${im.version}
</version>
</dependency>
</dependency>
...
@@ -291,6 +291,12 @@
...
@@ -291,6 +291,12 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-swagger
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.wecloud.imserver
</groupId>
<groupId>
com.wecloud.imserver
</groupId>
...
@@ -323,12 +329,18 @@
...
@@ -323,12 +329,18 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-server
</artifactId>
<artifactId>
im-server
</artifactId>
<version>
2.0
</version>
<version>
2.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-web
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
${pagehelper.version}
</version>
<version>
${pagehelper.version}
</version>
...
...
im-common/im-common-security/src/main/java/com/wecloud/im/security/signature/SignatureChecker.java
View file @
1a3c22be
...
@@ -2,19 +2,13 @@ package com.wecloud.im.security.signature;
...
@@ -2,19 +2,13 @@ package com.wecloud.im.security.signature;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.springframework.util.CollectionUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Maps
;
/**
/**
* 签名检验员
* 签名检验员
...
@@ -72,65 +66,4 @@ public class SignatureChecker {
...
@@ -72,65 +66,4 @@ public class SignatureChecker {
return
headerMap
;
return
headerMap
;
}
}
/**
* 获取请求入参
*
* @param servletRequest
* @return
*/
public
static
Map
<
String
,
String
>
getParameterMap
(
HttpServletRequest
servletRequest
)
{
Map
<
String
,
String
>
paramMap
=
new
LinkedHashMap
<>();
if
(
servletRequest
instanceof
RequestWrapper
)
{
RequestWrapper
requestWrapper
=
(
RequestWrapper
)
servletRequest
;
Map
<
String
,
String
>
body
=
getParameterMap
(
requestWrapper
.
getBody
());
if
(!
CollectionUtils
.
isEmpty
(
body
))
{
paramMap
.
putAll
(
body
);
}
}
Enumeration
<
String
>
names
=
servletRequest
.
getParameterNames
();
while
(
names
.
hasMoreElements
())
{
String
key
=
names
.
nextElement
();
paramMap
.
put
(
key
,
servletRequest
.
getParameter
(
key
));
}
return
paramMap
;
}
/**
* 获取参数对象
*
* @param params
* @return
*/
public
static
Map
<
String
,
String
>
getParameterMap
(
String
params
)
{
try
{
return
(
Map
<
String
,
String
>)
JSON
.
parseObject
(
params
,
Map
.
class
);
}
catch
(
Exception
e
)
{
return
convertParameterToMap
(
params
);
}
}
/**
* 将参数转换为Map类型
*
* @param param
* @return
*/
public
static
Map
<
String
,
String
>
convertParameterToMap
(
String
param
)
{
if
(
StringUtils
.
isEmpty
(
param
))
{
return
Collections
.
emptyMap
();
}
Map
<
String
,
String
>
pMap
=
Maps
.
newLinkedHashMap
();
String
[]
pArray
=
StringUtils
.
split
(
param
,
"&"
);
for
(
int
i
=
0
;
i
<
pArray
.
length
;
i
++)
{
String
[]
array
=
StringUtils
.
split
(
pArray
[
i
],
"="
);
if
(
array
.
length
==
2
)
{
pMap
.
put
(
array
[
0
],
array
[
1
]);
}
}
return
pMap
;
}
}
}
im-common/im-common-swagger/pom.xml
View file @
1a3c22be
...
@@ -10,10 +10,86 @@
...
@@ -10,10 +10,86 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
im-common-swagger
</artifactId>
<artifactId>
im-common-swagger
</artifactId>
<dependencies>
<dependency>
<groupId>
io.swagger
</groupId>
<artifactId>
swagger-annotations
</artifactId>
<version>
1.5.20
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-bean-validators
</artifactId>
<version>
2.9.2
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-spring-web
</artifactId>
<version>
2.9.2
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-common
</artifactId>
<version>
2.9.2
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-core
</artifactId>
</dependency>
<dependency>
<groupId>
jakarta.validation
</groupId>
<artifactId>
jakarta.validation-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-collections4
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-autoconfigure
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-autoconfigure
</artifactId>
<version>
2.0.2
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<properties>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-bom
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
</project>
im-
biz/src/main/java/com/wecloud/im/biz/config/properties
/SwaggerProperties.java
→
im-
common/im-common-swagger/src/main/java/com/wecloud/im/swagger
/SwaggerProperties.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
.
properties
;
package
com
.
wecloud
.
im
.
swagger
;
import
lombok.Data
;
import
lombok.Data
;
...
...
im-common/im-common-web/pom.xml
View file @
1a3c22be
...
@@ -10,10 +10,62 @@
...
@@ -10,10 +10,62 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
im-common-web
</artifactId>
<artifactId>
im-common-web
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.datatype
</groupId>
<artifactId>
jackson-datatype-jsr310
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.module
</groupId>
<artifactId>
jackson-module-parameter-names
</artifactId>
</dependency>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-core
</artifactId>
</dependency>
</dependencies>
<properties>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
com.wecloud
</groupId>
<artifactId>
im-common-bom
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
</project>
im-
biz/src/main/java/com/wecloud/im/biz
/config/JacksonConfig.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/config/JacksonConfig.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
;
package
com
.
wecloud
.
im
.
web
.
config
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz
/config/RestTemplateConfig.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/config/RestTemplateConfig.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
;
package
com
.
wecloud
.
im
.
web
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz
/config/SpringBootPlusConfig.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/config/SpringBootPlusConfig.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
;
package
com
.
wecloud
.
im
.
web
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz
/config/SpringBootPlusCorsConfig.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/config/SpringBootPlusCorsConfig.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
;
package
com
.
wecloud
.
im
.
web
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -12,7 +12,7 @@ import org.springframework.web.cors.CorsConfiguration;
...
@@ -12,7 +12,7 @@ import org.springframework.web.cors.CorsConfiguration;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
org.springframework.web.filter.CorsFilter
;
import
com.wecloud.im.
biz.config
.properties.SpringBootPlusCorsProperties
;
import
com.wecloud.im.
web
.properties.SpringBootPlusCorsProperties
;
/**
/**
* 跨域配置
* 跨域配置
...
...
im-
biz/src/main/java/com/wecloud/im/biz
/config/SpringBootPlusWebMvcConfig.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/config/SpringBootPlusWebMvcConfig.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
;
package
com
.
wecloud
.
im
.
web
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -16,16 +16,16 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
...
@@ -16,16 +16,16 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.wecloud.im.biz.config.properties.SpringBootPlusFilterProperties
;
import
com.wecloud.im.biz.config.properties.SpringBootPlusInterceptorProperties
;
import
com.wecloud.im.biz.config.properties.SpringBootPlusProperties
;
import
com.wecloud.im.biz.core.interceptor.DownloadInterceptor
;
import
com.wecloud.im.biz.core.interceptor.ResourceInterceptor
;
import
com.wecloud.im.biz.core.interceptor.UploadInterceptor
;
import
com.wecloud.im.core.util.IniUtil
;
import
com.wecloud.im.core.util.IniUtil
;
import
com.wecloud.im.core.xss.XssFilter
;
import
com.wecloud.im.core.xss.XssFilter
;
import
com.wecloud.im.security.filter.ChannelFilter
;
import
com.wecloud.im.web.filter.ChannelFilter
;
import
com.wecloud.im.security.filter.RequestDetailFilter
;
import
com.wecloud.im.web.filter.RequestDetailFilter
;
import
com.wecloud.im.web.interceptor.DownloadInterceptor
;
import
com.wecloud.im.web.interceptor.ResourceInterceptor
;
import
com.wecloud.im.web.interceptor.UploadInterceptor
;
import
com.wecloud.im.web.properties.SpringBootPlusFilterProperties
;
import
com.wecloud.im.web.properties.SpringBootPlusInterceptorProperties
;
import
com.wecloud.im.web.properties.SpringBootPlusProperties
;
/**
/**
* WebMvc配置
* WebMvc配置
...
...
im-common/im-common-
security/src/main/java/com/wecloud/im/security
/filter/ChannelFilter.java
→
im-common/im-common-
web/src/main/java/com/wecloud/im/web
/filter/ChannelFilter.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
security
.
filter
;
package
com
.
wecloud
.
im
.
web
.
filter
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -11,7 +11,7 @@ import javax.servlet.ServletResponse;
...
@@ -11,7 +11,7 @@ import javax.servlet.ServletResponse;
import
javax.servlet.annotation.WebFilter
;
import
javax.servlet.annotation.WebFilter
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.wecloud.im.
security.signature
.RequestWrapper
;
import
com.wecloud.im.
web.wrapper
.RequestWrapper
;
/**
/**
*
*
...
...
im-common/im-common-
security/src/main/java/com/wecloud/im/security
/filter/RequestDetailFilter.java
→
im-common/im-common-
web/src/main/java/com/wecloud/im/web
/filter/RequestDetailFilter.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
security
.
filter
;
package
com
.
wecloud
.
im
.
web
.
filter
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/core
/interceptor/DownloadInterceptor.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/interceptor/DownloadInterceptor.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
core
.
interceptor
;
package
com
.
wecloud
.
im
.
web
.
interceptor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/core
/interceptor/ResourceInterceptor.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/interceptor/ResourceInterceptor.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
core
.
interceptor
;
package
com
.
wecloud
.
im
.
web
.
interceptor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/core
/interceptor/UploadInterceptor.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/interceptor/UploadInterceptor.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
core
.
interceptor
;
package
com
.
wecloud
.
im
.
web
.
interceptor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/config
/properties/SpringBootPlusCorsProperties.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/properties/SpringBootPlusCorsProperties.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
.
properties
;
package
com
.
wecloud
.
im
.
web
.
properties
;
import
lombok.Data
;
import
lombok.Data
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/config
/properties/SpringBootPlusFilterProperties.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/properties/SpringBootPlusFilterProperties.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
.
properties
;
package
com
.
wecloud
.
im
.
web
.
properties
;
import
lombok.Data
;
import
lombok.Data
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/config
/properties/SpringBootPlusInterceptorProperties.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/properties/SpringBootPlusInterceptorProperties.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
.
properties
;
package
com
.
wecloud
.
im
.
web
.
properties
;
import
lombok.Data
;
import
lombok.Data
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/config
/properties/SpringBootPlusProperties.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/properties/SpringBootPlusProperties.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
.
properties
;
package
com
.
wecloud
.
im
.
web
.
properties
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -9,9 +9,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -9,9 +9,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.wecloud.im.security.properties.JwtProperties
;
import
com.wecloud.im.security.properties.ShiroProperties
;
/**
/**
* spring-boot-plus属性配置信息
* spring-boot-plus属性配置信息
*
*
...
@@ -71,6 +68,12 @@ public class SpringBootPlusProperties {
...
@@ -71,6 +68,12 @@ public class SpringBootPlusProperties {
private
SpringBootPlusFilterProperties
filter
;
private
SpringBootPlusFilterProperties
filter
;
/**
/**
* 跨域配置
*/
@NestedConfigurationProperty
private
SpringBootPlusCorsProperties
cors
=
new
SpringBootPlusCorsProperties
();
/**
* 上传目录
* 上传目录
*/
*/
private
String
uploadPath
;
private
String
uploadPath
;
...
@@ -97,18 +100,6 @@ public class SpringBootPlusProperties {
...
@@ -97,18 +100,6 @@ public class SpringBootPlusProperties {
private
List
<
String
>
allowDownloadFileExtensions
;
private
List
<
String
>
allowDownloadFileExtensions
;
/**
/**
* JWT配置
*/
@NestedConfigurationProperty
private
JwtProperties
jwt
;
/**
* Shiro配置
*/
@NestedConfigurationProperty
private
ShiroProperties
shiro
=
new
ShiroProperties
();
/**
* 项目静态资源访问配置
* 项目静态资源访问配置
*
*
* @see SpringBootPlusWebMvcConfig addResourceHandlers
* @see SpringBootPlusWebMvcConfig addResourceHandlers
...
@@ -116,12 +107,6 @@ public class SpringBootPlusProperties {
...
@@ -116,12 +107,6 @@ public class SpringBootPlusProperties {
private
String
resourceHandlers
;
private
String
resourceHandlers
;
/**
/**
* 跨域配置
*/
@NestedConfigurationProperty
private
SpringBootPlusCorsProperties
cors
=
new
SpringBootPlusCorsProperties
();
/**
* Swagger路径
* Swagger路径
*/
*/
private
List
<
String
>
swaggerPaths
;
private
List
<
String
>
swaggerPaths
;
...
...
im-
biz/src/main/java/com/wecloud/im/biz/config
/properties/SpringBootPlusStaticProperties.java
→
im-
common/im-common-web/src/main/java/com/wecloud/im/web
/properties/SpringBootPlusStaticProperties.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
biz
.
config
.
properties
;
package
com
.
wecloud
.
im
.
web
.
properties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
im-common/im-common-
security/src/main/java/com/wecloud/im/security/signature
/RequestWrapper.java
→
im-common/im-common-
web/src/main/java/com/wecloud/im/web/wrapper
/RequestWrapper.java
View file @
1a3c22be
package
com
.
wecloud
.
im
.
security
.
signature
;
package
com
.
wecloud
.
im
.
web
.
wrapper
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
...
...
im-server/pom.xml
View file @
1a3c22be
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<parent>
<artifactId>
parent
</artifactId>
<artifactId>
parent
</artifactId>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<version>
2.0
</version>
<version>
2.0
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
pom.xml
View file @
1a3c22be
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
io.geekidea.springbootplus
</groupId>
<groupId>
com.wecloud
</groupId>
<artifactId>
parent
</artifactId>
<artifactId>
parent
</artifactId>
<version>
2.0
</version>
<version>
2.0
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment