Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-base
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gic_demo
gic-demo-base
Commits
3fc79968
Commit
3fc79968
authored
Jun 06, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码调整
parent
3ee116bd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
283 deletions
+22
-283
pom.xml
gic-demo-base-api/pom.xml
+4
-0
Constant.java
.../src/main/java/com/gic/demo/base/api/common/Constant.java
+0
-160
ServiceResponse.java
...in/java/com/gic/demo/base/api/common/ServiceResponse.java
+0
-89
package-info.java
.../main/java/com/gic/demo/base/api/common/package-info.java
+5
-0
pom.xml
gic-demo-common/pom.xml
+4
-0
PasswordUtil.java
...src/main/java/com/gic/demo/common/utils/PasswordUtil.java
+0
-34
package-info.java
...src/main/java/com/gic/demo/common/utils/package-info.java
+5
-0
pom.xml
gic-demo-config/pom.xml
+4
-0
No files found.
gic-demo-base-api/pom.xml
View file @
3fc79968
...
...
@@ -45,6 +45,10 @@
<target>
${maven.compiler.target}
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
flatten-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
...
...
gic-demo-base-api/src/main/java/com/gic/demo/base/api/common/Constant.java
deleted
100644 → 0
View file @
3ee116bd
package
com
.
gic
.
demo
.
base
.
api
.
common
;
public
class
Constant
{
/**
* EMPTY
*/
public
final
static
String
EMPTY
=
""
;
/**
* 空格
*/
public
final
static
String
BLANK
=
" "
;
/**
* 点
*/
public
final
static
String
DOT
=
"."
;
/**
* / 斜杠
*/
public
final
static
String
SLASH
=
"/"
;
/**
* 数字0
*/
public
final
static
int
NUMBER_0
=
0
;
/**
* 数字1
*/
public
final
static
int
NUMBER_1
=
1
;
/**
* 数字2
*/
public
final
static
int
NUMBER_2
=
2
;
/**
* 数字3
*/
public
final
static
int
NUMBER_3
=
3
;
/**
* 数字4
*/
public
final
static
int
NUMBER_4
=
4
;
/**
* 数字5
*/
public
final
static
int
NUMBER_5
=
5
;
/**
* 数字6
*/
public
final
static
int
NUMBER_6
=
6
;
/**
* 数字7
*/
public
final
static
int
NUMBER_7
=
7
;
/**
* 数字8
*/
public
final
static
int
NUMBER_8
=
8
;
/**
* 数字9
*/
public
final
static
int
NUMBER_9
=
9
;
/**
* 数字10
*/
public
final
static
int
NUMBER_10
=
10
;
/**
* 数字11
*/
public
final
static
int
NUMBER_11
=
11
;
/**
* 数字12
*/
public
final
static
int
NUMBER_12
=
12
;
/**
* 数字13
*/
public
final
static
int
NUMBER_13
=
13
;
/**
* 数字14
*/
public
final
static
int
NUMBER_14
=
14
;
/**
* 数字15
*/
public
final
static
int
NUMBER_15
=
15
;
/**
* 字符 :0 [48 ]
*/
public
final
static
String
STRING_0
=
"0"
;
/**
* 字符 :1 [49 ]
*/
public
final
static
String
STRING_1
=
"1"
;
/**
* 字符 :2 [50 ]
*/
public
final
static
String
STRING_2
=
"2"
;
/**
* 字符 :3 [51 ]
*/
public
final
static
String
STRING_3
=
"3"
;
/**
* 字符 :4 [52 ]
*/
public
final
static
String
STRING_4
=
"4"
;
/**
* 字符 :5 [53 ]
*/
public
final
static
String
STRING_5
=
"5"
;
/**
* 字符 :6 [54 ]
*/
public
final
static
String
STRING_6
=
"6"
;
/**
* 字符 :7 [55 ]
*/
public
final
static
String
STRING_7
=
"7"
;
/**
* 字符 :8 [56 ]
*/
public
final
static
String
STRING_8
=
"8"
;
/**
* 字符 :9 [57 ]
*/
public
final
static
String
STRING_9
=
"9"
;
/**
* 日期年 格式
*/
public
static
final
String
YEAR_FORMAT
=
"yyyy"
;
/**
* 日期年月 格式
*/
public
static
final
String
YEAR_MONTH_FORMAT
=
"yyyy-MM"
;
/**
* 日期 格式
*/
public
static
final
String
DATE_FORMAT
=
"yyyy-MM-dd"
;
/**
* 日期 格式
*/
public
static
final
String
DATETIME_FORMAT
=
"yyyy-MM-dd HH:mm:ss"
;
/**
* 状态-无效
*/
public
static
final
int
STATUS_INVALID
=
0
;
/**
* 状态-有效
*/
public
static
final
int
STATUS_EFFECTIVE
=
1
;
/**
* 成功代码
*/
public
static
final
String
SUCCESS
=
"0000"
;
}
gic-demo-base-api/src/main/java/com/gic/demo/base/api/common/ServiceResponse.java
deleted
100644 → 0
View file @
3ee116bd
package
com
.
gic
.
demo
.
base
.
api
.
common
;
import
java.io.Serializable
;
/**
* 服务响应
*
* @param <T> 返回类型
* @author zhurz
*/
public
class
ServiceResponse
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 响应代码(成功代码固定为 {@link Constant#SUCCESS 0000})
*/
private
String
code
;
/**
* 响应信息(可为null,不一定和code说明信息一致)
*/
private
String
message
;
/**
* 响应结果
*/
private
T
result
;
public
static
<
T
>
ServiceResponse
<
T
>
success
()
{
return
new
ServiceResponse
<>(
Constant
.
SUCCESS
,
null
,
null
);
}
public
static
<
T
>
ServiceResponse
<
T
>
success
(
T
result
)
{
return
new
ServiceResponse
<>(
Constant
.
SUCCESS
,
null
,
result
);
}
public
static
<
T
>
ServiceResponse
<
T
>
success
(
T
result
,
String
message
)
{
return
new
ServiceResponse
<>(
Constant
.
SUCCESS
,
message
,
result
);
}
public
static
<
T
>
ServiceResponse
<
T
>
failure
(
String
code
,
String
message
)
{
return
new
ServiceResponse
<>(
code
,
message
,
null
);
}
public
static
<
T
>
ServiceResponse
<
T
>
failure
(
String
code
,
String
message
,
T
result
)
{
return
new
ServiceResponse
<>(
code
,
message
,
result
);
}
public
ServiceResponse
()
{
}
private
ServiceResponse
(
String
code
,
String
message
,
T
result
)
{
this
.
code
=
code
;
this
.
message
=
message
;
this
.
result
=
result
;
}
/**
* @return 是否成功
*/
public
boolean
isSuccess
()
{
return
Constant
.
SUCCESS
.
equals
(
code
);
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
T
getResult
()
{
return
result
;
}
public
void
setResult
(
T
result
)
{
this
.
result
=
result
;
}
}
gic-demo-base-api/src/main/java/com/gic/demo/base/api/common/package-info.java
0 → 100644
View file @
3fc79968
/**
* @author zhurz
*/
package
com
.
gic
.
demo
.
base
.
api
.
common
;
\ No newline at end of file
gic-demo-common/pom.xml
View file @
3fc79968
...
...
@@ -188,6 +188,10 @@
<target>
${maven.compiler.target}
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
flatten-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
...
...
gic-demo-common/src/main/java/com/gic/demo/common/utils/PasswordUtil.java
deleted
100644 → 0
View file @
3ee116bd
package
com
.
gic
.
demo
.
common
.
utils
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.codec.digest.DigestUtils
;
/**
* 密码工具
*
* @author zhurz
*/
public
final
class
PasswordUtil
{
/**
* 编码密码( base64(sha1(password)) )
*
* @param password 明文密码
* @return
*/
public
static
String
encodePassword
(
String
password
)
{
return
Base64
.
encodeBase64String
(
DigestUtils
.
sha1
(
password
==
null
?
""
:
password
));
}
/**
* 检查密码是否匹配
*
* @param encodePassword 编码过的密码
* @param password 明文密码
* @return
*/
public
static
boolean
checkPassword
(
String
encodePassword
,
String
password
)
{
return
(
encodePassword
==
null
?
""
:
encodePassword
).
equals
(
encodePassword
(
password
));
}
}
gic-demo-common/src/main/java/com/gic/demo/common/utils/package-info.java
0 → 100644
View file @
3fc79968
/**
* @author zhurz
*/
package
com
.
gic
.
demo
.
common
.
utils
;
\ No newline at end of file
gic-demo-config/pom.xml
View file @
3fc79968
...
...
@@ -49,6 +49,10 @@
<target>
${maven.compiler.target}
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
flatten-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
...
...
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