Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
4d2fb4bb
Commit
4d2fb4bb
authored
Jul 04, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
29426039
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
140 additions
and
18 deletions
+140
-18
IdReaderSafetyLib.dll
license/lib/IdReaderSafetyLib.dll
+0
-0
IdReaderSafetyLib.so
license/lib/IdReaderSafetyLib.so
+0
-0
pom.xml
license/pom.xml
+1
-0
Safety.java
...se/src/main/java/iot/sixiang/license/idreader/Safety.java
+2
-2
CommonUtil.java
...se/src/main/java/iot/sixiang/license/util/CommonUtil.java
+17
-0
application-prod.yml
license/src/main/resources/application-prod.yml
+4
-1
application-test.yml
license/src/main/resources/application-test.yml
+4
-1
application.yml
license/src/main/resources/application.yml
+4
-1
logback-spring.xml
license/src/main/resources/logback-spring.xml
+108
-0
LicenseApplicationTests.java
...est/java/iot/sixiang/license/LicenseApplicationTests.java
+0
-13
No files found.
license/lib/IdReaderSafetyLib.dll
0 → 100644
View file @
4d2fb4bb
File added
license/lib/IdReaderSafetyLib.so
0 → 100644
View file @
4d2fb4bb
File added
license/pom.xml
View file @
4d2fb4bb
...
...
@@ -90,6 +90,7 @@
</dependencies>
<build>
<finalName>
license
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
...
...
license/src/main/java/iot/sixiang/license/idreader/Safety.java
View file @
4d2fb4bb
package
iot
.
sixiang
.
license
.
idreader
;
import
iot.sixiang.license.util.CommonUtil
;
import
org.springframework.stereotype.Component
;
@Component
public
class
Safety
{
static
{
// System.load("C:\\Program Files\\Java\\jdk1.8.0_231\\jre\\bin\\IdReaderSafetyLib.dll");//Windwos
System
.
load
(
"/home/acc/server/license/file/libs/IdReaderSafetyLib.so"
);
//Linux
System
.
load
(
CommonUtil
.
getLibFilePathByFileName
(
"IdReaderSafetyLib"
));
}
public
native
byte
[]
decodeExtendedPayload
(
byte
[]
data
,
int
offset
,
int
length
);
...
...
license/src/main/java/iot/sixiang/license/util/CommonUtil.java
View file @
4d2fb4bb
package
iot
.
sixiang
.
license
.
util
;
import
iot.sixiang.license.consts.Consts
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.system.ApplicationHome
;
import
java.io.File
;
import
java.io.UnsupportedEncodingException
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.SecureRandom
;
...
...
@@ -73,4 +76,18 @@ public class CommonUtil {
}
}
public
static
String
getServerParentDirectory
()
{
return
new
File
(
new
ApplicationHome
(
Consts
.
class
).
getSource
().
getParentFile
().
getPath
()).
getParent
();
}
public
static
String
getLibFilePathByFileName
(
String
fileName
)
{
String
os
=
System
.
getProperty
(
"os.name"
);
String
serverParentDirectory
=
getServerParentDirectory
();
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
return
serverParentDirectory
+
File
.
separator
+
"lib"
+
File
.
separator
+
fileName
+
".dll"
;
}
else
{
return
serverParentDirectory
+
File
.
separator
+
"lib"
+
File
.
separator
+
fileName
+
".so"
;
}
}
}
license/src/main/resources/application-prod.yml
View file @
4d2fb4bb
...
...
@@ -11,3 +11,6 @@ mybatis-plus:
type-aliases-package
:
iot.sixiang.license.entity
knife4j
:
enable
:
true
logging
:
level
:
root
:
info
\ No newline at end of file
license/src/main/resources/application-test.yml
View file @
4d2fb4bb
...
...
@@ -11,3 +11,6 @@ mybatis-plus:
type-aliases-package
:
iot.sixiang.license.entity
knife4j
:
enable
:
true
logging
:
level
:
root
:
info
\ No newline at end of file
license/src/main/resources/application.yml
View file @
4d2fb4bb
...
...
@@ -3,3 +3,6 @@ spring:
active
:
test
application
:
name
:
iot_license
#当前服务的名称
## 配置输出日志
logging
:
config
:
classpath:logback-spring.xml
\ No newline at end of file
license/src/main/resources/logback-spring.xml
0 → 100644
View file @
4d2fb4bb
<?xml version="1.0" encoding="UTF-8"?>
<configuration
scan=
"false"
scanPeriod=
"10 seconds"
>
<!-- <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 -->
<!-- <logger name="iot.sixiang.license" level="debug" />-->
<!--控制台输出的格式设置 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!-- 控制台输出的日志 的格式 -->
<encoder>
<pattern>
%date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %5level %logger{96}:%line - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- 只是DEBUG级别以上的日志才显示 -->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
DEBUG
</level>
</filter>
</appender>
<!--文件输出的格式设置 -->
<appender
name=
"ALL_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 日志日常打印文件 -->
<file>
logs/license.log
</file>
<!-- 配置日志所生成的目录以及生成文件名的规则 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
logs/license.log-%d{yyyy-MM-dd}.%i
</fileNamePattern>
<!-- 如果按天来回滚,则最大保存时间为365天,365天之前的都将被清理掉 -->
<maxHistory>
365
</maxHistory>
<!-- 日志总保存量为10GB -->
<totalSizeCap>
100GB
</totalSizeCap>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<!--文件达到 最大128MB时会被压缩和切割 -->
<maxFileSize>
40 MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
DEBUG
</level>
</filter>
<!-- 文件输出的日志 的格式 -->
<encoder>
<pattern>
%date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %5level %logger{96}:%line - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>
false
</prudent>
</appender>
<!--文件输出的格式设置 -->
<appender
name=
"MSG_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 日志日常打印文件 -->
<file>
logs/message.log
</file>
<!-- 配置日志所生成的目录以及生成文件名的规则 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
logs/message.log-%d{yyyy-MM-dd}.%i
</fileNamePattern>
<!-- 如果按天来回滚,则最大保存时间为365天,365天之前的都将被清理掉 -->
<maxHistory>
365
</maxHistory>
<!-- 日志总保存量为10GB -->
<totalSizeCap>
100GB
</totalSizeCap>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<!--文件达到 最大128MB时会被压缩和切割 -->
<maxFileSize>
40 MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
INFO
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<!-- 文件输出的日志 的格式 -->
<encoder>
<pattern>
%date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %5level %logger{96}:%line - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>
false
</prudent>
</appender>
<!-- Enable FILE and STDOUT appenders for all log messages. By default,
only log at level INFO and above. -->
<!--这里选择INFO就代表,进行INFO级别输出记录,那么在控制台也好,log文件也好只记录INFO及以上级别的日志,这里相当于第一道设置-->
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"ALL_FILE"
/>
<appender-ref
ref=
"MSG_FILE"
/>
</root>
</configuration>
\ No newline at end of file
license/src/test/java/iot/sixiang/license/LicenseApplicationTests.java
deleted
100644 → 0
View file @
29426039
package
iot
.
sixiang
.
license
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
LicenseApplicationTests
{
@Test
void
contextLoads
()
{
}
}
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