From c257996813629f5d4ddd2103e5306da3531ada16 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 31 八月 2022 16:09:52 +0800
Subject: [PATCH] 更新部分接口

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml          |   41 ++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java            |   22 +
 UserIGOTravel/guns-admin/pom.xml                                                                                 |   53 +--
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AgreementServiceImpl.java  |    6 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserInfoMapper.java                 |    9 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java   |  172 +++++++++++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java                   |    7 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GoogleMapUtil.java       |  161 ++++++++++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AgreementMapper.java                |    2 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FindPlaceFromTextVo.java |   52 +++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/DistancematrixVo.java    |   29 +
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAgreementService.java          |    2 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/Tingg/TinggPayUtil.java            |    7 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java                    |   88 +++++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GeocodeVo.java           |   28 +
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AgreementMapper.xml         |    4 
 UserIGOTravel/guns-admin/src/main/resources/application.yml                                                      |   27 +
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserInfo.java                     |   39 ++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java               |   10 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Agreement.java                    |   13 
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/EmailUtil.java                     |   96 ++++++
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java           |   22 +
 22 files changed, 831 insertions(+), 59 deletions(-)

diff --git a/UserIGOTravel/guns-admin/pom.xml b/UserIGOTravel/guns-admin/pom.xml
index 3147291..d0f021f 100644
--- a/UserIGOTravel/guns-admin/pom.xml
+++ b/UserIGOTravel/guns-admin/pom.xml
@@ -182,44 +182,23 @@
             <version>4.17.6</version>
         </dependency>
 
+        <!--邮件发送依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+        <!--谷歌地图依赖-->
+        <dependency>
+            <groupId>com.google.maps</groupId>
+            <artifactId>google-maps-services</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>1.7.25</version>
+        </dependency>
 
-        <!--引入本地工行支付jar start-->
-        <!--<dependency>
-            <groupId>com.icbc</groupId>
-            <artifactId>icbc</artifactId>
-            <version>v2</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/lib/icbc-api-sdk-cop.jar</systemPath>
-        </dependency>
-        <dependency>
-            <groupId>com.icbc.api</groupId>
-            <artifactId>icbc</artifactId>
-            <version>v2</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/lib/icbc-api-sdk-cop-io.jar</systemPath>
-        </dependency>
-        <dependency>
-            <groupId>cn.com.infosec</groupId>
-            <artifactId>icbc</artifactId>
-            <version>v2</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/lib/icbc-ca.jar</systemPath>
-        </dependency>
-        <dependency>
-            <groupId>cn.com.infosecCrypto</groupId>
-            <artifactId>icbc</artifactId>
-            <version>v2</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/lib/InfosecCrypto_Java1_02_JDK14+.jar</systemPath>
-        </dependency>
-        <dependency>
-            <groupId>proguard</groupId>
-            <artifactId>icbc</artifactId>
-            <version>v2</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/lib/proguard.jar</systemPath>
-        </dependency>-->
-        <!--引入本地工行支付jar end-->
     </dependencies>
 
 
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java
index f2d113c..9abf93f 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java
@@ -30,13 +30,14 @@
      */
     @ResponseBody
     @PostMapping("/queryByType")
-    @ApiOperation(value = "获取各种协议及H5页面", tags = {"用户端-协议"}, notes = "")
+    @ApiOperation(value = "获取各种协议及H5页面【1.0】", tags = {"用户端-协议"}, notes = "")
     @ApiImplicitParams({
+            @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = true, dataType = "int"),
             @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置,9=司机注册协议,10=改派说明,11=跨城出行乘车须知,12:常见问题,13:计价规则,14:包车协议)", name = "type", required = true, dataType = "int")
     })
-    public ResultUtil<BaseWarpper> queryByType(Integer type){
+    public ResultUtil<BaseWarpper> queryByType(Integer type, Integer language){
         try {
-            String s = agreementService.queryByType(type);
+            String s = agreementService.queryByType(type, language);
             BaseWarpper baseWarpper = new BaseWarpper();
             baseWarpper.setContent(s);
             return ResultUtil.success(baseWarpper);
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
index 529c540..332f147 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
@@ -10,9 +10,7 @@
 import com.stylefeng.guns.modular.system.service.ISmsrecordService;
 import com.stylefeng.guns.modular.system.service.IUserInfoService;
 import com.stylefeng.guns.modular.system.service.IVerifiedService;
-import com.stylefeng.guns.modular.system.util.ALiApiUtil;
-import com.stylefeng.guns.modular.system.util.RedisUtil;
-import com.stylefeng.guns.modular.system.util.ResultUtil;
+import com.stylefeng.guns.modular.system.util.*;
 import com.stylefeng.guns.modular.system.warpper.LoginWarpper;
 import com.stylefeng.guns.modular.system.warpper.UserInfoWarpper;
 import com.stylefeng.guns.modular.system.warpper.UserInviteInfoWarpper;
@@ -26,10 +24,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 用户控制器
@@ -52,8 +47,8 @@
     @Autowired
     private RedisUtil redisUtil;
 
-    @Autowired
-    private ALiApiUtil aLiApiUtil;
+
+
 
     @ResponseBody
     @PostMapping("/base/isEnterEmergencyContact")
@@ -130,6 +125,34 @@
             return ResultUtil.paranErr();
         }
     }
+
+    @ResponseBody
+    @PostMapping("/base/sedEmail")
+    @ApiOperation(value = "获取邮箱验证码【1.0】", tags = {"用户端-登录"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "邮箱地址", name = "email", required = true, dataType = "String")
+    })
+    public ResultUtil sedEmail(String email){
+        try {
+            if(ToolUtil.isEmpty(email)){
+                return ResultUtil.error("邮箱地址不能为空");
+            }
+            Random random = new Random();
+            StringBuffer sb = new StringBuffer();
+            for(int i = 0; i < 4; i++){
+                sb.append((int) (random.nextDouble() * 10));
+            }
+            String authCode = sb.toString();
+            redisUtil.setStrValue(email, authCode, 5 * 60);
+            EmailUtil.getMimeMessage(email, "验证码", "您的验证码:<span style=\"color:red;\">" + authCode + "</span>");
+            return ResultUtil.success();
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+    }
+
+
 
 
     /**
@@ -298,6 +321,28 @@
     }
 
 
+    @ResponseBody
+    @PostMapping("/base/user/facebookLogin")
+    @ApiOperation(value = "FaceBook授权登录【1.0】", tags = {"用户端-登录"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "FaceBook用户id", name = "id", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "FaceBook用户名称", name = "name", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "FaceBook绑定的email", name = "email", required = false, dataType = "String"),
+            @ApiImplicitParam(value = "当前定位区县行政编号", name = "registAreaCode", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "分享的用户id", name = "uid", required = false, dataType = "int"),
+    })
+    public ResultUtil facebookLogin(String id, String name, String email, String registAreaCode, Integer uid){
+        try {
+            return userInfoService.facebookLogin(id, name, email, registAreaCode, uid);
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+    }
+
+
+
+
     /**
      * 设置电话号码
      * @param phone
@@ -327,6 +372,29 @@
     }
 
 
+    @ResponseBody
+    @PostMapping("/api/user/bindingEmail")
+    @ApiOperation(value = "设置邮箱地址【1.0】", tags = {"用户端-登录"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "绑定类型(1=注册账号绑定,2=个人中心绑定)", name = "type", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "邮箱地址", name = "email", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+    })
+    public ResultUtil<LoginWarpper> bindingEmail(Integer type, String email, String code, HttpServletRequest request){
+        try {
+            Integer uid = userInfoService.getUserIdFormRedis(request);
+            if(null == uid){
+                return ResultUtil.tokenErr();
+            }
+            return userInfoService.bindingEmail(uid, type, email, code);
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+    }
+
+
     /**
      * 获取用户个人信息
      * @param request
@@ -334,7 +402,7 @@
      */
     @ResponseBody
     @PostMapping("/api/user/queryUserInfo")
-    @ApiOperation(value = "获取用户详情", tags = {"用户端-个人中心"}, notes = "")
+    @ApiOperation(value = "获取用户详情【1.0】", tags = {"用户端-个人中心"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AgreementMapper.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AgreementMapper.java
index aab92db..8a79c19 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AgreementMapper.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AgreementMapper.java
@@ -12,5 +12,5 @@
      * @param type
      * @return
      */
-    String queryByType(@Param("type") Integer type, @Param("useType") Integer useType);
+    String queryByType(@Param("type") Integer type, @Param("language") Integer language, @Param("useType") Integer useType);
 }
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserInfoMapper.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserInfoMapper.java
index 94f70ac..4ef7bc8 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserInfoMapper.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserInfoMapper.java
@@ -19,6 +19,15 @@
 
 
     /**
+     * 邮箱查询用户
+     * @param email
+     * @return
+     */
+    UserInfo queryByEmail(@Param("email") String email);
+
+
+
+    /**
      * 根据微信openid获取用户
      * @param openid
      * @param unionid
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AgreementMapper.xml b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AgreementMapper.xml
index dc077e8..00bc405 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AgreementMapper.xml
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AgreementMapper.xml
@@ -6,6 +6,7 @@
     <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Agreement">
         <id column="id" property="id"/>
         <result column="useType" property="useType"/>
+        <result column="language" property="language"/>
         <result column="content" property="content"/>
         <result column="type" property="type"/>
 
@@ -23,5 +24,8 @@
         <if test="null != useType">
             and useType = #{useType}
         </if>
+        <if test="null != language">
+            and `language` = #{language}
+        </if>
     </select>
 </mapper>
\ No newline at end of file
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml
index 9fa6a83..6d8c8c8 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml
@@ -9,6 +9,7 @@
         <result column="registIp" property="registIp"/>
         <result column="registAreaCode" property="registAreaCode"/>
         <result column="phone" property="phone"/>
+        <result column="email" property="email"/>
         <result column="nickName" property="nickName"/>
         <result column="avatar" property="avatar"/>
         <result column="birthday" property="birthday"/>
@@ -24,6 +25,7 @@
         <result column="balance" property="balance"/>
         <result column="integral" property="integral"/>
         <result column="passWord" property="passWord"/>
+        <result column="faceBookId" property="faceBookId"/>
         <result column="openId" property="openId"/>
         <result column="appletsOpenId" property="appletsOpenId"/>
         <result column="unionid" property="unionid"/>
@@ -36,6 +38,7 @@
         <result column="updateUser" property="updateUser"/>
         <result column="uid" property="uid"/>
         <result column="uType" property="uType"/>
+        <result column="language" property="language"/>
     </resultMap>
 
     <select id="queryFreeMOney" resultType="Double">
@@ -73,6 +76,40 @@
         updateTime as updateTime,
         updateUser as updateUser
         from t_user where flag != 3 and phone = #{phone}
+    </select>
+
+
+    <select id="queryByEmail" resultType="UserInfo">
+        select
+        id as id,
+        registIp as registIp,
+        registAreaCode as registAreaCode,
+        phone as phone,
+        nickName as nickName,
+        avatar as avatar,
+        birthday as birthday,
+        sex as sex,
+        emergencyContact as emergencyContact,
+        emergencyContactNumber as emergencyContactNumber,
+        isAuth as isAuth,
+        name as name,
+        idCard as idCard,
+        idCardFront as idCardFront,
+        idCardReverse as idCardReverse,
+        consumption as consumption,
+        balance as balance,
+        integral as integral,
+        passWord as passWord,
+        openId as openId,
+        appletsOpenId as appletsOpenId,
+        unionid as unionid,
+        state as state,
+        flag as flag,
+        insertTime as insertTime,
+        insertUser as insertUser,
+        updateTime as updateTime,
+        updateUser as updateUser
+        from t_user where flag != 3 and email = #{email}
     </select>
 
 
@@ -155,6 +192,7 @@
         select
         a.id as id,
         a.phone as phone,
+        a.email as email,
         a.nickName as nickName,
         a.avatar as avatar,
         DATE_FORMAT(a.birthday, '%Y-%m-%d') as birthday,
@@ -165,7 +203,8 @@
         a.integral as integral,
         a.emergencyContact as emergencyContact,
         a.emergencyContactNumber as emergencyContactNumber,
-        a.balance as balance
+        a.balance as balance,
+        a.language
         from t_user a where 1 = 1
         <if test="null != uid">
             and a.id = #{uid}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Agreement.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Agreement.java
index 0ed3c3c..313bd60 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Agreement.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Agreement.java
@@ -23,6 +23,11 @@
      */
     @TableField("type")
     private Integer type;
+    /**
+     * 语言类型(1=简体中文,2=英语,3=法语)
+     */
+    @TableField("language")
+    private Integer language;
 
     public Integer getUseType() {
         return useType;
@@ -48,6 +53,14 @@
         this.type = type;
     }
 
+    public Integer getLanguage() {
+        return language;
+    }
+
+    public void setLanguage(Integer language) {
+        this.language = language;
+    }
+
     @Override
     public String toString() {
         return "Agreement{" +
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserInfo.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserInfo.java
index 97198de..d3865a1 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserInfo.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserInfo.java
@@ -32,6 +32,11 @@
     @TableField("phone")
     private String phone;
     /**
+     * 邮箱
+     */
+    @TableField("email")
+    private String email;
+    /**
      * 昵称
      */
     @TableField("nickName")
@@ -107,6 +112,11 @@
     @TableField("passWord")
     private String passWord;
     /**
+     * facebook用户id
+     */
+    @TableField("faceBookId")
+    private String faceBookId;
+    /**
      * 微信openid
      */
     @TableField("openId")
@@ -147,6 +157,11 @@
      */
     @TableField("uType")
     private Integer uType;
+    /**
+     * 语言类型(1=简体中文,2=英语,3=法语)
+     */
+    @TableField("language")
+    private Integer language;
 
     public Integer getuType() {
         return uType;
@@ -186,6 +201,14 @@
 
     public void setPhone(String phone) {
         this.phone = phone;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
     }
 
     public String getNickName() {
@@ -308,6 +331,14 @@
         this.passWord = passWord;
     }
 
+    public String getFaceBookId() {
+        return faceBookId;
+    }
+
+    public void setFaceBookId(String faceBookId) {
+        this.faceBookId = faceBookId;
+    }
+
     public String getOpenId() {
         return openId;
     }
@@ -364,6 +395,14 @@
         this.uid = uid;
     }
 
+    public Integer getLanguage() {
+        return language;
+    }
+
+    public void setLanguage(Integer language) {
+        this.language = language;
+    }
+
     @Override
     public String toString() {
         return "UserInfo{" +
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAgreementService.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAgreementService.java
index f9ae612..39c03fc 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAgreementService.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAgreementService.java
@@ -12,5 +12,5 @@
      * @return
      * @throws Exception
      */
-    String queryByType(Integer type) throws Exception;
+    String queryByType(Integer type, Integer language) throws Exception;
 }
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java
index 0a0d8f4..923ac6b 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java
@@ -80,6 +80,16 @@
 
 
     /**
+     * facebook登录
+     * @param id
+     * @param name
+     * @return
+     * @throws Exception
+     */
+    ResultUtil facebookLogin(String id, String name, String email, String registAreaCode, Integer uid) throws Exception;
+
+
+    /**
      * 忘记密码的操作
      * @param phone
      * @param code
@@ -102,6 +112,18 @@
 
 
     /**
+     * 绑定邮箱
+     * @param email
+     * @param code
+     * @return
+     * @throws Exception
+     */
+    ResultUtil bindingEmail(Integer uid, Integer type, String email, String code) throws Exception;
+
+
+
+
+    /**
      * 从redis中获取用户id
      * @param request
      * @return
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AgreementServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AgreementServiceImpl.java
index 085a374..f669cc3 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AgreementServiceImpl.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AgreementServiceImpl.java
@@ -24,10 +24,10 @@
      * @throws Exception
      */
     @Override
-    public String queryByType(Integer type) throws Exception {
-        String s = agreementMapper.queryByType(type, 1);
+    public String queryByType(Integer type, Integer language) throws Exception {
+        String s = agreementMapper.queryByType(type, language, 1);
         if(ToolUtil.isEmpty(s)){
-            s = agreementMapper.queryByType(type, null);
+            s = agreementMapper.queryByType(type, language, null);
         }
         return s;
     }
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
index c2ce65d..4bed438 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
@@ -119,7 +119,6 @@
                 sb.append((int) (random.nextDouble() * 10));
             }
             String authCode = sb.toString();
-            authCode="1234";
             String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!";
 
             //发送验证码短信
@@ -468,6 +467,7 @@
         loginWarpper.setToken(token);
         loginWarpper.setAppid(UUIDUtil.getRandomCode());
         loginWarpper.setPhone(ToolUtil.isNotEmpty(userInfo.getPhone()) ? 2 : 1);
+        loginWarpper.setEmail(ToolUtil.isNotEmpty(userInfo.getEmail()) ? 2 : 1);
         loginWarpper.setEmergencyContact(userInfo.getEmergencyContact());
         loginWarpper.setEmergencyContactNumber(userInfo.getEmergencyContactNumber());
         if(uid!=null){
@@ -537,8 +537,114 @@
         loginWarpper.setToken(token);
         loginWarpper.setAppid(UUIDUtil.getRandomCode());
         loginWarpper.setPhone(ToolUtil.isNotEmpty(userInfo.getPhone()) ? 2 : 1);
+        loginWarpper.setEmail(ToolUtil.isNotEmpty(userInfo.getEmail()) ? 2 : 1);
         loginWarpper.setEmergencyContact(userInfo.getEmergencyContact());
         loginWarpper.setEmergencyContactNumber(userInfo.getEmergencyContactNumber());
+        return ResultUtil.success(loginWarpper);
+    }
+
+
+    @Override
+    public ResultUtil facebookLogin(String id, String name, String email, String registAreaCode, Integer uid) throws Exception {
+        UserInfo userInfo = this.selectOne(new EntityWrapper<UserInfo>().eq("faceBookId", id).ne("flag", 3));
+        if(null == userInfo){
+            userInfo = new UserInfo();
+            userInfo.setEmail(email);
+            userInfo.setNickName(name);
+            userInfo.setIsAuth(1);
+            userInfo.setConsumption(0D);
+            userInfo.setBalance(0D);
+            userInfo.setIntegral(0);
+            userInfo.setPassWord(ShiroKit.md5("", salt));
+            userInfo.setFaceBookId(id);
+            userInfo.setState(1);
+            userInfo.setFlag(1);
+            userInfo.setInsertTime(new Date());
+            userInfo.setFreeMoney(new BigDecimal(0));
+
+            Double money = this.userInfoMapper.queryFreeMOney();
+            if(money!=null){
+                userInfo.setFreeMoney(BigDecimal.valueOf(money));
+            }
+            if(null!=uid){
+                userInfo.setUid(uid);
+                //微信登录只能是乘客用户分享
+                userInfo.setuType(1);
+            }
+            //用户所属企业
+            if(null != registAreaCode){
+                Company query = companyCityService.query(registAreaCode);
+                userInfo.setCompanyId(null != query ? query.getId() : null);
+                userInfo.setRegistAreaCode(registAreaCode);
+            }
+            this.insert(userInfo);
+
+            this.addCoupon(userInfo);//添加优惠券
+
+            UserInfo finalUserInfo = userInfo;
+            new Thread(new Runnable() {
+                @Override
+                public void run() {
+                    if(pushMinistryOfTransport){
+                        //上传数据
+                        pushMinistryOfTransportUtil.baseInfoPassenger(finalUserInfo.getId());
+                    }
+                }
+            }).start();
+        }
+
+        if(userInfo.getState() == 2){
+            return ResultUtil.error("账号被冻结");
+        }
+
+        //调用单点登录的逻辑
+        this.singlePointLogin(userInfo.getId());
+
+        String token = this.getToken(userInfo, "");
+        LoginWarpper loginWarpper = new LoginWarpper();
+        loginWarpper.setId(userInfo.getId());
+        loginWarpper.setToken(token);
+        loginWarpper.setAppid(UUIDUtil.getRandomCode());
+        loginWarpper.setPhone(ToolUtil.isNotEmpty(userInfo.getPhone()) ? 2 : 1);
+        loginWarpper.setEmail(ToolUtil.isNotEmpty(userInfo.getEmail()) ? 2 : 1);
+        loginWarpper.setEmergencyContact(userInfo.getEmergencyContact());
+        loginWarpper.setEmergencyContactNumber(userInfo.getEmergencyContactNumber());
+        if(uid!=null){
+            userInfo = userInfoMapper.selectById(uid);
+            List<Map<String, Object>> query = userActivityInviteMapper.query(userInfo.getCompanyId());
+            Date date = new Date();
+            for(Map<String, Object> map : query){
+                Double lavePrice = Double.valueOf(map.get("lavePrice").toString());
+                for(int i = Integer.valueOf(String.valueOf(map.get("totalNum"))); i > 0; i--){
+                    //判断当前优惠券金额是否大于可发放剩余总金额
+                    if(Double.valueOf(String.valueOf(map.get("money"))).compareTo(lavePrice) > 0){
+                        break;
+                    }
+                    UserCouponRecord userCouponRecord = new UserCouponRecord();
+                    userCouponRecord.setActivityType(3);
+                    userCouponRecord.setCouponActivityId(Integer.valueOf(String.valueOf(map.get("id"))));
+                    userCouponRecord.setCouponId(Integer.valueOf(String.valueOf(map.get("couponId"))));
+                    userCouponRecord.setState(1);
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.setTime(date);
+                    calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + Integer.valueOf(String.valueOf(map.get("effective"))));
+                    userCouponRecord.setExpirationTime(calendar.getTime());
+                    userCouponRecord.setCouponType(Integer.valueOf(String.valueOf(map.get("couponType"))));
+                    userCouponRecord.setCouponUseType(Integer.valueOf(String.valueOf(map.get("couponUseType"))));
+                    userCouponRecord.setInsertTime(date);
+                    userCouponRecord.setFullMoney(Double.valueOf(String.valueOf(map.get("fullMoney"))));
+                    userCouponRecord.setMoney(Double.valueOf(String.valueOf(map.get("money"))));
+                    userCouponRecord.setCompanyId(userInfo.getCompanyId());
+                    userCouponRecord.setUserId(uid);
+                    userCouponRecordService.insert(userCouponRecord);
+                    //修改剩余可发放总金额
+                    lavePrice -= Double.valueOf(String.valueOf(map.get("money")));
+                }
+                UserActivityInvite uai = userActivityInviteMapper.selectById(Integer.valueOf(map.get("id").toString()));
+                uai.setLavePrice(new BigDecimal(lavePrice).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+                userActivityInviteMapper.updateById(uai);
+            }
+        }
         return ResultUtil.success(loginWarpper);
     }
 
@@ -628,6 +734,7 @@
             loginWarpper.setToken(token);
             loginWarpper.setAppid(UUIDUtil.getRandomCode());
             loginWarpper.setPhone(2);
+            loginWarpper.setEmail(2);
             return ResultUtil.success(loginWarpper);
         }
 
@@ -640,6 +747,67 @@
         return ResultUtil.success(new LoginWarpper());
     }
 
+
+    @Override
+    public ResultUtil bindingEmail(Integer uid, Integer type, String email, String code) throws Exception {
+        boolean b = this.checkCaptcha(email, code);
+        if(!b){
+            return ResultUtil.error("验证码无效");
+        }
+        UserInfo userInfo = this.selectById(uid);
+        UserInfo userInfo1 = userInfoMapper.queryByEmail(email);
+        if(null != userInfo1){
+            userInfo1.setOpenId(userInfo.getOpenId());
+            userInfo1.setUnionid(userInfo.getUnionid());
+            userInfo1.setAppletsOpenId(userInfo.getAppletsOpenId());
+            userInfo1.setAvatar(userInfo.getAvatar());
+            userInfo1.setSex(userInfo.getSex());
+            userInfo1.setNickName(userInfo.getNickName());
+            this.updateById(userInfo1);
+
+            this.deleteById(userInfo.getId());//删除原有数据
+            //还原之前账号领取的注册优惠券
+            List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("userId", userInfo.getId()));
+            for(UserCouponRecord ucr : list){
+                if(ucr.getActivityType() == 1){//赠送
+
+                }
+                if(ucr.getActivityType() == 2){//注册
+                    UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectById(ucr.getCouponActivityId());
+                    userActivityRegistered.setLaveNum(userActivityRegistered.getLaveNum() + 1);
+                    userActivityRegistered.setLavePrice(userActivityRegistered.getLavePrice() + ucr.getMoney());
+                    userActivityRegisteredService.updateById(userActivityRegistered);
+                }
+                if(ucr.getActivityType() == 3){//邀请
+
+                }
+                if(ucr.getActivityType() == 4){//充值
+
+                }
+                userCouponRecordService.deleteById(ucr.getId());
+            }
+
+
+            //获取新的token等数据
+            String token = this.getToken(userInfo1, "");
+            LoginWarpper loginWarpper = new LoginWarpper();
+            loginWarpper.setId(userInfo1.getId());
+            loginWarpper.setToken(token);
+            loginWarpper.setAppid(UUIDUtil.getRandomCode());
+            loginWarpper.setPhone(2);
+            loginWarpper.setEmail(2);
+            return ResultUtil.success(loginWarpper);
+        }
+
+        userInfo.setEmail(email);
+        userInfo.setUpdateTime(new Date());
+        userInfo.setUpdateUser(userInfo.getId());
+        this.updateById(userInfo);
+        if(type == 1){//注册成功后发送邮件
+            EmailUtil.getMimeMessage(email, "注册账户", "");
+        }
+        return ResultUtil.success(new LoginWarpper());
+    }
 
     /**
      * 从redis中获取数据
@@ -784,6 +952,8 @@
         UserInfo userInfo = this.selectById(uid);
         userInfo.setPassWord(ShiroKit.md5(password, salt));
         this.updateById(userInfo);
+        //发送邮件
+        EmailUtil.getMimeMessage(userInfo.getEmail(), "修改密码", "");
         return ResultUtil.success();
     }
 
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/EmailUtil.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/EmailUtil.java
new file mode 100644
index 0000000..c0a9789
--- /dev/null
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/EmailUtil.java
@@ -0,0 +1,96 @@
+package com.stylefeng.guns.modular.system.util;
+
+import javax.mail.*;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import java.util.Date;
+import java.util.Properties;
+
+/**
+ * 邮件工具类
+ */
+public class EmailUtil {
+
+    /*
+     * gmail邮箱SSL方式
+     */
+    private static void gmailssl(Properties props) {
+        final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
+        props.put("mail.debug", "true");
+        props.put("mail.smtp.host", "smtp.gmail.com");
+        props.put("mail.smtp.ssl.enable", "true");
+        props.put("mail.smtp.socketFactory.class", SSL_FACTORY);
+        props.put("mail.smtp.port", "465");
+        props.put("mail.smtp.socketFactory.port", "465");
+        props.put("mail.smtp.auth", "true");
+    }
+
+
+    //gmail邮箱的TLS方式
+    private static void gmailtls(Properties props) {
+        props.put("mail.smtp.auth", "true");
+        props.put("mail.smtp.starttls.enable", "true");
+        props.put("mail.smtp.host", "smtp.gmail.com");
+        props.put("mail.smtp.port", "587");
+    }
+
+    /**
+     * 创建邮件内容 需科学上网
+     *
+     * @param sentToEmail 接收人邮箱
+     * @return
+     * @throws Exception
+     */
+    public static boolean getMimeMessage(String sentToEmail, String subject, String content) throws Exception {
+        //1.创建一封邮件的实例对象
+        Properties props = new Properties();
+        //选择ssl方式
+        gmailssl(props);
+
+        final String username = "southwindservice@gmail.com";// gmail 邮箱
+        final String password = "irkgrsuzxgmwrxzy";// Google应用专用密码
+        // 当做多商户的时候需要使用getInstance, 如果只是一个邮箱发送的话就用getDefaultInstance
+        // Session.getDefaultInstance 会将username,password保存在session会话中
+        // Session.getInstance 不进行保存
+        Session session = Session.getInstance(props,
+                new Authenticator() {
+                    protected PasswordAuthentication getPasswordAuthentication() {
+                        return new PasswordAuthentication(username, password);
+                    }
+                });
+        MimeMessage msg = new MimeMessage(session);
+        //2.设置发件人地址
+        msg.setFrom(new InternetAddress(sentToEmail));
+        /**
+         * 3.设置收件人地址(可以增加多个收件人、抄送、密送),即下面这一行代码书写多行
+         * MimeMessage.RecipientType.TO:发送
+         * MimeMessage.RecipientType.CC:抄送
+         * MimeMessage.RecipientType.BCC:密送
+         */
+        msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(sentToEmail));
+        //4.设置邮件主题
+        msg.setSubject(subject, "UTF-8");
+        // 6. 创建文本"节点"
+        MimeBodyPart text = new MimeBodyPart();
+        // 这里添加图片的方式是将整个图片包含到邮件内容中, 实际上也可以以 http 链接的形式添加网络图片
+        text.setContent(content, "text/html;charset=UTF-8");
+        // 7. (文本+图片)设置 文本 和 图片"节点"的关系(将 文本 和 图片"节点"合成一个混合"节点")
+        MimeMultipart mm_text_image = new MimeMultipart();
+        mm_text_image.addBodyPart(text);
+        mm_text_image.setSubType("related");    // 关联关系
+        // 11. 设置整个邮件的关系(将最终的混合"节点"作为邮件的内容添加到邮件对象)
+        msg.setContent(mm_text_image);
+        //设置邮件的发送时间,默认立即发送
+        msg.setSentDate(new Date());
+
+        Transport.send(msg);
+        return true;
+    }
+
+    public static void main(String[] args) throws Exception {
+        boolean mimeMessage = getMimeMessage("393733352@qq.com", "测试内容", "这是一段测试内容");
+        System.out.println(mimeMessage);
+    }
+}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/DistancematrixVo.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/DistancematrixVo.java
new file mode 100644
index 0000000..a18b151
--- /dev/null
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/DistancematrixVo.java
@@ -0,0 +1,29 @@
+package com.stylefeng.guns.modular.system.util.GoogleMap;
+
+public class DistancematrixVo {
+    /**
+     * 预估时间(秒)
+     */
+    private Long duration;
+
+    /**
+     * 预估里程(米)
+     */
+    private Long distance;
+
+    public Long getDuration() {
+        return duration;
+    }
+
+    public void setDuration(Long duration) {
+        this.duration = duration;
+    }
+
+    public Long getDistance() {
+        return distance;
+    }
+
+    public void setDistance(Long distance) {
+        this.distance = distance;
+    }
+}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FindPlaceFromTextVo.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FindPlaceFromTextVo.java
new file mode 100644
index 0000000..0b34a97
--- /dev/null
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FindPlaceFromTextVo.java
@@ -0,0 +1,52 @@
+package com.stylefeng.guns.modular.system.util.GoogleMap;
+
+public class FindPlaceFromTextVo {
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 详细地址
+     */
+    private String address;
+    /**
+     * 纬度
+     */
+    private Double lat;
+    /**
+     * 经度
+     */
+    private Double lng;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public Double getLat() {
+        return lat;
+    }
+
+    public void setLat(Double lat) {
+        this.lat = lat;
+    }
+
+    public Double getLng() {
+        return lng;
+    }
+
+    public void setLng(Double lng) {
+        this.lng = lng;
+    }
+}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GeocodeVo.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GeocodeVo.java
new file mode 100644
index 0000000..0c77d18
--- /dev/null
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GeocodeVo.java
@@ -0,0 +1,28 @@
+package com.stylefeng.guns.modular.system.util.GoogleMap;
+
+public class GeocodeVo {
+    /**
+     * 纬度
+     */
+    private double lat;
+    /**
+     * 经度
+     */
+    private double lng;
+
+    public double getLat() {
+        return lat;
+    }
+
+    public void setLat(double lat) {
+        this.lat = lat;
+    }
+
+    public double getLng() {
+        return lng;
+    }
+
+    public void setLng(double lng) {
+        this.lng = lng;
+    }
+}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GoogleMapUtil.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GoogleMapUtil.java
new file mode 100644
index 0000000..cabe7c4
--- /dev/null
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/GoogleMapUtil.java
@@ -0,0 +1,161 @@
+package com.stylefeng.guns.modular.system.util.GoogleMap;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.maps.*;
+import com.google.maps.model.*;
+
+/**
+ * 谷歌地图工具类
+ */
+public class GoogleMapUtil {
+
+    private final static String key = "AIzaSyA_FEliOkbkL1IAHQsnBpbpo9MlIp729H0";
+
+
+    /**
+     * 地理编码(地址获取位置坐标)
+     * @param address       地址信息
+     * @throws Exception
+     */
+    public static GeocodeVo getGeocode(String address) throws Exception{
+        GeoApiContext context = new GeoApiContext.Builder()
+                .apiKey(key)
+                .build();
+        GeocodingResult[] results =  GeocodingApi.geocode(context, address).await();
+        GeocodeVo vo = null;
+        if(results.length > 0){
+            Gson gson = new GsonBuilder().setPrettyPrinting().create();
+            System.out.println(gson.toJson(results[0].addressComponents));
+
+            Geometry geometry = results[0].geometry;
+            LatLng location = geometry.location;
+            vo = new GeocodeVo();
+            vo.setLat(location.lat);
+            vo.setLng(location.lng);
+        }
+        context.shutdown();
+        return vo;
+    }
+
+
+    /**
+     * 逆地理编码获取地址信息
+     * @param lat   纬度
+     * @param lng   经度
+     * @return
+     * @throws Exception
+     */
+    public static String getReverseGeocode(double lat, double lng) throws Exception{
+        GeoApiContext context = new GeoApiContext.Builder()
+                .apiKey(key)
+                .build();
+        GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng));
+        GeocodingResult[] results = request.await();
+        String address = null;
+        if(results.length > 0){
+            Gson gson = new GsonBuilder().setPrettyPrinting().create();
+            System.out.println(gson.toJson(results[0].addressComponents));
+
+            address = results[0].formattedAddress;
+        }
+        context.shutdown();
+        return address;
+    }
+
+
+    /**
+     * 搜索地图获取地图结果
+     * @param input
+     * @return
+     * @throws Exception
+     */
+    public static FindPlaceFromTextVo findplacefromtext(String input) throws Exception{
+        GeoApiContext context = new GeoApiContext.Builder()
+                .apiKey(key)
+                .build();
+        FindPlaceFromTextRequest request = new FindPlaceFromTextRequest(context);
+        request.input(input);
+        request.inputType(FindPlaceFromTextRequest.InputType.TEXT_QUERY);
+        FindPlaceFromText findPlaceFromText = request.await();
+        PlacesSearchResult[] candidates = findPlaceFromText.candidates;
+        FindPlaceFromTextVo vo = null;
+        if(candidates.length > 0){
+            vo = new FindPlaceFromTextVo();
+            String formattedAddress = candidates[0].formattedAddress;
+            String name = candidates[0].name;
+            Geometry geometry = candidates[0].geometry;
+            LatLng location = geometry.location;
+            double lat = location.lat;
+            double lng = location.lng;
+
+            vo.setName(name);
+            vo.setAddress(formattedAddress);
+            vo.setLat(lat);
+            vo.setLng(lng);
+        }
+        return vo;
+    }
+
+
+
+    /**
+     * 获取两个地点之间的预估里程和预估时间
+     * @param origin        起点
+     * @param destination   终点
+     * @return
+     * @throws Exception
+     */
+    public static DistancematrixVo getDistancematrix(String origin, String destination) throws Exception{
+        GeoApiContext context = new GeoApiContext.Builder()
+                .apiKey(key)
+                .build();
+        DistanceMatrixApiRequest request = DistanceMatrixApi.getDistanceMatrix(context, new String[]{origin}, new String[]{destination});
+        request.mode(TravelMode.DRIVING);//出行方式(驾车)
+        DistanceMatrix distanceMatrix = request.await();
+        Gson gson = new GsonBuilder().setPrettyPrinting().create();
+        System.out.println(gson.toJson(distanceMatrix));
+        context.shutdown();
+
+        DistanceMatrixElement elements = distanceMatrix.rows[0].elements[0];
+        DistancematrixVo vo = new DistancematrixVo();
+        vo.setDistance(elements.distance.inMeters);
+        vo.setDuration(elements.duration.inSeconds);
+        return vo;
+    }
+
+
+
+    /**
+     * 获取两地点之间的线路规划
+     * @param origin        起点 要计算方向的位置ID、地址或文本纬度/经度值。目标参数的选项与原点参数的相同。
+     * @param destination   终点 要计算方向的位置ID、地址或文本纬度/经度值。目标参数的选项与原点参数的相同。
+     *
+     */
+    public static void getDirections(String origin, String destination) throws Exception{
+        GeoApiContext context = new GeoApiContext.Builder()
+                .apiKey(key)
+                .build();
+        DirectionsApiRequest directions = DirectionsApi.getDirections(context, origin, destination);
+        directions.mode(TravelMode.DRIVING);//出行方式(驾车)
+        DirectionsResult result = directions.await();
+
+        Gson gson = new GsonBuilder().setPrettyPrinting().create();
+        System.out.println(gson.toJson(result));
+        context.shutdown();
+    }
+
+
+
+
+
+    public static void main(String[] ages){
+        try {
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+
+}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/Tingg/TinggPayUtil.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/Tingg/TinggPayUtil.java
new file mode 100644
index 0000000..c393a9c
--- /dev/null
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/Tingg/TinggPayUtil.java
@@ -0,0 +1,7 @@
+package com.stylefeng.guns.modular.system.util.Tingg;
+
+/**
+ * Tingg支付工具类
+ */
+public class TinggPayUtil {
+}
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java
index a095cbf..aa4a4c5 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java
@@ -13,6 +13,8 @@
     private String appid;
     @ApiModelProperty("是否有手机号码(1=否,2=是)")
     private Integer phone;
+    @ApiModelProperty("是否有邮箱(1=否,2=是)")
+    private Integer email;
     @ApiModelProperty("紧急联系人")
     private String emergencyContact;
     @ApiModelProperty("联系人电话")
@@ -50,6 +52,14 @@
         this.phone = phone;
     }
 
+    public Integer getEmail() {
+        return email;
+    }
+
+    public void setEmail(Integer email) {
+        this.email = email;
+    }
+
     public String getEmergencyContact() {
         return emergencyContact;
     }
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java
index 2c27096..5b1859d 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java
@@ -19,6 +19,8 @@
     private String nickName;
     @ApiModelProperty("电话")
     private String phone;
+    @ApiModelProperty("邮箱地址")
+    private String email;
     @ApiModelProperty("是否实名(1:否,2:是)")
     private Integer isAuth;
     @ApiModelProperty("实名认证状态(1=待认证,2=认证通过,3=认证失败)")
@@ -33,6 +35,8 @@
     private Integer integral;
     @ApiModelProperty("账户余额")
     private Double balance;
+    @ApiModelProperty("多语言(1=简体中文,2=英语,3=法语)")
+    private Integer language;
     @ApiModelProperty("紧急联系人姓名")
     private String emergencyContact;
     @ApiModelProperty("紧急联系人电话")
@@ -68,6 +72,14 @@
 
     public void setPhone(String phone) {
         this.phone = phone;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
     }
 
     public Integer getIsAuth() {
@@ -142,6 +154,14 @@
         this.balance = balance;
     }
 
+    public Integer getLanguage() {
+        return language;
+    }
+
+    public void setLanguage(Integer language) {
+        this.language = language;
+    }
+
     @Override
     public String toString() {
         return "UserInfoWarpper{" +
@@ -177,6 +197,8 @@
             userInfoWarpper.setEmergencyContact(null != map.get("emergencyContact") ? String.valueOf(map.get("emergencyContact")) : "");
             userInfoWarpper.setEmergencyContactNumber(null != map.get("emergencyContactNumber") ? String.valueOf(map.get("emergencyContactNumber")) : "");
             userInfoWarpper.setBalance(null != map.get("balance") ? Double.valueOf(String.valueOf(map.get("balance"))) : 0);
+            userInfoWarpper.setEmail(null != map.get("email") ? String.valueOf(map.get("email")) : "");
+            userInfoWarpper.setLanguage(null != map.get("language") ? Integer.valueOf(String.valueOf(map.get("language"))) : 1);
         }
         return userInfoWarpper;
     }
diff --git a/UserIGOTravel/guns-admin/src/main/resources/application.yml b/UserIGOTravel/guns-admin/src/main/resources/application.yml
index 2ea02f2..a582843 100644
--- a/UserIGOTravel/guns-admin/src/main/resources/application.yml
+++ b/UserIGOTravel/guns-admin/src/main/resources/application.yml
@@ -63,9 +63,9 @@
 spring:
   profiles: local
   datasource:
-    url: jdbc:mysql://116.63.168.184:3306/feima?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai
     username: root
-    password: root
+    password: 123456
     db-name: guns #用来搜集数据库的所有表
     filters: wall,mergeStat
 
@@ -135,6 +135,14 @@
 
 ---
 
+---
+#脸书
+facebook:
+  appid:
+  secretKey:
+
+---
+
 juhe: #聚合数据
   appKey: c0d55e1fb67efd7ae3175ee9bd8c6bc2 #
 
@@ -150,6 +158,21 @@
 #测试环境
 callbackPath: http://39.108.37.243/user
 
+---
+
+spring:
+  mail:
+    host: smtp.gmail.com # 配置 smtp 服务器地址
+    port: 465 # smtp 服务器的端口
+    username: southwindservice@gmail.com # 配置邮箱用户名(你的邮箱地址)
+    password: irkgrsuzxgmwrxzy # 配置申请到的授权码(刚让复制的授权码)
+    default-encoding: UTF-8 # 配置邮件编码
+    properties:
+      mail:
+        smtp:
+          socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂
+        debug: true
+    from: southwindservice@gmail.com # 发送方邮件,配在yml中可方便更改
 
 ---
 

--
Gitblit v1.7.1