Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
e414865f
Commit
e414865f
authored
Jun 15, 2023
by
王亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused code.
parent
3e36a510
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
71 additions
and
83 deletions
+71
-83
user.sql
doc/sql/user.sql
+0
-0
pom.xml
pom.xml
+6
-5
GeetestLib.java
...n/java/cn/quantgroup/xyqb/service/captcha/GeetestLib.java
+6
-4
BctyptPasswordUtil.java
...main/java/cn/quantgroup/xyqb/util/BctyptPasswordUtil.java
+2
-7
DateUtils.java
src/main/java/cn/quantgroup/xyqb/util/DateUtils.java
+0
-1
RedisLock.java
src/main/java/cn/quantgroup/xyqb/util/RedisLock.java
+1
-1
ServerUtils.java
src/main/java/cn/quantgroup/xyqb/util/ServerUtils.java
+0
-13
SnowflakeIdentitySequencer.java
...a/cn/quantgroup/xyqb/util/SnowflakeIdentitySequencer.java
+0
-41
StringUtils.java
src/main/java/cn/quantgroup/xyqb/util/StringUtils.java
+0
-9
TenantUtil.java
src/main/java/cn/quantgroup/xyqb/util/TenantUtil.java
+0
-1
XxlJobSpringExecutor.java
...in/java/cn/quantgroup/xyqb/util/XxlJobSpringExecutor.java
+55
-0
XxlJobConfig.java
src/main/java/cn/quantgroup/xyqb/xxlJob/XxlJobConfig.java
+1
-1
No files found.
src/main/resources/stati
c/sql/user.sql
→
do
c/sql/user.sql
View file @
e414865f
File moved
pom.xml
View file @
e414865f
...
@@ -297,11 +297,6 @@
...
@@ -297,11 +297,6 @@
<artifactId>
sentry-spring
</artifactId>
<artifactId>
sentry-spring
</artifactId>
<version>
1.7.30
</version>
<version>
1.7.30
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.vaadin.external.google
</groupId>
<artifactId>
android-json
</artifactId>
<version>
0.0.20131108.vaadin1
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjweaver
</artifactId>
<artifactId>
aspectjweaver
</artifactId>
...
@@ -316,6 +311,12 @@
...
@@ -316,6 +311,12 @@
<groupId>
com.xuxueli
</groupId>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<artifactId>
xxl-job-core
</artifactId>
<version>
2.1.0
</version>
<version>
2.1.0
</version>
<exclusions>
<exclusion>
<groupId>
org.codehaus.groovy
</groupId>
<artifactId>
groovy
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.quantgroup
</groupId>
<groupId>
cn.quantgroup
</groupId>
...
...
src/main/java/cn/quantgroup/xyqb/service/captcha/GeetestLib.java
View file @
e414865f
...
@@ -2,10 +2,12 @@ package cn.quantgroup.xyqb.service.captcha;
...
@@ -2,10 +2,12 @@ package cn.quantgroup.xyqb.service.captcha;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.util.encrypt.Md5Util
;
import
cn.quantgroup.xyqb.util.encrypt.Md5Util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.HttpStatus
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -162,7 +164,7 @@ public class GeetestLib {
...
@@ -162,7 +164,7 @@ public class GeetestLib {
}
}
gtlog
(
"result:"
+
result_str
);
gtlog
(
"result:"
+
result_str
);
JSONObject
jsonObject
=
new
JSON
Object
(
result_str
);
JSONObject
jsonObject
=
JSON
.
parse
Object
(
result_str
);
String
return_challenge
=
jsonObject
.
getString
(
"challenge"
);
String
return_challenge
=
jsonObject
.
getString
(
"challenge"
);
this
.
challenge
=
return_challenge
;
this
.
challenge
=
return_challenge
;
...
@@ -295,7 +297,7 @@ public class GeetestLib {
...
@@ -295,7 +297,7 @@ public class GeetestLib {
}
}
String
return_seccode
=
""
;
String
return_seccode
=
""
;
try
{
try
{
JSONObject
return_map
=
new
JSON
Object
(
response
);
JSONObject
return_map
=
JSONObject
.
parse
Object
(
response
);
return_seccode
=
return_map
.
getString
(
"seccode"
);
return_seccode
=
return_map
.
getString
(
"seccode"
);
gtlog
(
"md5: "
+
Md5Util
.
build
(
return_seccode
));
gtlog
(
"md5: "
+
Md5Util
.
build
(
return_seccode
));
if
(
return_seccode
.
equals
(
Md5Util
.
build
(
seccode
)))
{
if
(
return_seccode
.
equals
(
Md5Util
.
build
(
seccode
)))
{
...
...
src/main/java/cn/quantgroup/xyqb/util/BctyptPasswordUtil.java
View file @
e414865f
...
@@ -8,19 +8,14 @@ import java.util.Objects;
...
@@ -8,19 +8,14 @@ import java.util.Objects;
* Created by Miraculous on 15/7/5.
* Created by Miraculous on 15/7/5.
*/
*/
public
class
BctyptPasswordUtil
{
public
class
BctyptPasswordUtil
{
public
static
void
main
(
String
[]
args
)
{
public
static
String
BCryptWithSalt
(
String
password
)
{
System
.
out
.
println
(
BCryptWithSalt
(
"123456"
));
System
.
out
.
println
(
BCryptCheckPw
(
"123456"
,
BCryptWithSalt
(
"123456"
)));
}
public
final
static
String
BCryptWithSalt
(
String
password
)
{
if
(
Objects
.
isNull
(
password
)){
if
(
Objects
.
isNull
(
password
)){
return
null
;
return
null
;
}
}
return
BCrypt
.
hashpw
(
password
,
BCrypt
.
gensalt
());
return
BCrypt
.
hashpw
(
password
,
BCrypt
.
gensalt
());
}
}
public
final
static
Boolean
BCryptCheckPw
(
String
password
,
String
hashe
)
{
public
static
Boolean
BCryptCheckPw
(
String
password
,
String
hashe
)
{
return
BCrypt
.
checkpw
(
password
,
hashe
);
return
BCrypt
.
checkpw
(
password
,
hashe
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/util/DateUtils.java
View file @
e414865f
...
@@ -17,7 +17,6 @@ import java.util.Date;
...
@@ -17,7 +17,6 @@ import java.util.Date;
*/
*/
public
class
DateUtils
{
public
class
DateUtils
{
public
static
final
String
YMD_FORMAT
=
"yyyy-MM-dd"
;
public
static
final
String
YMD_HMS_FORMAT
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
final
String
YMD_HMS_FORMAT
=
"yyyy-MM-dd HH:mm:ss"
;
/**
/**
...
...
src/main/java/cn/quantgroup/xyqb/util/RedisLock.java
View file @
e414865f
...
@@ -26,7 +26,7 @@ import java.util.Random;
...
@@ -26,7 +26,7 @@ import java.util.Random;
*/
*/
@Slf4j
@Slf4j
public
class
RedisLock
{
public
class
RedisLock
{
private
RedisTemplate
redisTemplate
;
private
final
RedisTemplate
redisTemplate
;
/**
/**
* Lock key path.
* Lock key path.
*/
*/
...
...
src/main/java/cn/quantgroup/xyqb/util/ServerUtils.java
View file @
e414865f
...
@@ -53,17 +53,4 @@ public abstract class ServerUtils {
...
@@ -53,17 +53,4 @@ public abstract class ServerUtils {
return
port
==
null
||
port
.
equals
(
""
)
?
null
:
Integer
.
valueOf
(
port
);
return
port
==
null
||
port
.
equals
(
""
)
?
null
:
Integer
.
valueOf
(
port
);
}
}
public
static
Integer
getIntegerPort
()
throws
MalformedObjectNameException
{
return
getIntegerPort
(
null
);
}
public
static
void
main
(
String
[]
args
)
{
try
{
System
.
out
.
println
(
ServerUtils
.
getLongHostAddress
());
}
catch
(
UnknownHostException
e
)
{
e
.
printStackTrace
();
}
}
}
}
src/main/java/cn/quantgroup/xyqb/util/SnowflakeIdentitySequencer.java
View file @
e414865f
...
@@ -99,45 +99,4 @@ public class SnowflakeIdentitySequencer implements IdentitySequencer {
...
@@ -99,45 +99,4 @@ public class SnowflakeIdentitySequencer implements IdentitySequencer {
", workerId="
+
workerId
+
", workerId="
+
workerId
+
'}'
;
'}'
;
}
}
public
static
void
main
(
String
[]
args
)
{
SnowflakeIdentitySequencer
snowflakeIdWorker
=
new
SnowflakeIdentitySequencer
(
255255255255L
^
8000
,
8
);
// SnowflakeIdentitySequencer snowflakeIdWorker = new SnowflakeIdentitySequencer(1099511627775L, 8, TWEPOCH_PLUS);
// SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(255255255255L, 16, 8);
// SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(255255255255L, 16, 8);
// SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(17202801560208L);
Long
nextId
=
snowflakeIdWorker
.
nextId
(
245
);
System
.
out
.
println
(
nextId
);
// for(int i=0; i<300;i++){
// System.out.println(i+":"+(i&255));
// }
// for (int i = 0; i < 100; i++) {
// new Thread(new Running(snowflakeIdWorker)).start();
// }
// System.out.println(73361139375145112L ^ (73361139375145112L >> 8 << 8));
// System.out.println((nextId >> 8 << 8) ^ nextId);
// for (int i = 0; i < 10000; i++) {
// System.out.println(snowflakeIdWorker.nextId());
// }
}
public
static
class
Running
implements
Runnable
{
SnowflakeIdentitySequencer
sequencer
;
public
Running
(
SnowflakeIdentitySequencer
sequencer
)
{
this
.
sequencer
=
sequencer
;
}
@Override
public
void
run
()
{
System
.
out
.
println
(
this
.
sequencer
.
nextId
(
255
));
}
}
}
}
src/main/java/cn/quantgroup/xyqb/util/StringUtils.java
View file @
e414865f
...
@@ -10,16 +10,10 @@ import org.slf4j.helpers.MessageFormatter;
...
@@ -10,16 +10,10 @@ import org.slf4j.helpers.MessageFormatter;
import
java.io.Serializable
;
import
java.io.Serializable
;
public
class
StringUtils
extends
org
.
springframework
.
util
.
StringUtils
{
public
class
StringUtils
extends
org
.
springframework
.
util
.
StringUtils
{
public
static
final
char
DELIMITED_ID_SEP
=
'$'
;
public
static
final
char
DELIMITED_ID_WCHAR
=
'*'
;
public
StringUtils
()
{
public
StringUtils
()
{
}
}
public
static
String
defaultIfNull
(
String
object
,
String
defaultValue
)
{
return
object
==
null
?
defaultValue
:
object
;
}
public
static
<
T
extends
Serializable
>
String
toDelimitedString
(
T
...
ids
)
{
public
static
<
T
extends
Serializable
>
String
toDelimitedString
(
T
...
ids
)
{
return
toDelimitedString
(
'$'
,
ids
);
return
toDelimitedString
(
'$'
,
ids
);
}
}
...
@@ -49,8 +43,5 @@ public class StringUtils extends org.springframework.util.StringUtils {
...
@@ -49,8 +43,5 @@ public class StringUtils extends org.springframework.util.StringUtils {
return
builder
.
toString
();
return
builder
.
toString
();
}
}
public
static
String
format
(
String
msg
,
Object
...
args
)
{
return
MessageFormatter
.
arrayFormat
(
msg
,
args
).
getMessage
();
}
}
}
src/main/java/cn/quantgroup/xyqb/util/TenantUtil.java
View file @
e414865f
...
@@ -4,7 +4,6 @@ public class TenantUtil {
...
@@ -4,7 +4,6 @@ public class TenantUtil {
/* 租户羊小咩 */
/* 租户羊小咩 */
public
static
final
Integer
TENANT_DEFAULT
=
560761
;
public
static
final
Integer
TENANT_DEFAULT
=
560761
;
public
static
final
String
TENANT_USER_ERROR
=
"该租户下未找到此用户"
;
/* 验证租户ID是否为空或0 */
/* 验证租户ID是否为空或0 */
public
static
boolean
validationTenantIdIsNullOrZero
(
Integer
tenantId
)
{
public
static
boolean
validationTenantIdIsNullOrZero
(
Integer
tenantId
)
{
...
...
src/main/java/cn/quantgroup/xyqb/util/XxlJobSpringExecutor.java
0 → 100644
View file @
e414865f
package
cn
.
quantgroup
.
xyqb
.
util
;
import
com.xxl.job.core.executor.XxlJobExecutor
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
java.util.Iterator
;
import
java.util.Map
;
public
class
XxlJobSpringExecutor
extends
XxlJobExecutor
implements
ApplicationContextAware
{
private
static
ApplicationContext
applicationContext
;
public
void
start
()
throws
Exception
{
this
.
initJobHandlerRepository
(
applicationContext
);
super
.
start
();
}
private
void
initJobHandlerRepository
(
ApplicationContext
applicationContext
)
{
if
(
applicationContext
!=
null
)
{
Map
<
String
,
Object
>
serviceBeanMap
=
applicationContext
.
getBeansWithAnnotation
(
JobHandler
.
class
);
if
(
serviceBeanMap
!=
null
&&
serviceBeanMap
.
size
()
>
0
)
{
Iterator
var3
=
serviceBeanMap
.
values
().
iterator
();
while
(
var3
.
hasNext
())
{
Object
serviceBean
=
var3
.
next
();
if
(
serviceBean
instanceof
IJobHandler
)
{
String
name
=
((
JobHandler
)
serviceBean
.
getClass
().
getAnnotation
(
JobHandler
.
class
))
.
value
();
IJobHandler
handler
=
(
IJobHandler
)
serviceBean
;
if
(
loadJobHandler
(
name
)
!=
null
)
{
throw
new
RuntimeException
(
"xxl-job jobhandler naming conflicts."
);
}
registJobHandler
(
name
,
handler
);
}
}
}
}
}
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
XxlJobSpringExecutor
.
applicationContext
=
applicationContext
;
}
public
static
ApplicationContext
getApplicationContext
()
{
return
applicationContext
;
}
}
src/main/java/cn/quantgroup/xyqb/xxlJob/XxlJobConfig.java
View file @
e414865f
package
cn
.
quantgroup
.
xyqb
.
xxlJob
;
package
cn
.
quantgroup
.
xyqb
.
xxlJob
;
import
c
om.xxl.job.core.executor.imp
l.XxlJobSpringExecutor
;
import
c
n.quantgroup.xyqb.uti
l.XxlJobSpringExecutor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
...
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