登陆模块

main
XiaoHH 2 years ago
parent 8bc15a87cf
commit 296a3a602f

@ -67,6 +67,12 @@
<artifactId>verification-code-client</artifactId>
</dependency>
<!-- 乘客用户模块的远程调用 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>passenger-user-client</artifactId>
</dependency>
<!-- 公共的web模块 -->
<dependency>
<groupId>com.greateme</groupId>

@ -1,8 +1,10 @@
package com.greateme.passenger.controller;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.passenger.entity.dto.PassengerLoginOrRegisterDTO;
import com.greateme.passenger.service.PassengerVerificationService;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
@ -51,7 +53,18 @@ public class PassengerVerificationController {
* @return bool
*/
@PostMapping("/check")
public ResponseEntity<Integer> checkVerificationCode(@RequestBody PassengerVerificationCodeVO passengerVerificationCode) {
public ResponseEntity<CheckPhoneVerificationCodeVO> checkVerificationCode(@RequestBody PassengerVerificationCodeVO passengerVerificationCode) {
return ResponseEntity.success(this.verificationService.checkPhoneVerificationCode(passengerVerificationCode));
}
/**
*
*
* @param passengerVerificationCode
* @return
*/
@PostMapping("/loginOrRegister")
public ResponseEntity<PassengerLoginOrRegisterDTO> loginOrRegister(@RequestBody PassengerVerificationCodeVO passengerVerificationCode) {
return ResponseEntity.success(this.verificationService.loginOrRegister(passengerVerificationCode));
}
}

@ -1,6 +1,8 @@
package com.greateme.passenger.service;
import com.greateme.passenger.entity.dto.PassengerLoginOrRegisterDTO;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
/**
@ -29,5 +31,13 @@ public interface PassengerVerificationService {
* @param passengerVerificationCode
* @return bool
*/
Integer checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode);
CheckPhoneVerificationCodeVO checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode);
/**
*
*
* @param passengerVerificationCode
* @return
*/
PassengerLoginOrRegisterDTO loginOrRegister(PassengerVerificationCodeVO passengerVerificationCode);
}

@ -1,9 +1,12 @@
package com.greateme.passenger.service.impl;
import com.greateme.contant.http.HttpStatus;
import com.greateme.constant.http.HttpStatus;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.passenger.entity.dto.PassengerLoginOrRegisterDTO;
import com.greateme.passenger.feign.PassengerUserRemote;
import com.greateme.passenger.service.PassengerVerificationService;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import com.greateme.verification.feign.VerificationCodeRemote;
import org.slf4j.Logger;
@ -35,6 +38,12 @@ public class PassengerVerificationServiceImpl implements PassengerVerificationSe
@Autowired
private VerificationCodeRemote verificationCodeRemote;
/**
*
*/
@Autowired
private PassengerUserRemote passengerUserRemote;
/**
*
*
@ -63,12 +72,27 @@ public class PassengerVerificationServiceImpl implements PassengerVerificationSe
* @return bool
*/
@Override
public Integer checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode) {
ResponseEntity<Integer> checkResult = verificationCodeRemote.checkPhoneVerificationCode(passengerVerificationCode);
public CheckPhoneVerificationCodeVO checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode) {
ResponseEntity<CheckPhoneVerificationCodeVO> checkResult = verificationCodeRemote.checkPhoneVerificationCode(passengerVerificationCode);
if (HttpStatus.SUCCESS.getCode() == checkResult.getCode()) {
return checkResult.getData();
}
log.error("判断验证码是否正确的是否发生了错误,错误码:{},错误信息:{}", checkResult.getCode(), checkResult.getMessage());
return null;
}
/**
*
*
* @param passengerVerificationCode
* @return
*/
@Override
public PassengerLoginOrRegisterDTO loginOrRegister(PassengerVerificationCodeVO passengerVerificationCode) {
ResponseEntity<PassengerLoginOrRegisterDTO> loginOrRegisterResult = this.passengerUserRemote.loginOrRegister(passengerVerificationCode);
if (HttpStatus.SUCCESS.getCode() == loginOrRegisterResult.getCode()) {
return loginOrRegisterResult.getData();
}
return null;
}
}

@ -1,6 +1,6 @@
package com.greateme.springboot;
import com.greateme.contant.PackageContent;
import com.greateme.constant.PackageContent;
import org.springframework.cloud.openfeign.EnableFeignClients;
import java.lang.annotation.ElementType;

@ -1,6 +1,6 @@
package com.greateme.springboot;
import com.greateme.contant.PackageContent;
import com.greateme.constant.PackageContent;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.lang.annotation.ElementType;

@ -1,4 +1,4 @@
package com.greateme.contant.http;
package com.greateme.constant.http;
/**
* <p>
@ -27,4 +27,9 @@ public class ServiceNameConstant {
* service-verification-code
*/
public static final String SERVICE_VERIFICATION_CODE = "service-verification-code";
/**
* service-passenger-user
*/
public static final String SERVICE_PASSENGER_USER = "service-passenger-user";
}

@ -1,6 +1,6 @@
package com.greateme.entity.respose;
import com.greateme.contant.http.HttpStatus;
import com.greateme.constant.http.HttpStatus;
import com.greateme.util.JsonUtil;
import java.io.Serializable;
@ -118,6 +118,10 @@ public class ResponseEntity<T> implements Serializable {
return new ResponseEntity<>(HttpStatus.ERROR.getCode(), message);
}
public static <T> ResponseEntity<T> error(T data, String message) {
return new ResponseEntity<>(HttpStatus.ERROR.getCode(), data, message);
}
public int getCode() {
return code;
}

@ -0,0 +1,58 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.greateme</groupId>
<artifactId>feign-client</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<description>乘客用户模块的远程调用</description>
<artifactId>passenger-user-client</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- util 工具模块 -->
<dependencies>
<!-- 远程调用 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- 负载均衡器 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<!-- util 工具模块 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>common-util</artifactId>
<scope>provided</scope>
</dependency>
<!-- 公共常量类模块 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>common-constant</artifactId>
<scope>provided</scope>
</dependency>
<!-- 验证码模块的远程调用 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>verification-code-client</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,66 @@
package com.greateme.passenger.entity.dto;
import com.greateme.passenger.entity.PassengerUser;
import com.greateme.util.JsonUtil;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:41:40
* @file PassengerLoginOrRegisterDTO.java
*/
public class PassengerLoginOrRegisterDTO implements Serializable {
/**
*
*/
private PassengerUser passengerUser;
/**
*
*/
private Integer verificationCheckResult;
/**
*
*/
private Boolean success;
public PassengerUser getPassengerUser() {
return passengerUser;
}
public PassengerLoginOrRegisterDTO setPassengerUser(PassengerUser passengerUser) {
this.passengerUser = passengerUser;
return this;
}
public Integer getVerificationCheckResult() {
return verificationCheckResult;
}
public PassengerLoginOrRegisterDTO setVerificationCheckResult(Integer verificationCheckResult) {
this.verificationCheckResult = verificationCheckResult;
return this;
}
public Boolean getSuccess() {
return success;
}
public PassengerLoginOrRegisterDTO setSuccess(Boolean success) {
this.success = success;
return this;
}
@Override
public String toString() {
return JsonUtil.toJson(this);
}
}

@ -0,0 +1,33 @@
package com.greateme.passenger.feign;
import com.greateme.constant.http.ServiceNameConstant;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.passenger.entity.dto.PassengerLoginOrRegisterDTO;
import com.greateme.passenger.feign.fallback.PassengerUserFallback;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:13:36
* @file PassengerUserRemote.java
*/
@FeignClient(contextId = "passengerUserRemote", value = ServiceNameConstant.SERVICE_PASSENGER_USER, path = "/passengerUser", fallback = PassengerUserFallback.class)
public interface PassengerUserRemote {
/**
*
*
* @param passengerVerificationCode
* @return
*/
@PostMapping("/loginOrRegister")
ResponseEntity<PassengerLoginOrRegisterDTO> loginOrRegister(@RequestBody PassengerVerificationCodeVO passengerVerificationCode);
}

@ -0,0 +1,47 @@
package com.greateme.passenger.feign.fallback;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.passenger.entity.dto.PassengerLoginOrRegisterDTO;
import com.greateme.passenger.feign.PassengerUserRemote;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:15:53
* @file PassengerUserFallback.java
*/
@Component
public class PassengerUserFallback implements FallbackFactory<PassengerUserRemote> {
/**
*
*/
private static final Logger log = LoggerFactory.getLogger(PassengerUserFallback.class);
@Override
public PassengerUserRemote create(Throwable cause) {
return new PassengerUserRemote() {
/**
*
*
* @param passengerVerificationCode
* @return
*/
@Override
public ResponseEntity<PassengerLoginOrRegisterDTO> loginOrRegister(PassengerVerificationCodeVO passengerVerificationCode) {
log.error("调用远程登陆或注册接口时候发生错误", cause);
return ResponseEntity.error(cause.getMessage());
}
};
}
}

@ -14,6 +14,7 @@
<packaging>pom</packaging>
<modules>
<module>verification-code-client</module>
<module>passenger-user-client</module>
</modules>
</project>

@ -0,0 +1,77 @@
package com.greateme.verification.entity.vo;
import com.greateme.util.JsonUtil;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:27:47
* @file CheckPhoneVerificationCodeVO.java
*/
public class CheckPhoneVerificationCodeVO implements Serializable {
/**
*
*/
public CheckPhoneVerificationCodeVO() {
}
/**
*
*
* @param checkResult com.greateme.constant.business.VerificationCodeConstant
*/
public CheckPhoneVerificationCodeVO(Integer checkResult) {
this.checkResult = checkResult;
}
/**
*
*
* @param checkResult com.greateme.constant.business.VerificationCodeConstant
* @param phone
*/
public CheckPhoneVerificationCodeVO(Integer checkResult, String phone) {
this.checkResult = checkResult;
this.phone = phone;
}
/**
* com.greateme.constant.business.VerificationCodeConstant
*/
private Integer checkResult;
/**
*
*/
private String phone;
public Integer getCheckResult() {
return checkResult;
}
public CheckPhoneVerificationCodeVO setCheckResult(Integer checkResult) {
this.checkResult = checkResult;
return this;
}
public String getPhone() {
return phone;
}
public CheckPhoneVerificationCodeVO setPhone(String phone) {
this.phone = phone;
return this;
}
@Override
public String toString() {
return JsonUtil.toJson(this);
}
}

@ -1,8 +1,9 @@
package com.greateme.verification.feign;
import com.greateme.contant.http.ServiceNameConstant;
import com.greateme.constant.http.ServiceNameConstant;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import com.greateme.verification.feign.fallback.VerificationCodeFallback;
import org.springframework.cloud.openfeign.FeignClient;
@ -20,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @date 2023-05-31 14:32:59
* @file VerificationCodeRemote.java
*/
@FeignClient(contextId = "verificationCodeRemote", value = ServiceNameConstant.SERVICE_VERIFICATION_CODE, fallback = VerificationCodeFallback.class)
@FeignClient(contextId = "verificationCodeRemote", value = ServiceNameConstant.SERVICE_VERIFICATION_CODE, path = "/verificationCode", fallback = VerificationCodeFallback.class)
public interface VerificationCodeRemote {
/**
@ -30,7 +31,7 @@ public interface VerificationCodeRemote {
* @param length
* @return
*/
@PostMapping("/verificationCode/passengerPhone/{length}")
@PostMapping("/passengerPhone/{length}")
ResponseEntity<PassengerVerificationCodeVO> passengerPhone(@RequestBody PassengerVerificationCodeDTO verificationCode, @PathVariable("length") int length);
/**
@ -39,6 +40,6 @@ public interface VerificationCodeRemote {
* @param passengerVerificationCode
* @return bool
*/
@PostMapping("/verificationCode/checkVerificationCode")
ResponseEntity<Integer> checkPhoneVerificationCode(@RequestBody PassengerVerificationCodeVO passengerVerificationCode);
@PostMapping("/checkVerificationCode")
ResponseEntity<CheckPhoneVerificationCodeVO> checkPhoneVerificationCode(@RequestBody PassengerVerificationCodeVO passengerVerificationCode);
}

@ -2,6 +2,7 @@ package com.greateme.verification.feign.fallback;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import com.greateme.verification.feign.VerificationCodeRemote;
import org.slf4j.Logger;
@ -51,9 +52,9 @@ public class VerificationCodeFallback implements FallbackFactory<VerificationCod
* @return bool
*/
@Override
public ResponseEntity<Integer> checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode) {
public ResponseEntity<CheckPhoneVerificationCodeVO> checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode) {
log.error("跳用远程验证验证码是否正确的接口发生错误验证码的token{},验证码:{}", passengerVerificationCode.getVerificationToken(), passengerVerificationCode.getVerificationCode());
return ResponseEntity.error();
return ResponseEntity.error(cause.getMessage());
}
};
}

@ -93,6 +93,13 @@
<version>${online-taxi-public.version}</version>
</dependency>
<!-- 乘客用户模块的远程调用 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>passenger-user-client</artifactId>
<version>${online-taxi-public.version}</version>
</dependency>
<!-- 验证码模块的远程调用 -->
<dependency>
<groupId>com.greateme</groupId>

@ -67,12 +67,24 @@
<artifactId>verification-code-client</artifactId>
</dependency>
<!-- 乘客用户模块的远程调用 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>passenger-user-client</artifactId>
</dependency>
<!-- 公共的注解模块 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>common-annotation</artifactId>
</dependency>
<!-- 公共常量类模块 -->
<dependency>
<groupId>com.greateme</groupId>
<artifactId>common-constant</artifactId>
</dependency>
<!-- 公共的web模块 -->
<dependency>
<groupId>com.greateme</groupId>

@ -1,5 +1,6 @@
package com.greateme.user;
package com.greateme.passenger;
import com.greateme.springboot.EnableTaxiFeignClients;
import com.greateme.springboot.TaxiSpringBootApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@ -14,6 +15,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
* @date 2023-07-06 13:46:52
* @file PassengerUserApplication.java
*/
@EnableTaxiFeignClients
@EnableDiscoveryClient
@TaxiSpringBootApplication
public class PassengerUserApplication {

@ -0,0 +1,67 @@
package com.greateme.passenger.controller;
import com.greateme.constant.business.VerificationCodeConstant;
import com.greateme.constant.http.HttpStatus;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.passenger.entity.PassengerUser;
import com.greateme.passenger.entity.dto.PassengerLoginOrRegisterDTO;
import com.greateme.passenger.service.PassengerUserService;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import com.greateme.verification.feign.VerificationCodeRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:08:18
* @file PassengerUserController.java
*/
@RestController
@RequestMapping("/passengerUser")
public class PassengerUserController {
@Autowired
private VerificationCodeRemote verificationCodeRemote;
@Autowired
private PassengerUserService passengerUserService;
/**
*
*
* @param passengerVerificationCode
* @return
*/
@PostMapping("/loginOrRegister")
public ResponseEntity<PassengerLoginOrRegisterDTO> loginOrRegister(@RequestBody PassengerVerificationCodeVO passengerVerificationCode) {
// 检查用户手机验证码
ResponseEntity<CheckPhoneVerificationCodeVO> checkResult = verificationCodeRemote.checkPhoneVerificationCode(passengerVerificationCode);
// 获取检查对象结果
CheckPhoneVerificationCodeVO checkPhoneVerificationCode = checkResult.getData();
// 判断验证码是否正确
if (HttpStatus.SUCCESS.getCode() == checkResult.getCode() || null != checkPhoneVerificationCode) {
// 获取检查对象结果
switch (checkPhoneVerificationCode.getCheckResult()) {
case 0: // 检查验证码成功
PassengerUser passengerUser = this.passengerUserService.selectPassengerUserByPassengerPhoneOrRegisterAPassengerUser(checkPhoneVerificationCode.getPhone());
return ResponseEntity.success(new PassengerLoginOrRegisterDTO().setPassengerUser(passengerUser).setSuccess(true).setVerificationCheckResult(checkPhoneVerificationCode.getCheckResult()));
case 1: // 验证码已过期
return ResponseEntity.error(new PassengerLoginOrRegisterDTO().setSuccess(false), "验证码已过期");
case 2: // 验证码错误
return ResponseEntity.error(new PassengerLoginOrRegisterDTO().setSuccess(false), "验证码错误");
}
return null;
} else {
return ResponseEntity.error(new PassengerLoginOrRegisterDTO().setSuccess(false), "检查验证码时发生错误");
}
}
}

@ -1,6 +1,6 @@
package com.greateme.user.mapper;
package com.greateme.passenger.mapper;
import com.greateme.user.entity.PassengerUser;
import com.greateme.passenger.entity.PassengerUser;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -41,4 +41,12 @@ public interface PassengerUserMapper {
* @return
*/
PassengerUser selectPassengerUserByPassengerPhone(String passengerPhone);
/**
*
*
* @param passengerUser
* @return
*/
int insertPassengerUser(PassengerUser passengerUser);
}

@ -0,0 +1,24 @@
package com.greateme.passenger.service;
import com.greateme.passenger.entity.PassengerUser;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:24:00
* @file PassengerUserService.java
*/
public interface PassengerUserService {
/**
*
*
* @param passengerPhone
* @return
*/
PassengerUser selectPassengerUserByPassengerPhoneOrRegisterAPassengerUser(String passengerPhone);
}

@ -0,0 +1,42 @@
package com.greateme.passenger.service.impl;
import com.greateme.passenger.entity.PassengerUser;
import com.greateme.passenger.mapper.PassengerUserMapper;
import com.greateme.passenger.service.PassengerUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author XiaoHH
* @version 1.0.0
* @date 2023-07-06 16:50:40
* @file PassengerUserServiceImpl.java
*/
@Service
public class PassengerUserServiceImpl implements PassengerUserService {
@Autowired
private PassengerUserMapper passengerUserMapper;
/**
*
*
* @param passengerPhone
* @return
*/
@Override
public PassengerUser selectPassengerUserByPassengerPhoneOrRegisterAPassengerUser(String passengerPhone) {
// 先查询用户
PassengerUser passengerUser = this.passengerUserMapper.selectPassengerUserByPassengerPhone(passengerPhone);
// 如果有这个用户则直接返回
if (null != passengerUser) return passengerUser;
// 没有这个用户,先创建一个
passengerUser = new PassengerUser().setPassengerPhone(passengerPhone).setPassengerGender((byte) 0);
// 如果创建成功则返回新创建的用户否则返回null
return this.passengerUserMapper.insertPassengerUser(passengerUser) > 0 ? this.passengerUserMapper.selectPassengerUserById(passengerUser.getId()) : null;
}
}

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.greateme.user.mapper.PassengerUserMapper">
<mapper namespace="com.greateme.passenger.mapper.PassengerUserMapper">
<!-- 乘客用户表映射 -->
<resultMap id="passengerUserMap" type="PassengerUser">
@ -46,4 +46,25 @@
WHERE `is_delete` = 0 AND `passenger_phone` = #{passengerPhone}
LIMIT 1
</select>
<!-- 新增乘客用户 -->
<insert id="insertPassengerUser" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
INSERT INTO `passenger_user`
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="passengerPhone != null and passengerPhone != ''">`passenger_phone`,</if>
<if test="passengerName != null and passengerName != ''">`passenger_name`</if>
<if test="passengerGender != null">`passenger_gender`,</if>
<if test="state != null">`state`,</if>
<if test="gmtCreate != null">`gmt_create`,</if>
<if test="gmtModified != null">`gmt_modified`,</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="passengerPhone != null and passengerPhone != ''">#{passengerPhone},</if>
<if test="passengerName != null and passengerName != ''">#{passengerName},</if>
<if test="passengerGender != null">#{passengerGender},</if>
<if test="state != null">#{state},</if>
<if test="gmtCreate != null">#{gmtCreate},</if>
<if test="gmtModified != null">#{gmtModified}</if>
</trim>
</insert>
</mapper>

@ -2,6 +2,7 @@ package com.greateme.verification.controller;
import com.greateme.entity.respose.ResponseEntity;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import com.greateme.verification.service.VerificationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,7 +44,7 @@ public class VerificationCodeController {
* @return bool
*/
@PostMapping("/checkVerificationCode")
public ResponseEntity<Integer> checkPhoneVerificationCode(@RequestBody PassengerVerificationCodeVO passengerVerificationCode) {
public ResponseEntity<CheckPhoneVerificationCodeVO> checkPhoneVerificationCode(@RequestBody PassengerVerificationCodeVO passengerVerificationCode) {
return ResponseEntity.success(this.verificationCodeService.checkPhoneVerificationCode(passengerVerificationCode));
}
}

@ -1,6 +1,7 @@
package com.greateme.verification.service;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
/**
@ -30,5 +31,5 @@ public interface VerificationCodeService {
* @param passengerVerificationCode
* @return bool
*/
Integer checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode);
CheckPhoneVerificationCodeVO checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode);
}

@ -1,9 +1,10 @@
package com.greateme.verification.service.impl;
import com.greateme.contant.business.VerificationCodeConstant;
import com.greateme.constant.business.VerificationCodeConstant;
import com.greateme.util.StringUtil;
import com.greateme.verification.entity.dto.PassengerVerificationCodeDTO;
import com.greateme.verification.entity.dto.PassengerVerificationCodeRedisDTO;
import com.greateme.verification.entity.vo.CheckPhoneVerificationCodeVO;
import com.greateme.verification.entity.vo.PassengerVerificationCodeVO;
import com.greateme.verification.service.VerificationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -70,19 +71,19 @@ public class VerificationCodeServiceImpl implements VerificationCodeService {
* @return bool
*/
@Override
public Integer checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode) {
public CheckPhoneVerificationCodeVO checkPhoneVerificationCode(PassengerVerificationCodeVO passengerVerificationCode) {
// 获取短信验证码的token并在redis当中获取正确的短信验证码
String verificationToken = passengerVerificationCode.getVerificationToken();
PassengerVerificationCodeRedisDTO verificationCodeRedis = (PassengerVerificationCodeRedisDTO) this.redisTemplate.opsForValue().get(VerificationCodeConstant.PASSENGER_PHONE_VERIFICATION_CODE_PREFIX + verificationToken);
if (null == verificationCodeRedis) {
return VerificationCodeConstant.VERIFICATION_CODE_TIMEOUT;
return new CheckPhoneVerificationCodeVO(VerificationCodeConstant.VERIFICATION_CODE_TIMEOUT);
} else {
String verificationCode = verificationCodeRedis.getVerificationCode();
if (StringUtil.equal(verificationCode, passengerVerificationCode.getVerificationCode())) {
this.redisTemplate.delete(VerificationCodeConstant.PASSENGER_PHONE_VERIFICATION_CODE_PREFIX + verificationToken);
return VerificationCodeConstant.VERIFICATION_CODE_RIGHT;
return new CheckPhoneVerificationCodeVO(VerificationCodeConstant.VERIFICATION_CODE_RIGHT, verificationCodeRedis.getPassengerPhone());
} else {
return VerificationCodeConstant.VERIFICATION_CODE_WARING;
return new CheckPhoneVerificationCodeVO(VerificationCodeConstant.VERIFICATION_CODE_WARING, verificationCodeRedis.getPassengerPhone());
}
}
}

@ -0,0 +1,249 @@
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP DATABASE IF EXISTS `taxi_config`;
CREATE DATABASE `taxi_config` CHARSET `utf8mb4`;
USE `taxi_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `config_info` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
`md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'source user',
`src_ip` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
`app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
`c_desc` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`c_use` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`effect` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`type` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`c_schema` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_info';
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `config_info` WRITE;
/*!40000 ALTER TABLE `config_info` DISABLE KEYS */;
INSERT INTO `config_info` VALUES (1,'api-passenger-dev.yaml','DEFAULT_GROUP','server:\n port: 10000','9eab8b2a6a5622f242cdc1c0c4d77baf','2023-05-31 09:02:01','2023-05-31 09:02:01',NULL,'192.168.3.2','','taxi-dev',NULL,NULL,NULL,'yaml',NULL),(2,'service-verification-code-dev.yaml','DEFAULT_GROUP','spring:\n redis:\n host: 192.168.3.231\n port: 6379\n database: 0\n\n# 业务相关的配置\nbusiness:\n # 验证码\n verification-code:\n # 验证码的过期时间\n timeout-minute: 5\n','60799a623a75a3cb16836a41c627efd6','2023-05-31 09:05:15','2023-07-05 14:04:29','nacos','192.168.3.2','','taxi-dev','','','','yaml',''),(3,'service-passenger-user-dev.yaml','DEFAULT_GROUP','spring:\n # 数据库相关配置\n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://192.168.3.231:3306/service_passenger_user?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: xiaohhsuperme\n\n# mybatis 相关配置\nmybatis:\n mapper-locations: classpath:mapper/passenger/*Mapper.xml\n type-aliases-package: com.greateme.passenger.entity\n configuration:\n log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n','094e1ab8b03ea3bb6ffa50c0849804b5','2023-07-06 07:17:35','2023-07-06 10:02:49','nacos','192.168.3.2','','taxi-dev','','','','yaml','');
/*!40000 ALTER TABLE `config_info` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `config_info_aggr` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
`datum_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'datum_id',
`content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT '内容',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='增加租户字段';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `config_info_beta` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
`app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
`content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
`beta_ips` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'betaIps',
`md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'source user',
`src_ip` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_info_beta';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `config_info_tag` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
`tag_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_id',
`app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
`content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
`md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'source user',
`src_ip` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_info_tag';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `config_tags_relation` (
`id` bigint NOT NULL COMMENT 'id',
`tag_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_name',
`tag_type` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tag_type',
`data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
`nid` bigint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`nid`),
UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_tag_relation';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `group_capacity` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Group ID空字符表示整个集群',
`quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额0表示使用默认值',
`usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
`max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限单位为字节0表示使用默认值',
`max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数0表示使用默认值',
`max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限单位为字节0表示使用默认值',
`max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='集群、各Group容量信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `his_config_info` (
`id` bigint unsigned NOT NULL,
`nid` bigint unsigned NOT NULL AUTO_INCREMENT,
`data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
`content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
`md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
`src_ip` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`op_type` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`nid`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`),
KEY `idx_did` (`data_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='多租户改造';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permissions` (
`role` varchar(50) NOT NULL,
`resource` varchar(255) NOT NULL,
`action` varchar(8) NOT NULL,
UNIQUE KEY `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `roles` (
`username` varchar(50) NOT NULL,
`role` varchar(50) NOT NULL,
UNIQUE KEY `idx_user_role` (`username`,`role`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES ('nacos','ROLE_ADMIN');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tenant_capacity` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
`quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额0表示使用默认值',
`usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
`max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限单位为字节0表示使用默认值',
`max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
`max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限单位为字节0表示使用默认值',
`max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='租户容量信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tenant_info` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`kp` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'kp',
`tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
`tenant_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_name',
`tenant_desc` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tenant_desc',
`create_source` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'create_source',
`gmt_create` bigint NOT NULL COMMENT '创建时间',
`gmt_modified` bigint NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='tenant_info';
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `tenant_info` WRITE;
/*!40000 ALTER TABLE `tenant_info` DISABLE KEYS */;
INSERT INTO `tenant_info` VALUES (1,'1','taxi-dev','滴约打车开发环境','滴约打车开发环境','nacos',1685519148446,1685519148446);
/*!40000 ALTER TABLE `tenant_info` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`username` varchar(50) NOT NULL,
`password` varchar(500) NOT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES ('nacos','$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu',1);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Loading…
Cancel
Save