Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
a2bfe95b
Commit
a2bfe95b
authored
Jul 05, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
0324597e
2f1195f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
24 deletions
+30
-24
UserBiz.java
...erver/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
+22
-17
Msg.java
...-server/src/main/java/com/xxfc/platform/im/model/Msg.java
+2
-2
User.java
...server/src/main/java/com/xxfc/platform/im/model/User.java
+6
-5
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
a2bfe95b
...
...
@@ -57,23 +57,28 @@ public class UserBiz {
String
result
=
this
.
doPost
(
imUrl
+
"/xxfcim/user/register"
,
str
)
;
JSONObject
json
=
JSONObject
.
parseObject
(
result
);
//如果已经注册过,查询出手机号对应用户信息执行登录返回
// if(0 == json.getInteger("resultCode")){
// String phone = map.get("telephone").toString();
// Query query = new Query(Criteria.where("phone").is(phone));
// User mgt = mongoTemplate.findOne(query, User.class);
// if(mgt == null){
// result = "系统错误";
// }else{
// Map<String,Object>params = new HashMap<String,Object>();
// params.put("userId",mgt.getUserId());
// params.put("telephone",mgt.getPhone());
// params.put("password",mgt.getPassword());
// result = this.login(params);
// }
// }else{
// json.put("password",map.get("password").toString());
// result = json.toJSONString();
// }
if
(
0
==
json
.
getInteger
(
"resultCode"
)){
String
phone
=
map
.
get
(
"telephone"
).
toString
();
Query
query
=
new
Query
(
Criteria
.
where
(
"phone"
).
is
(
phone
));
User
mgt
=
mongoTemplate
.
findOne
(
query
,
User
.
class
);
if
(
mgt
==
null
){
result
=
"系统错误"
;
}
else
{
json
.
put
(
"password"
,
mgt
.
getPassword
());
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"userId"
,
mgt
.
getId
());
json
.
put
(
"data"
,
params
);
result
=
json
.
toJSONString
();
/*Map<String,Object>params = new HashMap<String,Object>();
params.put("userId",mgt.getUserId());
params.put("telephone",mgt.getPhone());
params.put("password",mgt.getPassword());
result = this.login(params);*/
}
}
else
{
json
.
put
(
"password"
,
map
.
get
(
"password"
).
toString
());
result
=
json
.
toJSONString
();
}
baseResponse
.
setStatus
(
200
);
baseResponse
.
setMessage
(
result
);
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/model/Msg.java
View file @
a2bfe95b
...
...
@@ -566,8 +566,8 @@ public class Msg {
Msg
entity
=
new
Msg
();
entity
.
id
=
ObjectId
.
get
();
entity
.
userId
=
user
.
getUserId
(
);
if
(
10000
==
user
.
getUserId
())
entity
.
userId
=
Integer
.
parseInt
(
user
.
getId
().
toString
()
);
if
(
"10000"
==
user
.
getId
().
toString
())
entity
.
nickname
=
"客服公众号"
;
else
entity
.
nickname
=
user
.
getNickname
();
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/model/User.java
View file @
a2bfe95b
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
java.util.Map
;
import
com.xxfc.platform.im.utils.DateUtil
;
import
org.bson.types.ObjectId
;
import
org.mongodb.morphia.annotations.Embedded
;
import
org.mongodb.morphia.annotations.Entity
;
import
org.mongodb.morphia.annotations.Id
;
...
...
@@ -27,7 +28,7 @@ import lombok.Setter;
public
class
User
{
@Id
private
Integer
userI
d
;
// 用户Id
private
ObjectId
i
d
;
// 用户Id
//@JSONField(serialize = false)
...
...
@@ -188,8 +189,8 @@ public class User {
// ********************引用字段********************
public
Integer
getUser
Id
()
{
return
userI
d
;
public
ObjectId
get
Id
()
{
return
i
d
;
}
...
...
@@ -209,8 +210,8 @@ public class User {
this
.
num
=
num
;
}
public
void
set
UserId
(
Integer
userI
d
)
{
this
.
userId
=
userI
d
;
public
void
set
id
(
ObjectId
i
d
)
{
this
.
id
=
i
d
;
}
public
String
getUserKey
()
{
...
...
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