Commit f857902c by huluobin

update

parent d3de34e0
......@@ -128,7 +128,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
String openid = gogirlToken.getOpenid();
try {
lock.lock(openid1GetInt(openid));
lock.lock(openid.hashCode() & Integer.MAX_VALUE);
//变量为当前登陆用户
Customer customer;
......@@ -187,7 +187,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
gogirlTokenService.save(gogirlToken);
} finally {
lock.unlock(openid1GetInt(openid));
lock.unlock(openid.hashCode() & Integer.MAX_VALUE);
}
return token;
}
......@@ -402,17 +403,17 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
return Lists.newArrayList(ageGroups);
}
//todo 替换成hashcode
//字符串中所有字符相加得到一个int
private int openid1GetInt(String openid1) {
StringBuilder sb = new StringBuilder(openid1);
int sum = 0;
int length = sb.length();
for (int i = 20; i < length; i++) {
sum += sb.charAt(i);
}
return sum;
}
// //todo 替换成hashcode
// //字符串中所有字符相加得到一个int
// private int openid1GetInt(String openid1) {
// StringBuilder sb = new StringBuilder(openid1);
// int sum = 0;
// int length = sb.length();
// for (int i = 20; i < length; i++) {
// sum += sb.charAt(i);
// }
// return sum;
// }
/**
* 将emoji表情替换成空串
......
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