Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
8a2e123c
Commit
8a2e123c
authored
Aug 23, 2022
by
李成龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appid生成
parent
f806b680
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
24 deletions
+52
-24
ControllerAop.java
.../java/com/yeejoin/amos/api/openapi/aop/ControllerAop.java
+10
-7
AppIdMain.java
...va/com/yeejoin/amos/api/openapi/controller/AppIdMain.java
+30
-7
application-cyl.properties
...ata-openapi/src/main/resources/application-cyl.properties
+4
-2
application.properties
...ot-data-openapi/src/main/resources/application.properties
+1
-1
logback-dev.xml
...amos-boot-data-openapi/src/main/resources/logback-dev.xml
+7
-7
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/aop/ControllerAop.java
View file @
8a2e123c
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
aop
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
aop
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
com.yeejoin.amos.api.openapi.face.model.BizTokenModel
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Before
;
...
@@ -17,15 +20,13 @@ import org.typroject.tyboot.core.auth.exception.AuthException;
...
@@ -17,15 +20,13 @@ import org.typroject.tyboot.core.auth.exception.AuthException;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.api.openapi.face.model.BizTokenModel
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
@Aspect
@Aspect
@Component
@Component
@Order
(
value
=
0
)
@Order
(
value
=
0
)
public
class
ControllerAop
{
public
class
ControllerAop
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ControllerAop
.
class
);
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
...
@@ -38,11 +39,13 @@ public class ControllerAop {
...
@@ -38,11 +39,13 @@ public class ControllerAop {
public
void
doBefore
(
JoinPoint
joinPoint
)
{
public
void
doBefore
(
JoinPoint
joinPoint
)
{
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
attributes
.
getRequest
();
HttpServletRequest
request
=
attributes
.
getRequest
();
logger
.
info
(
"request>>>"
,
request
);
// 不需要添加请求头的接口
// 不需要添加请求头的接口
String
[]
url
=
new
String
[]{
"/api/user/selectInfo"
,
"/api/user/save/curCompany"
,
"/openapi/bizToken/applyToken"
,
"/openapi/bizToken/getAppId"
,
"/lift/upload"
,
"/lift/status"
,
"/lift/run"
,
"/lift/fault"
,
"/lift/video/preview"
,
"/cylinderPage/serviceProvider"
,
"/cylinderPage/getTableInfo"
,
"/cylinderPage/initCylinderNum"
};
String
[]
url
=
new
String
[]{
"/api/user/selectInfo"
,
"/api/user/save/curCompany"
,
"/openapi/bizToken/applyToken"
,
"/openapi/bizToken/getAppId"
,
"/lift/upload"
,
"/lift/status"
,
"/lift/run"
,
"/lift/fault"
,
"/lift/video/preview"
,
"/cylinderPage/serviceProvider"
,
"/cylinderPage/getTableInfo"
,
"/cylinderPage/initCylinderNum"
,
"/openapi/appId/setAppId"
};
// 获取请求路径
// 获取请求路径
for
(
String
uri
:
url
)
{
for
(
String
uri
:
url
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
logger
.
info
(
"uri>>>"
,
uri
);
return
;
return
;
}
}
}
}
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/AppIdMain.java
View file @
8a2e123c
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
controller
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
controller
;
import
org.apache.logging.log4j.LogManager
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseHelper
;
import
org.apache.logging.log4j.Logger
;
import
com.yeejoin.amos.api.common.restful.utils.ResponseModel
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
@RestController
@RequestMapping
(
value
=
"/appId"
)
@Api
(
tags
=
"appid-生成appid类"
)
public
class
AppIdMain
{
public
class
AppIdMain
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AppIdMain
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AppIdMain
.
class
);
public
static
void
main
(
String
[]
args
)
{
// public static void main(String[] args) {
String
appId
=
DesUtil
.
encode
(
"000007"
,
Constant
.
SECRETKEY
);
// String appId = DesUtil.encode("000010", Constant.SECRETKEY);
logger
.
info
(
"appId信息:"
,
appId
);
// logger.info("appId信息:", appId);
System
.
out
.
println
(
"appId信息:"
+
appId
);
// System.out.println("appId信息:" + appId);
// }
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"生成AppId"
)
@GetMapping
(
value
=
"/setAppId"
)
public
ResponseModel
<
String
>
applyAppId
(
@RequestParam
String
apiCompanyCode
)
throws
Exception
{
logger
.
info
(
"appId信息:"
,
apiCompanyCode
);
String
appId
=
DesUtil
.
encode
(
apiCompanyCode
,
Constant
.
SECRETKEY
);
logger
.
info
(
"appToken信息:"
,
appId
);
return
ResponseHelper
.
buildResponse
(
appId
);
}
}
}
}
amos-boot-data/amos-boot-data-openapi/src/main/resources/application-cyl.properties
View file @
8a2e123c
spring.application.name
=
AMOS-API-OPENAPI
-WJ
spring.application.name
=
AMOS-API-OPENAPI
server.servlet.context-path
=
/openapi
server.servlet.context-path
=
/openapi
server.port
=
11001
server.port
=
11001
# jdbc_config
# jdbc_config
spring.datasource.url
=
jdbc:mysql://113.134.211.174:3308/amos_openapi_cyl
inder
?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=GMT%2B8
spring.datasource.url
=
jdbc:mysql://113.134.211.174:3308/amos_openapi_cyl?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=GMT%2B8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
spring.datasource.password
=
Yeejoin@2020
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
...
@@ -36,6 +36,8 @@ eureka.instance.health-check-url=http://localhost:${server.port}${server.servlet
...
@@ -36,6 +36,8 @@ eureka.instance.health-check-url=http://localhost:${server.port}${server.servlet
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.status-page-url
=
http://localhost:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.status-page-url
=
http://localhost:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.metadata-map.management.api-docs
=
http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address
=
172.16.3.39
eureka.instance.instance-id
=
${eureka.instance.ip-address}:${server.port}
##emqx
##emqx
emqx.clean-session
=
true
emqx.clean-session
=
true
...
...
amos-boot-data/amos-boot-data-openapi/src/main/resources/application.properties
View file @
8a2e123c
spring.profiles.active
=
dev
spring.profiles.active
=
cyl
server.compression.enabled
=
true
server.compression.enabled
=
true
spring.jackson.dateFormat
=
yyyy-MM-dd HH:mm:ss
spring.jackson.dateFormat
=
yyyy-MM-dd HH:mm:ss
...
...
amos-boot-data/amos-boot-data-openapi/src/main/resources/logback-dev.xml
View file @
8a2e123c
...
@@ -15,18 +15,18 @@
...
@@ -15,18 +15,18 @@
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
-->
<!--myibatis log configure-->
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"
DEBUG
"
/>
<logger
name=
"com.apache.ibatis"
level=
"
ERROR
"
/>
<logger
name=
"java.sql.Connection"
level=
"
DEBUG
"
/>
<logger
name=
"java.sql.Connection"
level=
"
ERROR
"
/>
<logger
name=
"java.sql.Statement"
level=
"
DEBUG
"
/>
<logger
name=
"java.sql.Statement"
level=
"
ERROR
"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"
DEBUG
"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"
ERROR
"
/>
<logger
name=
"com.baomidou"
level=
"
DEBUG
"
/>
<logger
name=
"com.baomidou"
level=
"
ERROR
"
/>
<logger
name=
"org.springframework"
level=
"
DEBUG
"
/>
<logger
name=
"org.springframework"
level=
"
INFO
"
/>
<logger
name=
"org.apache.activemq"
level=
"INFO"
/>
<logger
name=
"org.apache.activemq"
level=
"INFO"
/>
<!-- 日志输出级别 -->
<!-- 日志输出级别 -->
<root
level=
"
DEBUG
"
>
<root
level=
"
ERROR
"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
</root>
<!--日志异步到数据库 -->
<!--日志异步到数据库 -->
...
...
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