Commit e414865f authored by 王亮's avatar 王亮

remove unused code.

parent 3e36a510
......@@ -297,11 +297,6 @@
<artifactId>sentry-spring</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
......@@ -316,6 +311,12 @@
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.1.0</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.quantgroup</groupId>
......
......@@ -2,10 +2,12 @@ package cn.quantgroup.xyqb.service.captcha;
import cn.quantgroup.xyqb.Constants;
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 org.apache.http.HttpStatus;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
......@@ -162,7 +164,7 @@ public class GeetestLib {
}
gtlog("result:" + result_str);
JSONObject jsonObject = new JSONObject(result_str);
JSONObject jsonObject = JSON.parseObject(result_str);
String return_challenge = jsonObject.getString("challenge");
this.challenge = return_challenge;
......@@ -295,7 +297,7 @@ public class GeetestLib {
}
String return_seccode = "";
try {
JSONObject return_map = new JSONObject(response);
JSONObject return_map = JSONObject.parseObject(response);
return_seccode = return_map.getString("seccode");
gtlog("md5: " + Md5Util.build(return_seccode));
if (return_seccode.equals(Md5Util.build(seccode))) {
......
......@@ -8,19 +8,14 @@ import java.util.Objects;
* Created by Miraculous on 15/7/5.
*/
public class BctyptPasswordUtil {
public static void main(String[] args) {
System.out.println(BCryptWithSalt("123456"));
System.out.println(BCryptCheckPw("123456", BCryptWithSalt("123456")));
}
public final static String BCryptWithSalt(String password) {
public static String BCryptWithSalt(String password) {
if(Objects.isNull(password)){
return null;
}
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);
}
......
......@@ -17,7 +17,6 @@ import java.util.Date;
*/
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";
/**
......
......@@ -26,7 +26,7 @@ import java.util.Random;
*/
@Slf4j
public class RedisLock {
private RedisTemplate redisTemplate;
private final RedisTemplate redisTemplate;
/**
* Lock key path.
*/
......
......@@ -53,17 +53,4 @@ public abstract class ServerUtils {
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();
}
}
}
......@@ -99,45 +99,4 @@ public class SnowflakeIdentitySequencer implements IdentitySequencer {
", 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));
}
}
}
......@@ -10,16 +10,10 @@ import org.slf4j.helpers.MessageFormatter;
import java.io.Serializable;
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 static String defaultIfNull(String object, String defaultValue) {
return object == null ? defaultValue : object;
}
public static <T extends Serializable> String toDelimitedString(T... ids) {
return toDelimitedString('$', ids);
}
......@@ -49,8 +43,5 @@ public class StringUtils extends org.springframework.util.StringUtils {
return builder.toString();
}
public static String format(String msg, Object... args) {
return MessageFormatter.arrayFormat(msg, args).getMessage();
}
}
......@@ -4,7 +4,6 @@ public class TenantUtil {
/* 租户羊小咩 */
public static final Integer TENANT_DEFAULT = 560761;
public static final String TENANT_USER_ERROR = "该租户下未找到此用户";
/* 验证租户ID是否为空或0 */
public static boolean validationTenantIdIsNullOrZero(Integer tenantId) {
......
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;
}
}
package cn.quantgroup.xyqb.xxlJob;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import cn.quantgroup.xyqb.util.XxlJobSpringExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment