Commit 84192c53 by unknown

Merge branch 'release' of 192.168.10.6:caosy/fun-golf-service into release

parents 485b8109 58d6b262
......@@ -48,20 +48,30 @@ public class FriendsController {
public Response<ResponseFriendBean> addFriend(@RequestBody RequestFriendBean request){
logger.info(SysUtil.getMethodName() + " request: " + request.toString());
Response<ResponseFriendBean> response = new Response<ResponseFriendBean>();
Friend golfFriend = new Friend();
BeanConverter.copyProperties(golfFriend, request);
//FIXME 暂时没有token_access, token当uid
golfFriend.setUid(request.getToken());
Integer friendId = this.friendService.save(golfFriend);
Response<ResponseFriendBean> response = new Response<ResponseFriendBean>();
//判斷添加的好友是不是自己,
UserExt userExt = userExtService.GetUserExtInfoByPhone(request.getFriendPhone());
if(userExt!=null ){
if((request.getToken().equals(userExt.getUid()))){
response.setStatus(ResponseStatusEnum.FAIL.getValue());
response.setMessage("您不能添加自己為好友!");
return response;
}
}
Integer friendId = this.friendService.save(golfFriend);
if(friendId < 0){
response.setStatus(ResponseStatusEnum.FAIL.getValue());
response.setMessage(String.valueOf(friendId));
} else {
ResponseFriendBean responseFriendBean = new ResponseFriendBean();
Friend friend = this.friendService.get(friendId);
UserExt userExt = userExtService.GetUserExtInfoByPhone(friend.getFriendPhone());
// UserExt userExt = userExtService.GetUserExtInfoByPhone(friend.getFriendPhone());
if(friend!=null){
responseFriendBean.setPlayerId(friend.getPlayerId());
......
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 sign in to comment