Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
huluobin
gogirl-miniapp-backend
Commits
f857902c
Commit
f857902c
authored
Mar 20, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d3de34e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
CustomerServiceImpl.java
...l/application/user/customer/impl/CustomerServiceImpl.java
+14
-13
No files found.
src/main/java/com/gogirl/application/user/customer/impl/CustomerServiceImpl.java
View file @
f857902c
...
...
@@ -128,7 +128,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
String
openid
=
gogirlToken
.
getOpenid
();
try
{
lock
.
lock
(
openid
1GetInt
(
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表情替换成空串
...
...
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