caolinxuan 4 天之前
當前提交
4849b6cf96

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 95 - 0
pom.xml

@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>com.example</groupId>
+    <artifactId>Ctrip</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>Ctrip</name>
+    <description>Ctrip</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring-boot.version>2.6.13</spring-boot.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
+            <version>3.5.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+        </dependency>
+    </dependencies>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring-boot.version}</version>
+                <configuration>
+                    <mainClass>com.zhentao.CtripApplication</mainClass>
+                    <skip>true</skip>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>repackage</id>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 13 - 0
src/main/java/com/zhentao/CtripApplication.java

@@ -0,0 +1,13 @@
+package com.zhentao;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class CtripApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(CtripApplication.class, args);
+    }
+
+}

+ 23 - 0
src/main/java/com/zhentao/common/user/controller/UserController.java

@@ -0,0 +1,23 @@
+package com.zhentao.common.user.controller;
+
+import com.zhentao.common.user.mapper.TravelUserMapper;
+import com.zhentao.common.user.service.TravelUserService;
+import com.zhentao.utils.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+@RestController
+@RequestMapping("user")
+public class UserController {
+    @Autowired
+    private TravelUserService  travelUserService;
+    @RequestMapping("WXLogin")
+    public ResultVo WXLogin(@RequestBody Map<String,String> requestData, HttpServletRequest request){
+        return travelUserService.WxLogin(requestData,request);
+    }
+}

+ 156 - 0
src/main/java/com/zhentao/common/user/domain/TravelUser.java

@@ -0,0 +1,156 @@
+package com.zhentao.common.user.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ *
+ * @TableName travel_user
+ */
+@TableName(value ="travel_user")
+@Data
+public class TravelUser implements Serializable {
+    /**
+     * 用户id
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 用户昵称
+     */
+    private String nickname;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 微信登录唯一标识
+     */
+    private String openId;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 盐
+     */
+    private String salt;
+
+    /**
+     * 注册时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 用户头像
+     */
+    private String avatarUrl;
+
+    /**
+     * 是否删除
+     */
+    private Integer isDel;
+
+    /**
+     * 是否禁用
+     */
+    private Integer isBan;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 用户年龄画像
+     */
+    private Integer userAges;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        TravelUser other = (TravelUser) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
+            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
+            && (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
+            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
+            && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+            && (this.getAvatarUrl() == null ? other.getAvatarUrl() == null : this.getAvatarUrl().equals(other.getAvatarUrl()))
+            && (this.getIsDel() == null ? other.getIsDel() == null : this.getIsDel().equals(other.getIsDel()))
+            && (this.getIsBan() == null ? other.getIsBan() == null : this.getIsBan().equals(other.getIsBan()))
+            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
+            && (this.getUserAges() == null ? other.getUserAges() == null : this.getUserAges().equals(other.getUserAges()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
+        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
+        result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
+        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
+        result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
+        result = prime * result + ((getAvatarUrl() == null) ? 0 : getAvatarUrl().hashCode());
+        result = prime * result + ((getIsDel() == null) ? 0 : getIsDel().hashCode());
+        result = prime * result + ((getIsBan() == null) ? 0 : getIsBan().hashCode());
+        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
+        result = prime * result + ((getUserAges() == null) ? 0 : getUserAges().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", nickname=").append(nickname);
+        sb.append(", phone=").append(phone);
+        sb.append(", openId=").append(openId);
+        sb.append(", password=").append(password);
+        sb.append(", salt=").append(salt);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", avatorUrl=").append(avatarUrl);
+        sb.append(", isDel=").append(isDel);
+        sb.append(", isBan=").append(isBan);
+        sb.append(", email=").append(email);
+        sb.append(", userAges=").append(userAges);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 24 - 0
src/main/java/com/zhentao/common/user/mapper/TravelUserMapper.java

@@ -0,0 +1,24 @@
+package com.zhentao.common.user.mapper;
+
+import com.zhentao.common.user.domain.TravelUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhentao.utils.ResultVo;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+/**
+* @author 86159
+* @description 针对表【travel_user】的数据库操作Mapper
+* @createDate 2025-05-18 18:40:29
+* @Entity com.zhentao.user.domain.TravelUser
+*/
+public interface TravelUserMapper extends BaseMapper<TravelUser> {
+
+
+}
+
+
+
+
+

+ 18 - 0
src/main/java/com/zhentao/common/user/service/TravelUserService.java

@@ -0,0 +1,18 @@
+package com.zhentao.common.user.service;
+
+import com.zhentao.common.user.domain.TravelUser;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhentao.utils.ResultVo;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+/**
+* @author 86159
+* @description 针对表【travel_user】的数据库操作Service
+* @createDate 2025-05-18 18:40:29
+*/
+public interface TravelUserService extends IService<TravelUser> {
+
+    ResultVo WxLogin(Map<String, String> requestData, HttpServletRequest request);
+}

+ 40 - 0
src/main/java/com/zhentao/common/user/service/impl/TravelUserServiceImpl.java

@@ -0,0 +1,40 @@
+package com.zhentao.common.user.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.zhentao.common.user.domain.TravelUser;
+import com.zhentao.common.user.mapper.TravelUserMapper;
+import com.zhentao.common.user.service.TravelUserService;
+import com.zhentao.utils.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+/**
+* @author 86159
+* @description 针对表【travel_user】的数据库操作Service实现
+* @createDate 2025-05-18 18:40:29
+*/
+@Service
+public class TravelUserServiceImpl extends ServiceImpl<TravelUserMapper, TravelUser>
+    implements TravelUserService {
+    @Autowired
+    private TravelUserMapper travelUserMapper;
+    @Value(" ${wechat.appid}")
+    private String APPID;
+    @Value(" ${wechat.secret}")
+    private String SECRET;
+    private static final ObjectMapper objectMapper = new ObjectMapper();//JSON解析器
+    @Override
+    public ResultVo WxLogin(Map<String, String> requestData, HttpServletRequest request) {
+
+        return null;
+    }
+}
+
+
+
+

+ 164 - 0
src/main/java/com/zhentao/constants/CommonConstant.java

@@ -0,0 +1,164 @@
+
+
+package com.zhentao.constants;
+
+/**
+ * 公共常量
+ */
+public interface CommonConstant {
+
+    /**
+     * 默认页码为1
+     */
+    Long DEFAULT_PAGE_INDEX = 1L;
+
+    /**
+     * 默认页大小为10
+     */
+    Long DEFAULT_PAGE_SIZE = 10L;
+
+    /**
+     * 分页总行数名称
+     */
+    String PAGE_TOTAL_NAME = "total";
+
+    /**
+     * 分页数据列表名称
+     */
+    String PAGE_RECORDS_NAME = "records";
+
+    /**
+     * 分页当前页码名称
+     */
+    String PAGE_INDEX_NAME = "pageIndex";
+
+    /**
+     * 分页当前页大小名称
+     */
+    String PAGE_SIZE_NAME = "pageSize";
+
+    /**
+     * 分页最后一页
+     */
+    String PAGE_LAST_NAME = "lastPage";
+
+    /**
+     * 登录用户
+     */
+    String LOGIN_SYS_USER = "loginSysUser";
+
+    /**
+     * 登录token
+     */
+    String JWT_DEFAULT_TOKEN_NAME = "token";
+
+    /**
+     * JWT用户名
+     */
+    String JWT_USERNAME = "username";
+
+    /**
+     * JWT刷新新token响应状态码
+     */
+    int JWT_REFRESH_TOKEN_CODE = 460;
+    int ERROR = 400;
+    int OK = 200;
+    int NOTFOUND = 404;
+    String SUCCESS="操作成功";
+    String NOPAGE="不存在页面请求";
+    String FAILD="操作失败";
+    /**
+     * JWT刷新新token响应状态码,
+     * Redis中不存在,但jwt未过期,不生成新的token,返回361状态码
+     */
+    int JWT_INVALID_TOKEN_CODE = 461;
+
+    /**
+     * JWT Token默认密钥
+     */
+    String JWT_DEFAULT_SECRET = "888888";
+
+    /**
+     * JWT 默认过期时间,3600L,单位秒
+     */
+    Long JWT_DEFAULT_EXPIRE_SECOND = 36000L;
+
+    /**
+     * 默认头像
+     */
+    String DEFAULT_HEAD_URL = "";
+
+    /**
+     * 管理员角色名称
+     */
+    String ADMIN_ROLE_NAME = "管理员";
+
+    String ADMIN_LOGIN = "adminLogin";
+
+    /**
+     * 验证码token
+     */
+    String VERIFY_TOKEN = "verifyToken";
+
+    /**
+     * 图片
+     */
+    String IMAGE = "image";
+
+    /**
+     * JPEG
+     */
+    String JPEG = "JPEG";
+
+    /**
+     * base64前缀
+     */
+    String BASE64_PREFIX = "data:image/png;base64,";
+
+    /**
+     * ..
+     */
+    String SPOT_SPOT = "..";
+
+    /**
+     * ../
+     */
+    String SPOT_SPOT_BACKSLASH = "../";
+
+    /**
+     * SpringBootAdmin登录信息
+     */
+    String ADMIN_LOGIN_SESSION = "adminLoginSession";
+
+    /**
+     * 用户浏览器代理
+     */
+    String USER_AGENT = "User-Agent";
+
+    /**
+     * 本机地址IP
+     */
+    String LOCALHOST_IP = "127.0.0.1";
+    /**
+     * 本机地址名称
+     */
+    String LOCALHOST_IP_NAME = "本机地址";
+    /**
+     * 局域网IP
+     */
+    String LAN_IP = "192.168";
+    /**
+     * 局域网名称
+     */
+    String LAN_IP_NAME = "局域网";
+    /**
+     * 忽略appId
+     */
+    String NOT_WITH_App_Id = "notWithAppId";
+
+    String mobile="1688888888";
+
+    String password="boss1688";
+
+    Integer chains_app_id=10001;
+}

+ 7 - 0
src/main/java/com/zhentao/enums/BaseExceptionEnum.java

@@ -0,0 +1,7 @@
+package com.zhentao.enums;
+
+public interface BaseExceptionEnum {
+    Integer getCode();
+
+    String getMessage();
+}

+ 21 - 0
src/main/java/com/zhentao/exceptions/ApiException.java

@@ -0,0 +1,21 @@
+package com.zhentao.exceptions;
+
+
+import com.zhentao.enums.BaseExceptionEnum;
+import lombok.Data;
+
+@Data
+public class ApiException extends RuntimeException{
+    public Integer code;
+    public String msg;
+    public ApiException(BaseExceptionEnum baseExceptionEnum){
+        super(baseExceptionEnum.getMessage());
+        this.code=baseExceptionEnum.getCode();
+        this.msg=baseExceptionEnum.getMessage();
+    }
+    public ApiException(Integer code, String message){
+        super(message);
+        this.code=code;
+        this.msg=message;
+    }
+}

+ 45 - 0
src/main/java/com/zhentao/exceptions/GlobalExceptionHandler.java

@@ -0,0 +1,45 @@
+package com.zhentao.exceptions;
+
+
+import com.zhentao.constants.CommonConstant;
+import com.zhentao.utils.ResultVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.multipart.MultipartException;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+import javax.servlet.http.HttpServletRequest;
+
+@ControllerAdvice
+@RestControllerAdvice
+@Slf4j
+public class GlobalExceptionHandler {
+
+    @ExceptionHandler(value = Exception.class)
+    @ResponseBody
+    public ResultVo defaultErrorHandler(HttpServletRequest req, Exception e){
+        log.error(e.getMessage());
+        if(e instanceof NoHandlerFoundException){
+            return  new ResultVo(CommonConstant.NOTFOUND,CommonConstant.NOPAGE,null);
+        }
+        if(e instanceof ApiException){
+            ApiException costomException= (ApiException) e;
+            return new ResultVo(costomException.getCode(),costomException.getMessage(),null);
+        }
+        else if (e instanceof MultipartException){
+            log.error("系统异常{}",e);
+            return new ResultVo(1000,"上传文件异常",null);
+        } else if (e instanceof MethodArgumentNotValidException) {
+            MethodArgumentNotValidException methodArgumentNotValidException= (MethodArgumentNotValidException) e;
+            return new ResultVo(1002,methodArgumentNotValidException.getBindingResult().getFieldError().getDefaultMessage(),null);
+        }
+        else {
+            log.error("系统异常{}",e);
+            return new ResultVo(1001,"系统参数异常",null);
+        }
+    }
+}

+ 28 - 0
src/main/java/com/zhentao/utils/ResultVo.java

@@ -0,0 +1,28 @@
+package com.zhentao.utils;
+
+import com.zhentao.constants.CommonConstant;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ResultVo {
+    private Integer code;
+    private String message;
+    private Object data;
+
+    public static ResultVo OK(){
+        return new ResultVo(CommonConstant.OK,CommonConstant.SUCCESS,null);
+    }
+    public static ResultVo ERROR(){
+        return new ResultVo(CommonConstant.ERROR,CommonConstant.FAILD,null);
+    }
+    public static ResultVo OK(Object data){
+        return new ResultVo(CommonConstant.OK,CommonConstant.SUCCESS,data);
+    }
+    public static ResultVo ERROR(Object data){
+        return new ResultVo(CommonConstant.ERROR,CommonConstant.FAILD,data);
+    }
+}

+ 11 - 0
src/main/java/com/zhentao/utils/WechatAuthResponse.java

@@ -0,0 +1,11 @@
+package com.zhentao.utils;
+
+import lombok.Data;
+
+@Data
+public class WechatAuthResponse {
+    private String openid;
+    private String session_key;
+    private String errcode;
+    private String errmsg;
+}

+ 41 - 0
src/main/java/com/zhentao/utils/WechatLoginUtil.java

@@ -0,0 +1,41 @@
+package com.zhentao.utils;
+
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+
+public class WechatLoginUtil {
+
+    private static final String APP_ID = "wx8246d27305af5834"; // 替换为你的AppID
+    private static final String APP_SECRET = "8badbee7a035911171cdccb13c67de30"; // 替换为你的AppSecret
+    private static final String WECHAT_LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session";
+
+    public static WechatAuthResponse getAuthInfo(String code) throws IOException {
+        // 构造微信登录接口的URL,包含必要的参数
+        String url = WECHAT_LOGIN_URL + "?appid=" + APP_ID + "&secret=" + APP_SECRET + "&js_code=" + code + "&grant_type=authorization_code";
+
+        // 创建一个默认的HTTP客户端,用于发送HTTP请求
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+
+        // 创建一个HTTP GET请求对象,指定请求的URL
+        HttpGet httpGet = new HttpGet(url);
+
+        // 执行HTTP GET请求,获取微信服务器的响应
+        CloseableHttpResponse response = httpClient.execute(httpGet);
+
+        // 从响应中获取响应体内容,并将其转换为字符串
+        String jsonResponse = EntityUtils.toString(response.getEntity());
+        // 创建一个Jackson的ObjectMapper对象,用于处理JSON数据
+        ObjectMapper objectMapper = new ObjectMapper();
+
+        // 将微信返回的JSON字符串解析为WechatAuthResponse对象
+        // WechatAuthResponse是一个自定义的Java类,用于封装微信返回的用户认证信息
+        return objectMapper.readValue(jsonResponse, WechatAuthResponse.class);
+    }
+}

+ 11 - 0
src/main/resources/application.yml

@@ -0,0 +1,11 @@
+server:
+  port: 8000
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://47.111.130.63:3306/world_travel?serverTimezone=UTC
+    username: root
+    password: Yizu@666
+wechat:
+  appid: wx8246d27305af5834
+  secret: 8badbee7a035911171cdccb13c67de30

+ 30 - 0
src/main/resources/mapper/TravelUserMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhentao.common.user.mapper.TravelUserMapper">
+
+    <resultMap id="BaseResultMap" type="com.zhentao.common.user.domain.TravelUser">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="nickname" column="nickname" jdbcType="VARCHAR"/>
+            <result property="phone" column="phone" jdbcType="VARCHAR"/>
+            <result property="openId" column="open_id" jdbcType="VARCHAR"/>
+            <result property="password" column="password" jdbcType="VARCHAR"/>
+            <result property="salt" column="salt" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="avatorUrl" column="avator_url" jdbcType="VARCHAR"/>
+            <result property="isDel" column="is_del" jdbcType="TINYINT"/>
+            <result property="isBan" column="is_ban" jdbcType="TINYINT"/>
+            <result property="email" column="email" jdbcType="VARCHAR"/>
+            <result property="userAges" column="user_ages" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,nickname,phone,
+        open_id,password,salt,
+        create_time,update_time,avator_url,
+        is_del,is_ban,email,
+        user_ages
+    </sql>
+</mapper>

+ 6 - 0
src/main/resources/static/index.html

@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>hello word!!!</h1>
+<p>this is a html page</p>
+</body>
+</html>

+ 13 - 0
src/test/java/com/zhentao/CtripApplicationTests.java

@@ -0,0 +1,13 @@
+package com.zhentao;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class CtripApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}