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
4e79ae21
Commit
4e79ae21
authored
May 11, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口:根据客户方生成签名字符串 验证通过则下发token
parent
3e37cfef
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
60 deletions
+56
-60
bootstrap/src/main/java/io/geekidea/springbootplus/config/Swagger2Config.java
+48
-48
common/src/main/java/com/wecloud/im/service/impl/ImClientLoginServiceImpl.java
+6
-0
config/src/main/resources/config/application-dev.yml
+0
-1
config/src/main/resources/config/application-prod.yml
+0
-1
config/src/main/resources/config/application-test.yml
+0
-1
config/src/main/resources/config/application.yml
+2
-9
No files found.
bootstrap/src/main/java/io/geekidea/springbootplus/config/Swagger2Config.java
View file @
4e79ae21
...
...
@@ -155,7 +155,7 @@ public class Swagger2Config {
@Bean
public
Docket
restAppApi
()
{
// 获取需要扫描的包
String
[]
basePackages
=
{
"com.
sien.common
.controller"
};
String
[]
basePackages
=
{
"com.
wecloud.im
.controller"
};
ApiSelectorBuilder
apiSelectorBuilder
=
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
groupName
(
"app"
)
...
...
@@ -174,53 +174,53 @@ public class Swagger2Config {
.
globalOperationParameters
(
getParameters
());
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
;
}
//
//
@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;
//
}
/**
...
...
common/src/main/java/com/wecloud/im/service/impl/ImClientLoginServiceImpl.java
View file @
4e79ae21
...
...
@@ -51,6 +51,11 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
new
QueryWrapper
<
ImApplication
>().
lambda
().
eq
(
ImApplication:
:
getAppKey
,
imTokenVerify
.
getAppKey
())
);
if
(
imApplication
==
null
)
{
log
.
debug
(
"imApplication == null"
);
return
ApiResult
.
result
(
ApiCode
.
FAIL
,
null
);
}
// 生成以数据库为准的签名
String
mySign
=
new
MD5
().
digestHex
(
imTokenVerify
.
getTimestemp
()
+
imTokenVerify
.
getClientId
()
+
imApplication
.
getAppKey
()
+
imApplication
.
getAppSecret
());
...
...
@@ -86,6 +91,7 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
redisTemplate
.
opsForValue
().
set
(
"client:"
+
imApplication
.
getAppKey
()
+
":"
+
imTokenVerify
.
getClientId
(),
generateToken
);
TokenVo
tokenVo
=
new
TokenVo
();
tokenVo
.
setToken
(
generateToken
);
return
ApiResult
.
ok
(
tokenVo
);
}
...
...
config/src/main/resources/config/application-dev.yml
View file @
4e79ae21
...
...
@@ -12,7 +12,6 @@ spring-boot-plus:
request-log-format
:
false
response-log-format
:
false
domain
:
https://767827238379.ngrok.io
spring
:
datasource
:
...
...
config/src/main/resources/config/application-prod.yml
View file @
4e79ae21
...
...
@@ -13,7 +13,6 @@ spring-boot-plus:
log-print-type
:
NONE
request-log-format
:
false
response-log-format
:
false
domain
:
https://sienapi.da300.com
server
:
port
:
8181
...
...
config/src/main/resources/config/application-test.yml
View file @
4e79ae21
...
...
@@ -12,7 +12,6 @@ spring-boot-plus:
log-print-type
:
LINE
request-log-format
:
false
response-log-format
:
false
domain
:
https://sienapi.da300.com
spring
:
...
...
config/src/main/resources/config/application.yml
View file @
4e79ae21
...
...
@@ -184,12 +184,9 @@ spring-boot-plus:
# 权限配置
anon
:
# 排除登录 注册 登出
-
/user/registerOrLogin,/user/login
-
/sms/registerOrLoginCode
-
/wechatUser/check
-
/app/noRole
-
/
wxapi/checkToken
# 客户端token获取
-
/
token/verify
# 排除静态资源
-
/static/**,/templates/**
# 排除Swagger
...
...
@@ -198,10 +195,6 @@ spring-boot-plus:
# - /actuator/**
-
# 排除首页
-
/,/index.html
# 微信支付回调
-
/pay/notify/donationOrder
-
/pay/notify/vipOrder
# 多行字符串权限配置
filter-chain-definitions
:
|
...
...
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