init
This commit is contained in:
commit
33187ec1bd
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>common</artifactId>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>common-log</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>model</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>common-util</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>service-system-client</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,39 @@
|
|||
package com.atguigu.daijia.common.annotation;
|
||||
|
||||
import com.atguigu.daijia.common.enums.BusinessType;
|
||||
import com.atguigu.daijia.common.enums.OperatorType;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 自定义操作日志记录注解
|
||||
*/
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Log {
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
public String title() default "";
|
||||
|
||||
/**
|
||||
* 功能
|
||||
*/
|
||||
public BusinessType businessType() default BusinessType.OTHER;
|
||||
|
||||
/**
|
||||
* 操作人类别
|
||||
*/
|
||||
public OperatorType operatorType() default OperatorType.MANAGE;
|
||||
|
||||
/**
|
||||
* 是否保存请求的参数
|
||||
*/
|
||||
public boolean isSaveRequestData() default true;
|
||||
|
||||
/**
|
||||
* 是否保存响应的参数
|
||||
*/
|
||||
public boolean isSaveResponseData() default true;
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
package com.atguigu.daijia.common.aspect;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.atguigu.daijia.common.annotation.Log;
|
||||
import com.atguigu.daijia.common.util.IpUtil;
|
||||
import com.atguigu.daijia.model.entity.system.SysOperLog;
|
||||
import com.atguigu.daijia.system.client.SysOperLogFeignClient;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志记录处理
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class LogAspect {
|
||||
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
|
||||
|
||||
//微服务切换为feign调用接口
|
||||
@Resource
|
||||
private SysOperLogFeignClient sysOperLogFeignClient;
|
||||
|
||||
/**
|
||||
* 处理完请求后执行
|
||||
*
|
||||
* @param joinPoint 切点
|
||||
*/
|
||||
@AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
|
||||
public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) {
|
||||
handleLog(joinPoint, controllerLog, null, jsonResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拦截异常操作
|
||||
*
|
||||
* @param joinPoint 切点
|
||||
* @param e 异常
|
||||
*/
|
||||
@AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
|
||||
public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) {
|
||||
handleLog(joinPoint, controllerLog, e, null);
|
||||
}
|
||||
|
||||
protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) {
|
||||
try {
|
||||
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
|
||||
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
|
||||
HttpServletRequest request = sra.getRequest();
|
||||
|
||||
// *========数据库日志=========*//
|
||||
SysOperLog operLog = new SysOperLog();
|
||||
operLog.setStatus(1);
|
||||
// 请求的地址
|
||||
String ip = IpUtil.getIpAddress(request);//IpUtil.getIpAddr(ServletUtils.getRequest());
|
||||
operLog.setOperIp(ip);
|
||||
operLog.setOperUrl(request.getRequestURI());
|
||||
|
||||
if (e != null) {
|
||||
operLog.setStatus(0);
|
||||
operLog.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 设置方法名称
|
||||
String className = joinPoint.getTarget().getClass().getName();
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
operLog.setMethod(className + "." + methodName + "()");
|
||||
// 设置请求方式
|
||||
operLog.setRequestMethod(request.getMethod());
|
||||
// 处理设置注解上的参数
|
||||
getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
|
||||
// 保存数据库
|
||||
sysOperLogFeignClient.saveSysLog(operLog);
|
||||
log.info("操作日志:"+JSON.toJSONString(operLog));
|
||||
} catch (Exception exp) {
|
||||
// 记录本地异常日志
|
||||
log.error("==前置通知异常==");
|
||||
log.error("异常信息:{}", exp.getMessage());
|
||||
exp.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取注解中对方法的描述信息 用于Controller层注解
|
||||
*
|
||||
* @param log 日志
|
||||
* @param operLog 操作日志
|
||||
* @throws Exception
|
||||
*/
|
||||
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception {
|
||||
// 设置action动作
|
||||
operLog.setBusinessType(log.businessType().name());
|
||||
// 设置标题
|
||||
operLog.setTitle(log.title());
|
||||
// 设置操作人类别
|
||||
operLog.setOperatorType(log.operatorType().name());
|
||||
// 是否需要保存request,参数和值
|
||||
if (log.isSaveRequestData()) {
|
||||
// 获取参数的信息,传入到数据库中。
|
||||
setRequestValue(joinPoint, operLog);
|
||||
}
|
||||
// 是否需要保存response,参数和值
|
||||
if (log.isSaveResponseData() && null != jsonResult) {
|
||||
operLog.setJsonResult(JSON.toJSONString(jsonResult));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求的参数,放到log中
|
||||
*
|
||||
* @param operLog 操作日志
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception {
|
||||
String requestMethod = operLog.getRequestMethod();
|
||||
if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
|
||||
String params = argsArrayToString(joinPoint.getArgs());
|
||||
operLog.setOperParam(params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数拼装
|
||||
*/
|
||||
private String argsArrayToString(Object[] paramsArray) {
|
||||
String params = "";
|
||||
if (paramsArray != null && paramsArray.length > 0) {
|
||||
for (Object o : paramsArray) {
|
||||
if (null != o && !isFilterObject(o)) {
|
||||
try {
|
||||
Object jsonObj = JSON.toJSON(o);
|
||||
params += jsonObj.toString() + " ";
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return params.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要过滤的对象。
|
||||
*
|
||||
* @param o 对象信息。
|
||||
* @return 如果是需要过滤的对象,则返回true;否则返回false。
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public boolean isFilterObject(final Object o) {
|
||||
Class<?> clazz = o.getClass();
|
||||
if (clazz.isArray()) {
|
||||
return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
|
||||
} else if (Collection.class.isAssignableFrom(clazz)) {
|
||||
Collection collection = (Collection) o;
|
||||
for (Object value : collection) {
|
||||
return value instanceof MultipartFile;
|
||||
}
|
||||
} else if (Map.class.isAssignableFrom(clazz)) {
|
||||
Map map = (Map) o;
|
||||
for (Object value : map.entrySet()) {
|
||||
Map.Entry entry = (Map.Entry) value;
|
||||
return entry.getValue() instanceof MultipartFile;
|
||||
}
|
||||
}
|
||||
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
|
||||
|| o instanceof BindingResult;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.atguigu.daijia.common.enums;
|
||||
|
||||
/**
|
||||
* 业务操作类型
|
||||
*/
|
||||
public enum BusinessType {
|
||||
/**
|
||||
* 其它
|
||||
*/
|
||||
OTHER,
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
INSERT,
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
UPDATE,
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
DELETE,
|
||||
|
||||
/**
|
||||
* 授权
|
||||
*/
|
||||
ASSGIN,
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
EXPORT,
|
||||
|
||||
/**
|
||||
* 导入
|
||||
*/
|
||||
IMPORT,
|
||||
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
STATUS,
|
||||
|
||||
/**
|
||||
* 清空数据
|
||||
*/
|
||||
CLEAN,
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.atguigu.daijia.common.enums;
|
||||
|
||||
/**
|
||||
* 操作人类别
|
||||
*/
|
||||
public enum OperatorType {
|
||||
/**
|
||||
* 其它
|
||||
*/
|
||||
OTHER,
|
||||
|
||||
/**
|
||||
* 后台用户
|
||||
*/
|
||||
MANAGE,
|
||||
|
||||
/**
|
||||
* 手机端用户
|
||||
*/
|
||||
MOBILE
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
<?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">
|
||||
<parent>
|
||||
<artifactId>common</artifactId>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>common-util</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,83 @@
|
|||
package com.atguigu.daijia.common.result;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 全局统一返回结果类
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> {
|
||||
|
||||
//返回码
|
||||
private Integer code;
|
||||
|
||||
//返回消息
|
||||
private String message;
|
||||
|
||||
//返回数据
|
||||
private T data;
|
||||
|
||||
public Result(){}
|
||||
|
||||
// 返回数据
|
||||
protected static <T> Result<T> build(T data) {
|
||||
Result<T> result = new Result<T>();
|
||||
if (data != null)
|
||||
result.setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> Result<T> build(T body, Integer code, String message) {
|
||||
Result<T> result = build(body);
|
||||
result.setCode(code);
|
||||
result.setMessage(message);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> Result<T> build(T body, ResultCodeEnum resultCodeEnum) {
|
||||
Result<T> result = build(body);
|
||||
result.setCode(resultCodeEnum.getCode());
|
||||
result.setMessage(resultCodeEnum.getMessage());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static<T> Result<T> ok(){
|
||||
return Result.ok(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作成功
|
||||
* @param data baseCategory1List
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static<T> Result<T> ok(T data){
|
||||
return build(data, ResultCodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
public static<T> Result<T> fail(){
|
||||
return Result.fail(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作失败
|
||||
* @param data
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static<T> Result<T> fail(T data){
|
||||
return build(data, ResultCodeEnum.FAIL);
|
||||
}
|
||||
|
||||
public Result<T> message(String msg){
|
||||
this.setMessage(msg);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> code(Integer code){
|
||||
this.setCode(code);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.atguigu.daijia.common.result;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 统一返回结果状态信息类
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
public enum ResultCodeEnum {
|
||||
|
||||
SUCCESS(200,"成功"),
|
||||
FAIL(201, "失败"),
|
||||
SERVICE_ERROR(2012, "服务异常"),
|
||||
DATA_ERROR(204, "数据异常"),
|
||||
ILLEGAL_REQUEST(205, "非法请求"),
|
||||
REPEAT_SUBMIT(206, "重复提交"),
|
||||
FEIGN_FAIL(207, "远程调用失败"),
|
||||
UPDATE_ERROR(204, "数据更新失败"),
|
||||
|
||||
ARGUMENT_VALID_ERROR(210, "参数校验异常"),
|
||||
SIGN_ERROR(300, "签名错误"),
|
||||
SIGN_OVERDUE(301, "签名已过期"),
|
||||
VALIDATECODE_ERROR(218 , "验证码错误"),
|
||||
|
||||
LOGIN_AUTH(208, "未登陆"),
|
||||
PERMISSION(209, "没有权限"),
|
||||
ACCOUNT_ERROR(214, "账号不正确"),
|
||||
PASSWORD_ERROR(215, "密码不正确"),
|
||||
PHONE_CODE_ERROR(215, "手机验证码不正确"),
|
||||
LOGIN_MOBLE_ERROR( 216, "账号不正确"),
|
||||
ACCOUNT_STOP( 216, "账号已停用"),
|
||||
NODE_ERROR( 217, "该节点下有子节点,不可以删除"),
|
||||
|
||||
COB_NEW_ORDER_FAIL( 217, "抢单失败"),
|
||||
MAP_FAIL( 217, "地图服务调用失败"),
|
||||
PROFITSHARING_FAIL( 217, "分账调用失败"),
|
||||
NO_START_SERVICE( 217, "未开启代驾服务,不能更新位置信息"),
|
||||
DRIVER_START_LOCATION_DISTION_ERROR( 217, "距离代驾起始点1公里以内才能确认"),
|
||||
DRIVER_END_LOCATION_DISTION_ERROR( 217, "距离代驾终点2公里以内才能确认"),
|
||||
IMAGE_AUDITION_FAIL( 217, "图片审核不通过"),
|
||||
AUTH_ERROR( 217, "认证通过后才可以开启代驾服务"),
|
||||
FACE_ERROR( 250, "当日未进行人脸识别"),
|
||||
|
||||
COUPON_EXPIRE( 250, "优惠券已过期"),
|
||||
COUPON_LESS( 250, "优惠券库存不足"),
|
||||
COUPON_USER_LIMIT( 250, "超出领取数量"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String message;
|
||||
|
||||
private ResultCodeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.daijia.common.util;
|
||||
|
||||
/**
|
||||
* 获取当前用户信息帮助类
|
||||
*/
|
||||
public class AuthContextHolder {
|
||||
|
||||
private static ThreadLocal<Long> userId = new ThreadLocal<Long>();
|
||||
|
||||
public static void setUserId(Long _userId) {
|
||||
userId.set(_userId);
|
||||
}
|
||||
|
||||
public static Long getUserId() {
|
||||
return userId.get();
|
||||
}
|
||||
|
||||
public static void removeUserId() {
|
||||
userId.remove();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package com.atguigu.daijia.common.util;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 获取ip地址
|
||||
*/
|
||||
public class IpUtil {
|
||||
|
||||
public static String getIpAddress(HttpServletRequest request) {
|
||||
String ipAddress = null;
|
||||
try {
|
||||
ipAddress = request.getHeader("x-forwarded-for");
|
||||
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
|
||||
ipAddress = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
|
||||
ipAddress = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
|
||||
ipAddress = request.getRemoteAddr();
|
||||
if (ipAddress.equals("127.0.0.1")) {
|
||||
// 根据网卡取本机配置的IP
|
||||
InetAddress inet = null;
|
||||
try {
|
||||
inet = InetAddress.getLocalHost();
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ipAddress = inet.getHostAddress();
|
||||
}
|
||||
}
|
||||
// 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
|
||||
if (ipAddress != null && ipAddress.length() > 15) { // "***.***.***.***".length()
|
||||
// = 15
|
||||
if (ipAddress.indexOf(",") > 0) {
|
||||
ipAddress = ipAddress.substring(0, ipAddress.indexOf(","));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ipAddress="";
|
||||
}
|
||||
// ipAddress = this.getRequest().getRemoteAddr();
|
||||
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public static String getGatwayIpAddress(ServerHttpRequest request) {
|
||||
HttpHeaders headers = request.getHeaders();
|
||||
String ip = headers.getFirst("x-forwarded-for");
|
||||
if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) {
|
||||
// 多次反向代理后会有多个ip值,第一个ip才是真实ip
|
||||
if (ip.indexOf(",") != -1) {
|
||||
ip = ip.split(",")[0];
|
||||
}
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = headers.getFirst("Proxy-Client-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = headers.getFirst("WL-Proxy-Client-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = headers.getFirst("HTTP_CLIENT_IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = headers.getFirst("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = headers.getFirst("X-Real-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getRemoteAddress().getAddress().getHostAddress();
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.atguigu.daijia.common.util;
|
||||
|
||||
public class LocationUtil {
|
||||
|
||||
// 地球赤道半径
|
||||
private static double EARTH_RADIUS = 6378.137;
|
||||
|
||||
//等同——Math.toRadians()
|
||||
private static double rad(double d) {
|
||||
return d * Math.PI / 180.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @描述 经纬度获取距离,单位为米
|
||||
* @参数 [lat1, lng1, lat2, lng2]
|
||||
* @返回值 double
|
||||
**/
|
||||
public static double getDistance(double lat1, double lng1, double lat2,
|
||||
double lng2) {
|
||||
double radLat1 = rad(lat1);
|
||||
double radLat2 = rad(lat2);
|
||||
double a = radLat1 - radLat2;
|
||||
double b = rad(lng1) - rad(lng2);
|
||||
double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2)
|
||||
+ Math.cos(radLat1) * Math.cos(radLat2)
|
||||
* Math.pow(Math.sin(b / 2), 2)));
|
||||
s = s * EARTH_RADIUS;
|
||||
s = Math.round(s * 10000d) / 10000d;
|
||||
s = s * 1000;
|
||||
return s;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
double distance = getDistance(30.57404, 104.073013,
|
||||
30.509376, 104.077001);
|
||||
System.out.println("距离" + distance + "米");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.atguigu.daijia.common.util;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
|
||||
public final class MD5 {
|
||||
|
||||
public static String encrypt(String strSrc) {
|
||||
try {
|
||||
char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
|
||||
'9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
byte[] bytes = strSrc.getBytes();
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(bytes);
|
||||
bytes = md.digest();
|
||||
int j = bytes.length;
|
||||
char[] chars = new char[j * 2];
|
||||
int k = 0;
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
byte b = bytes[i];
|
||||
chars[k++] = hexChars[b >>> 4 & 0xf];
|
||||
chars[k++] = hexChars[b & 0xf];
|
||||
}
|
||||
return new String(chars);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("MD5加密出错!!+" + e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(MD5.encrypt("111111"));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.atguigu.daijia.common.util;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class RequestUtils {
|
||||
|
||||
/**
|
||||
* 将通知参数转化为字符串
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static String readData(HttpServletRequest request) {
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
StringBuilder result = new StringBuilder();
|
||||
br = request.getReader();
|
||||
for (String line; (line = br.readLine()) != null; ) {
|
||||
if (result.length() > 0) {
|
||||
result.append("\n");
|
||||
}
|
||||
result.append(line);
|
||||
}
|
||||
return result.toString();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
if (br != null) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.atguigu.daijia.common.util;
|
||||
|
||||
import com.atguigu.daijia.common.result.Result;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ResponseUtil {
|
||||
|
||||
public static void out(HttpServletResponse response, Result r) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
try {
|
||||
mapper.writeValue(response.getWriter(), r);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?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">
|
||||
<parent>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>daijia-parent</artifactId><version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>common</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>service-util</module>
|
||||
<module>common-util</module>
|
||||
<module>rabbit-util</module>
|
||||
<module>spring-security</module>
|
||||
<module>common-log</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,46 @@
|
|||
<?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.atguigu.daijia</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>rabbit-util</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<name>rabbit-util</name>
|
||||
<description>rabbit-util</description>
|
||||
|
||||
<dependencies>
|
||||
<!--rabbitmq消息队列-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,23 @@
|
|||
package com.atguigu.daijia.common.constant;
|
||||
|
||||
public class MqConst {
|
||||
|
||||
|
||||
public static final String EXCHANGE_ORDER = "daijia.order";
|
||||
public static final String ROUTING_PAY_SUCCESS = "daijia.pay.success";
|
||||
public static final String ROUTING_PROFITSHARING_SUCCESS = "daijia.profitsharing.success";
|
||||
public static final String QUEUE_PAY_SUCCESS = "daijia.pay.success";
|
||||
public static final String QUEUE_PROFITSHARING_SUCCESS = "daijia.profitsharing.success";
|
||||
|
||||
|
||||
//取消订单延迟消息
|
||||
public static final String EXCHANGE_CANCEL_ORDER = "daijia.cancel.order";
|
||||
public static final String ROUTING_CANCEL_ORDER = "daijia.cancel.order";
|
||||
public static final String QUEUE_CANCEL_ORDER = "daijia.cancel.order";
|
||||
|
||||
//分账延迟消息
|
||||
public static final String EXCHANGE_PROFITSHARING = "daijia.profitsharing";
|
||||
public static final String ROUTING_PROFITSHARING = "daijia.profitsharing";
|
||||
public static final String QUEUE_PROFITSHARING = "daijia.profitsharing";
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.atguigu.daijia.common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||
|
||||
@Data
|
||||
public class GuiguCorrelationData extends CorrelationData {
|
||||
|
||||
//消息体
|
||||
private Object message;
|
||||
//交换机
|
||||
private String exchange;
|
||||
//路由键
|
||||
private String routingKey;
|
||||
//重试次数
|
||||
private int retryCount = 0;
|
||||
//是否延迟消息
|
||||
private boolean isDelay = false;
|
||||
//延迟时长
|
||||
private int delayTime = 10;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.atguigu.daijia.common.service;
|
||||
|
||||
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class RabbitService {
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
//发送消息
|
||||
public boolean sendMessage(String exchange,
|
||||
String routingkey,
|
||||
Object message) {
|
||||
rabbitTemplate.convertAndSend(exchange,routingkey,message);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
<?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">
|
||||
<parent>
|
||||
<artifactId>common</artifactId>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>service-util</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>common-util</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>model</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--mysql-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- 校验参数 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 服务调用feign -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,44 @@
|
|||
package com.atguigu.daijia.common.config.knife4j;
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class Knife4jConfig {
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi webApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("web-api")
|
||||
.pathsToMatch("/**")
|
||||
.build();
|
||||
}
|
||||
|
||||
// @Bean
|
||||
// public GroupedOpenApi adminApi() {
|
||||
// return GroupedOpenApi.builder()
|
||||
// .group("admin-api")
|
||||
// .pathsToMatch("/admin/**")
|
||||
// .build();
|
||||
// }
|
||||
|
||||
/***
|
||||
* @description 自定义接口信息
|
||||
*/
|
||||
@Bean
|
||||
public OpenAPI customOpenAPI() {
|
||||
|
||||
return new OpenAPI()
|
||||
.info(new Info()
|
||||
.title("代驾API接口文档")
|
||||
.version("1.0")
|
||||
.description("代驾API接口文档")
|
||||
.contact(new Contact().name("qy")));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.atguigu.daijia.common.config.mybatisPlus;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* MybatisPlus配置类
|
||||
*
|
||||
*/
|
||||
@EnableTransactionManagement
|
||||
@Configuration
|
||||
@MapperScan("com.atguigu.daijia.*.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor optimisticLockerInnerInterceptor(){
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
//向Mybatis过滤器链中添加分页拦截器
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package com.atguigu.daijia.common.config.redis;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.interceptor.KeyGenerator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* Redis配置类
|
||||
*
|
||||
*/
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
public class RedisConfig {
|
||||
|
||||
// 使用默认标签做缓存
|
||||
@Bean
|
||||
public KeyGenerator keyGenerator() {
|
||||
return new KeyGenerator() {
|
||||
@Override
|
||||
public Object generate(Object target, Method method, Object... params) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(target.getClass().getName());
|
||||
sb.append(method.getName());
|
||||
for (Object obj : params) {
|
||||
sb.append(obj.toString());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(redisConnectionFactory);
|
||||
|
||||
//String的序列化方式
|
||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
||||
// 使用GenericJackson2JsonRedisSerializer 替换默认序列化(默认采用的是JDK序列化)
|
||||
GenericJackson2JsonRedisSerializer genericJackson2JsonRedisSerializer = new GenericJackson2JsonRedisSerializer();
|
||||
|
||||
//序列号key value
|
||||
redisTemplate.setKeySerializer(stringRedisSerializer);
|
||||
redisTemplate.setValueSerializer(genericJackson2JsonRedisSerializer);
|
||||
redisTemplate.setHashKeySerializer(stringRedisSerializer);
|
||||
redisTemplate.setHashValueSerializer(genericJackson2JsonRedisSerializer);
|
||||
|
||||
redisTemplate.afterPropertiesSet();
|
||||
return redisTemplate;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CacheManager cacheManager(RedisConnectionFactory factory) {
|
||||
RedisSerializer<String> redisSerializer = new StringRedisSerializer();
|
||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
|
||||
|
||||
//解决查询缓存转换异常的问题
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
||||
jackson2JsonRedisSerializer.setObjectMapper(om);
|
||||
|
||||
// 配置序列化(解决乱码的问题),过期时间600秒
|
||||
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
|
||||
.entryTtl(Duration.ofSeconds(600000))
|
||||
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer))
|
||||
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer))
|
||||
.disableCachingNullValues();
|
||||
|
||||
RedisCacheManager cacheManager = RedisCacheManager.builder(factory)
|
||||
.cacheDefaults(config)
|
||||
.build();
|
||||
return cacheManager;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.atguigu.daijia.common.config.redisson;
|
||||
|
||||
import lombok.Data;
|
||||
import org.redisson.Redisson;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.redisson.config.Config;
|
||||
import org.redisson.config.SingleServerConfig;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "spring.data.redis")
|
||||
public class RedissonConfig {
|
||||
|
||||
private String host;
|
||||
|
||||
private String password;
|
||||
|
||||
private String port;
|
||||
|
||||
private int timeout = 3000;
|
||||
private static String ADDRESS_PREFIX = "redis://";
|
||||
|
||||
/**
|
||||
* 自动装配
|
||||
*
|
||||
*/
|
||||
@Bean
|
||||
RedissonClient redissonSingle() {
|
||||
Config config = new Config();
|
||||
|
||||
if(!StringUtils.hasText(host)){
|
||||
throw new RuntimeException("host is empty");
|
||||
}
|
||||
SingleServerConfig serverConfig = config.useSingleServer()
|
||||
.setAddress(ADDRESS_PREFIX + this.host + ":" + port)
|
||||
.setTimeout(this.timeout);
|
||||
if(StringUtils.hasText(this.password)) {
|
||||
serverConfig.setPassword(this.password);
|
||||
}
|
||||
return Redisson.create(config);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.atguigu.daijia.common.constant;
|
||||
|
||||
public class RedisConstant {
|
||||
|
||||
//用户登录
|
||||
public static final String USER_LOGIN_KEY_PREFIX = "user:login:";
|
||||
public static final String USER_LOGIN_REFRESH_KEY_PREFIX = "user:login:refresh:";
|
||||
public static final int USER_LOGIN_KEY_TIMEOUT = 60 * 60 * 24 * 100;
|
||||
public static final int USER_LOGIN_REFRESH_KEY_TIMEOUT = 60 * 60 * 24 * 365;
|
||||
|
||||
//司机GEO地址
|
||||
public static final String DRIVER_GEO_LOCATION = "driver:geo:location";
|
||||
//司机接单临时容器
|
||||
public static final String DRIVER_ORDER_TEMP_LIST = "driver:order:temp:list:";
|
||||
public static final long DRIVER_ORDER_TEMP_LIST_EXPIRES_TIME = 1;
|
||||
//司机订单去重容器
|
||||
public static final String DRIVER_ORDER_REPEAT_LIST = "driver:order:repeat:list:";
|
||||
public static final long DRIVER_ORDER_REPEAT_LIST_EXPIRES_TIME = 16;
|
||||
|
||||
// //订单与任务关联
|
||||
// public static final String ORDER_JOB = "order:job:";
|
||||
// public static final long ORDER_JOB_EXPIRES_TIME = 15;
|
||||
|
||||
//更新订单位置
|
||||
public static final String UPDATE_ORDER_LOCATION = "update:order:location:";
|
||||
public static final long UPDATE_ORDER_LOCATION_EXPIRES_TIME = 15;
|
||||
|
||||
//订单接单标识
|
||||
public static final String ORDER_ACCEPT_MARK = "order:accept:mark:";
|
||||
public static final long ORDER_ACCEPT_MARK_EXPIRES_TIME = 15;
|
||||
|
||||
//抢新订单锁
|
||||
public static final String ROB_NEW_ORDER_LOCK = "rob:new:order:lock";
|
||||
//等待获取锁的时间
|
||||
public static final long ROB_NEW_ORDER_LOCK_WAIT_TIME = 1;
|
||||
//加锁的时间
|
||||
public static final long ROB_NEW_ORDER_LOCK_LEASE_TIME = 1;
|
||||
|
||||
//优惠券信息
|
||||
public static final String COUPON_INFO = "coupon:info:";
|
||||
|
||||
//优惠券分布式锁
|
||||
public static final String COUPON_LOCK = "coupon:lock:";
|
||||
//等待获取锁的时间
|
||||
public static final long COUPON_LOCK_WAIT_TIME = 1;
|
||||
//加锁的时间
|
||||
public static final long COUPON_LOCK_LEASE_TIME = 1;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.atguigu.daijia.common.constant;
|
||||
|
||||
public class SystemConstant {
|
||||
|
||||
//附近司机搜索半径
|
||||
public static final double NEARBY_DRIVER_RADIUS = 5;
|
||||
|
||||
//取消订单延迟时间,单位:秒
|
||||
public static final int CANCEL_ORDER_DELAY_TIME = 15*60;
|
||||
|
||||
//默认接单距离,单位:公里
|
||||
public static final int ACCEPT_DISTANCE = 5;
|
||||
|
||||
//司机的位置与代驾起始点位置的确认距离,单位:米
|
||||
public static final int DRIVER_START_LOCATION_DISTION = 1000;
|
||||
|
||||
//司机的位置与代驾终点位置的确认距离,单位:米
|
||||
public static final int DRIVER_END_LOCATION_DISTION = 2000;
|
||||
|
||||
//分账延迟时间,单位:秒
|
||||
public static final int PROFITSHARING_DELAY_TIME = 2*60;
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.atguigu.daijia.common.execption;
|
||||
|
||||
import com.atguigu.daijia.common.result.ResultCodeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自定义全局异常类
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class GuiguException extends RuntimeException {
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 通过状态码和错误消息创建异常对象
|
||||
* @param code
|
||||
* @param message
|
||||
*/
|
||||
public GuiguException(Integer code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收枚举类型对象
|
||||
* @param resultCodeEnum
|
||||
*/
|
||||
public GuiguException(ResultCodeEnum resultCodeEnum) {
|
||||
super(resultCodeEnum.getMessage());
|
||||
this.code = resultCodeEnum.getCode();
|
||||
this.message = resultCodeEnum.getMessage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GuliException{" +
|
||||
"code=" + code +
|
||||
", message=" + this.getMessage() +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package com.atguigu.daijia.common.handler;
|
||||
|
||||
import com.atguigu.daijia.common.execption.GuiguException;
|
||||
import com.atguigu.daijia.common.result.Result;
|
||||
import com.atguigu.daijia.common.result.ResultCodeEnum;
|
||||
import feign.codec.DecodeException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.FieldError;
|
||||
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 java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 全局异常处理类
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseBody
|
||||
public Result error(Exception e){
|
||||
e.printStackTrace();
|
||||
return Result.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义异常处理方法
|
||||
* @param e
|
||||
* @return
|
||||
*/
|
||||
@ExceptionHandler(GuiguException.class)
|
||||
@ResponseBody
|
||||
public Result error(GuiguException e){
|
||||
e.printStackTrace();
|
||||
return Result.build(null,e.getCode(), e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(DecodeException.class)
|
||||
@ResponseBody
|
||||
public Result error(DecodeException e){
|
||||
e.printStackTrace();
|
||||
return Result.build(null,e.status(), e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler({IllegalArgumentException.class})
|
||||
@ResponseBody
|
||||
public Result llegalArgumentException(Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("触发异常拦截: " + e.getMessage(), e);
|
||||
return Result.build(null, ResultCodeEnum.ARGUMENT_VALID_ERROR);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * spring security异常
|
||||
// * @param e
|
||||
// * @return
|
||||
// */
|
||||
// @ExceptionHandler(AccessDeniedException.class)
|
||||
// @ResponseBody
|
||||
// public Result error(AccessDeniedException e) throws AccessDeniedException {
|
||||
// return Result.build(null, ResultCodeEnum.PERMISSION);
|
||||
// }
|
||||
|
||||
@ExceptionHandler(value = BindException.class)
|
||||
@ResponseBody
|
||||
public Result error(BindException exception) {
|
||||
BindingResult result = exception.getBindingResult();
|
||||
Map<String, Object> errorMap = new HashMap<>();
|
||||
List<FieldError> fieldErrors = result.getFieldErrors();
|
||||
fieldErrors.forEach(error -> {
|
||||
log.error("field: " + error.getField() + ", msg:" + error.getDefaultMessage());
|
||||
errorMap.put(error.getField(), error.getDefaultMessage());
|
||||
});
|
||||
return Result.build(errorMap, ResultCodeEnum.ARGUMENT_VALID_ERROR);
|
||||
}
|
||||
|
||||
@ExceptionHandler(value = MethodArgumentNotValidException.class)
|
||||
@ResponseBody
|
||||
public Result error(MethodArgumentNotValidException exception) {
|
||||
BindingResult result = exception.getBindingResult();
|
||||
Map<String, Object> errorMap = new HashMap<>();
|
||||
List<FieldError> fieldErrors = result.getFieldErrors();
|
||||
fieldErrors.forEach(error -> {
|
||||
log.error("field: " + error.getField() + ", msg:" + error.getDefaultMessage());
|
||||
errorMap.put(error.getField(), error.getDefaultMessage());
|
||||
});
|
||||
return Result.build(errorMap, ResultCodeEnum.ARGUMENT_VALID_ERROR);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.atguigu.daijia.common.login;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//登录判断
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface GuiguLogin {
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.atguigu.daijia.common.login;
|
||||
|
||||
import com.atguigu.daijia.common.constant.RedisConstant;
|
||||
import com.atguigu.daijia.common.execption.GuiguException;
|
||||
import com.atguigu.daijia.common.result.ResultCodeEnum;
|
||||
import com.atguigu.daijia.common.util.AuthContextHolder;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@Component
|
||||
@Aspect //切面类
|
||||
public class GuiguLoginAspect {
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
//环绕通知,登录判断
|
||||
//切入点表达式:指定对哪些规则的方法进行增强
|
||||
@Around("execution(* com.atguigu.daijia.*.controller.*.*(..)) && @annotation(guiguLogin)")
|
||||
public Object login(ProceedingJoinPoint proceedingJoinPoint,GuiguLogin guiguLogin) throws Throwable {
|
||||
|
||||
//1 获取request对象
|
||||
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
||||
ServletRequestAttributes sra = (ServletRequestAttributes)attributes;
|
||||
HttpServletRequest request = sra.getRequest();
|
||||
|
||||
//2 从请求头获取token
|
||||
String token = request.getHeader("token");
|
||||
|
||||
//3 判断token是否为空,如果为空,返回登录提示
|
||||
if(!StringUtils.hasText(token)) {
|
||||
throw new GuiguException(ResultCodeEnum.LOGIN_AUTH);
|
||||
}
|
||||
|
||||
//4 token不为空,查询redis
|
||||
String customerId = (String)redisTemplate.opsForValue()
|
||||
.get(RedisConstant.USER_LOGIN_KEY_PREFIX+token);
|
||||
|
||||
//5 查询redis对应用户id,把用户id放到ThreadLocal里面
|
||||
if(StringUtils.hasText(customerId)) {
|
||||
AuthContextHolder.setUserId(Long.parseLong(customerId));
|
||||
}
|
||||
|
||||
//6 执行业务方法
|
||||
return proceedingJoinPoint.proceed();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<version>1.0</version>
|
||||
<artifactId>spring-security</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>common-util</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>service-system-client</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<!-- Spring Security依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>model</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,92 @@
|
|||
package com.atguigu.daijia.security.config;
|
||||
|
||||
import com.atguigu.daijia.security.custom.CustomMd5PasswordEncoder;
|
||||
import com.atguigu.daijia.security.fillter.TokenAuthenticationFilter;
|
||||
import com.atguigu.daijia.security.fillter.TokenLoginFilter;
|
||||
import com.atguigu.daijia.system.client.SysLoginLogFeignClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@EnableMethodSecurity(securedEnabled = true, jsr250Enabled = true)
|
||||
public class WebSecurityConfig {
|
||||
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
@Autowired
|
||||
private CustomMd5PasswordEncoder customMd5PasswordEncoder;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
@Autowired
|
||||
private SysLoginLogFeignClient sysLoginLogFeignClient;
|
||||
|
||||
@Autowired
|
||||
private AuthenticationConfiguration authenticationConfiguration;
|
||||
|
||||
@Bean
|
||||
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
|
||||
return authenticationConfiguration.getAuthenticationManager();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationProvider authenticationProvider() {
|
||||
// 创建一个用户认证提供者
|
||||
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
|
||||
// 设置用户相信信息,可以从数据库中读取、或者缓存、或者配置文件
|
||||
authProvider.setUserDetailsService(userDetailsService);
|
||||
// 设置加密机制,若想要尝试对用户进行身份验证,我们需要知道使用的是什么编码
|
||||
authProvider.setPasswordEncoder(customMd5PasswordEncoder);
|
||||
return authProvider;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
//禁用csrf(防止跨站请求伪造攻击)
|
||||
.csrf()
|
||||
.disable()
|
||||
// 设置白名单
|
||||
.authorizeHttpRequests()
|
||||
//swg相关
|
||||
.requestMatchers("/favicon.ico","/swagger-resources/**", "/webjars/**", "/v3/**", "/doc.html").permitAll()
|
||||
//用户登录相关接口
|
||||
.requestMatchers("/securityLogin/login").permitAll()
|
||||
// 对于其他任何请求,都保护起来
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
// 禁用缓存
|
||||
.sessionManagement()
|
||||
// 使用无状态session,即不使用session缓存数据
|
||||
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
// 添加身份验证
|
||||
.and()
|
||||
// TODO 添加身份验证1
|
||||
.authenticationProvider(authenticationProvider())
|
||||
// 添加token过滤器
|
||||
.addFilterBefore(new TokenAuthenticationFilter(redisTemplate), UsernamePasswordAuthenticationFilter.class)
|
||||
.addFilter(new TokenLoginFilter(authenticationManager(authenticationConfiguration), redisTemplate, sysLoginLogFeignClient))
|
||||
;
|
||||
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.daijia.security.custom;
|
||||
|
||||
import com.atguigu.daijia.common.result.Result;
|
||||
import com.atguigu.daijia.common.result.ResultCodeEnum;
|
||||
import com.atguigu.daijia.common.util.ResponseUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@Component
|
||||
public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
||||
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response,
|
||||
AuthenticationException authException) {
|
||||
|
||||
ResponseUtil.out(response, Result.build(null, ResultCodeEnum.ACCOUNT_ERROR));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.atguigu.daijia.security.custom;
|
||||
|
||||
import com.atguigu.daijia.common.util.MD5;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 密码处理
|
||||
* </p>
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class CustomMd5PasswordEncoder implements PasswordEncoder {
|
||||
|
||||
public String encode(CharSequence rawPassword) {
|
||||
return MD5.encrypt(rawPassword.toString());
|
||||
}
|
||||
|
||||
public boolean matches(CharSequence rawPassword, String encodedPassword) {
|
||||
return encodedPassword.equals(MD5.encrypt(rawPassword.toString()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.atguigu.daijia.security.custom;
|
||||
|
||||
import com.atguigu.daijia.model.entity.system.SysUser;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CustomUser extends User {
|
||||
|
||||
/**
|
||||
* 我们自己的用户实体对象,要调取用户信息时直接获取这个实体对象。(这里我就不写get/set方法了)
|
||||
*/
|
||||
private SysUser sysUser;
|
||||
|
||||
public CustomUser(SysUser sysUser) {
|
||||
super(sysUser.getUsername(), sysUser.getPassword(), new ArrayList<>());
|
||||
this.sysUser = sysUser;
|
||||
}
|
||||
|
||||
public SysUser getSysUser() {
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
public void setSysUser(SysUser sysUser) {
|
||||
this.sysUser = sysUser;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.atguigu.daijia.security.fillter;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.atguigu.daijia.common.result.Result;
|
||||
import com.atguigu.daijia.common.result.ResultCodeEnum;
|
||||
import com.atguigu.daijia.common.util.AuthContextHolder;
|
||||
import com.atguigu.daijia.common.util.ResponseUtil;
|
||||
import com.atguigu.daijia.model.entity.system.SysUser;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 身份验证过滤器
|
||||
* </p>
|
||||
*/
|
||||
public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
private String ADMIN_LOGIN_KEY_PREFIX = "admin:login:";
|
||||
private AntPathMatcher antPathMatcher = new AntPathMatcher();
|
||||
|
||||
|
||||
public TokenAuthenticationFilter(RedisTemplate redisTemplate) {
|
||||
this.redisTemplate = redisTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
//如果是登录接口或非admin大头的直接放行
|
||||
String uri = request.getRequestURI();
|
||||
if(antPathMatcher.match("/securityLogin/login", uri) ||
|
||||
antPathMatcher.match("/swagger-resources/**", uri) ||
|
||||
antPathMatcher.match("/webjars/**", uri) ||
|
||||
antPathMatcher.match("/v3/**", uri) ||
|
||||
antPathMatcher.match("/doc.html", uri) ||
|
||||
antPathMatcher.match("/favicon.ico", uri)) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
UsernamePasswordAuthenticationToken authentication = getAuthentication(request);
|
||||
if(null != authentication) {
|
||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||
chain.doFilter(request, response);
|
||||
} else {
|
||||
ResponseUtil.out(response, Result.build(null, ResultCodeEnum.PERMISSION));
|
||||
}
|
||||
}
|
||||
|
||||
private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) {
|
||||
// token置于header里
|
||||
String token = request.getHeader("token");
|
||||
logger.info("token:"+token);
|
||||
if (StringUtils.hasText(token)) {
|
||||
SysUser sysUser = (SysUser)redisTemplate.opsForValue().get(ADMIN_LOGIN_KEY_PREFIX+token);
|
||||
logger.info("sysUser:"+JSON.toJSONString(sysUser));
|
||||
if (null != sysUser) {
|
||||
AuthContextHolder.setUserId(sysUser.getId());
|
||||
|
||||
if (null != sysUser.getUserPermsList() && sysUser.getUserPermsList().size() > 0) {
|
||||
List<SimpleGrantedAuthority> authorities = sysUser.getUserPermsList().stream().filter(code -> StringUtils.hasText(code.trim())).map(code -> new SimpleGrantedAuthority(code.trim())).collect(Collectors.toList());
|
||||
return new UsernamePasswordAuthenticationToken(sysUser.getUsername(), null, authorities);
|
||||
} else {
|
||||
return new UsernamePasswordAuthenticationToken(sysUser.getUsername(), null, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
package com.atguigu.daijia.security.fillter;
|
||||
|
||||
|
||||
import com.atguigu.daijia.common.result.Result;
|
||||
import com.atguigu.daijia.common.result.ResultCodeEnum;
|
||||
import com.atguigu.daijia.common.util.IpUtil;
|
||||
import com.atguigu.daijia.common.util.ResponseUtil;
|
||||
import com.atguigu.daijia.model.entity.system.SysLoginLog;
|
||||
import com.atguigu.daijia.model.vo.system.LoginVo;
|
||||
import com.atguigu.daijia.security.custom.CustomUser;
|
||||
import com.atguigu.daijia.system.client.SysLoginLogFeignClient;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录过滤器,继承UsernamePasswordAuthenticationFilter,对用户名密码进行登录校验
|
||||
* </p>
|
||||
*
|
||||
*/
|
||||
public class TokenLoginFilter extends UsernamePasswordAuthenticationFilter {
|
||||
|
||||
private RedisTemplate redisTemplate;
|
||||
private SysLoginLogFeignClient sysLoginLogFeignClient;
|
||||
|
||||
private String ADMIN_LOGIN_KEY_PREFIX = "admin:login:";
|
||||
private int ADMIN_LOGIN_KEY_TIMEOUT = 60 * 60 * 24 * 100;
|
||||
|
||||
public TokenLoginFilter(AuthenticationManager authenticationManager, RedisTemplate redisTemplate, SysLoginLogFeignClient sysLoginLogFeignClient) {
|
||||
this.setAuthenticationManager(authenticationManager);
|
||||
this.setPostOnly(false);
|
||||
//指定登录接口及提交方式,可以指定任意路径
|
||||
this.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher("/securityLogin/login","POST"));
|
||||
this.redisTemplate = redisTemplate;
|
||||
this.sysLoginLogFeignClient = sysLoginLogFeignClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录认证
|
||||
* @param req
|
||||
* @param res
|
||||
* @return
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
@Override
|
||||
public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res)
|
||||
throws AuthenticationException {
|
||||
try {
|
||||
LoginVo loginVo = new ObjectMapper().readValue(req.getInputStream(), LoginVo.class);
|
||||
|
||||
Authentication authenticationToken = new UsernamePasswordAuthenticationToken(loginVo.getUsername(), loginVo.getPassword());
|
||||
return this.getAuthenticationManager().authenticate(authenticationToken);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录成功
|
||||
* @param request
|
||||
* @param response
|
||||
* @param chain
|
||||
* @param auth
|
||||
* @throws IOException
|
||||
* @throws ServletException
|
||||
*/
|
||||
@Override
|
||||
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain,
|
||||
Authentication auth) throws IOException, ServletException {
|
||||
CustomUser customUser = (CustomUser) auth.getPrincipal();
|
||||
String token = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
redisTemplate.opsForValue().set(ADMIN_LOGIN_KEY_PREFIX+token, customUser.getSysUser(), ADMIN_LOGIN_KEY_TIMEOUT, TimeUnit.SECONDS);
|
||||
|
||||
//保存权限数据
|
||||
//redisTemplate.boundHashOps("admin:auth").put(customUser.getUsername(), customUser.getAuthorities());
|
||||
|
||||
//记录日志
|
||||
SysLoginLog sysLoginLog = new SysLoginLog();
|
||||
sysLoginLog.setUsername(customUser.getUsername());
|
||||
sysLoginLog.setStatus(1);
|
||||
sysLoginLog.setIpaddr(IpUtil.getIpAddress(request));
|
||||
sysLoginLog.setMsg("登录成功");
|
||||
sysLoginLogFeignClient.recordLoginLog(sysLoginLog);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("token", token);
|
||||
ResponseUtil.out(response, Result.ok(map));
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录失败
|
||||
* @param request
|
||||
* @param response
|
||||
* @param e
|
||||
* @throws IOException
|
||||
* @throws ServletException
|
||||
*/
|
||||
@Override
|
||||
protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response,
|
||||
AuthenticationException e) throws IOException, ServletException {
|
||||
if(e.getCause() instanceof RuntimeException) {
|
||||
ResponseUtil.out(response, Result.build(null, 204, e.getMessage()));
|
||||
} else {
|
||||
ResponseUtil.out(response, Result.build(null, ResultCodeEnum.LOGIN_MOBLE_ERROR));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.atguigu.daijia.security.service;
|
||||
|
||||
import com.atguigu.daijia.model.entity.system.SysUser;
|
||||
import com.atguigu.daijia.security.custom.CustomUser;
|
||||
import com.atguigu.daijia.system.client.SecurityLoginFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
|
||||
@Autowired
|
||||
private SecurityLoginFeignClient securityLoginFeignClient;
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
SysUser sysUser = securityLoginFeignClient.getByUsername(username).getData();
|
||||
if(null == sysUser) {
|
||||
throw new UsernameNotFoundException("用户名不存在!");
|
||||
}
|
||||
|
||||
if(!"admin".equals(sysUser.getUsername()) && sysUser.getStatus().intValue() == 0) {
|
||||
throw new RuntimeException("账号已停用");
|
||||
}
|
||||
List<String> userPermsList = securityLoginFeignClient.findUserPermsList(sysUser.getId()).getData();
|
||||
sysUser.setUserPermsList(userPermsList);
|
||||
return new CustomUser(sysUser);
|
||||
}
|
||||
}
|
|
@ -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">
|
||||
<parent>
|
||||
<artifactId>daijia-parent</artifactId>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>model</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--lombok用来简化实体类-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.atguigu.daijia</groupId>
|
||||
<artifactId>common-util</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.github.xiaoymin</groupId>-->
|
||||
<!-- <artifactId>knife4j-spring-boot-starter</artifactId>-->
|
||||
<!-- <scope>provided </scope>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<!-- 校验参数 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
<scope>provided </scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
package com.atguigu.daijia.model.entity.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
|
||||
@JsonIgnore
|
||||
@TableField("update_time")
|
||||
private Date updateTime;
|
||||
|
||||
@JsonIgnore
|
||||
@TableLogic
|
||||
@TableField("is_deleted")
|
||||
private Integer isDeleted;
|
||||
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private Map<String,Object> param = new HashMap<>();
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.atguigu.daijia.model.entity.coupon;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "CouponInfo")
|
||||
@TableName("coupon_info")
|
||||
public class CouponInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "优惠卷类型 1 现金券 2 折扣")
|
||||
@TableField("coupon_type")
|
||||
private Integer couponType;
|
||||
|
||||
@Schema(description = "优惠卷名字")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "金额")
|
||||
@TableField("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "折扣:取值[1 到 10]")
|
||||
@TableField("discount")
|
||||
private BigDecimal discount;
|
||||
|
||||
@Schema(description = "使用门槛 0->没门槛")
|
||||
@TableField("condition_amount")
|
||||
private BigDecimal conditionAmount;
|
||||
|
||||
@Schema(description = "发行数量")
|
||||
@TableField("publish_count")
|
||||
private Integer publishCount;
|
||||
|
||||
@Schema(description = "每人限领张数")
|
||||
@TableField("per_limit")
|
||||
private Integer perLimit;
|
||||
|
||||
@Schema(description = "已使用数量")
|
||||
@TableField("use_count")
|
||||
private Integer useCount;
|
||||
|
||||
@Schema(description = "领取数量")
|
||||
@TableField("receive_count")
|
||||
private Integer receiveCount;
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
@TableField("expire_time")
|
||||
private Date expireTime;
|
||||
|
||||
@Schema(description = "优惠券描述")
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "状态[0-未发布,1-已发布, -1-已过期]")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.atguigu.daijia.model.entity.coupon;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "CustomerCoupon")
|
||||
@TableName("customer_coupon")
|
||||
public class CustomerCoupon extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "优惠券ID")
|
||||
@TableField("coupon_id")
|
||||
private Long couponId;
|
||||
|
||||
@Schema(description = "乘客ID")
|
||||
@TableField("customer_id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "购物券状态(1:未使用 2:已使用)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "领取时间")
|
||||
@TableField("receive_time")
|
||||
private Date receiveTime;
|
||||
|
||||
@Schema(description = "使用时间")
|
||||
@TableField("used_time")
|
||||
private Date usedTime;
|
||||
|
||||
@Schema(description = "订单id")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
@TableField("expire_time")
|
||||
private Date expireTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.daijia.model.entity.customer;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "CustomerCar")
|
||||
public class CustomerCar extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "车牌号")
|
||||
private String license;
|
||||
|
||||
@Schema(description = "车型")
|
||||
private String brand;
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.atguigu.daijia.model.entity.customer;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "CustomerInfo")
|
||||
public class CustomerInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "微信openId")
|
||||
private String wxOpenId;
|
||||
|
||||
@Schema(description = "客户昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "1有效,2禁用")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.atguigu.daijia.model.entity.customer;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "CustomerLoginLog")
|
||||
public class CustomerLoginLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "登录IP地址")
|
||||
private String ipaddr;
|
||||
|
||||
@Schema(description = "登录状态(0成功 1失败)")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "提示信息")
|
||||
private String msg;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.atguigu.daijia.model.entity.dispatch;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单任务关联表")
|
||||
@TableName("order_job")
|
||||
public class OrderJob extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "订单id")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "任务id")
|
||||
@TableField("job_id")
|
||||
private Long jobId;
|
||||
|
||||
@Schema(description = "参数")
|
||||
@TableField("parameter")
|
||||
private String parameter;
|
||||
|
||||
}
|
|
@ -0,0 +1,237 @@
|
|||
package com.atguigu.daijia.model.entity.dispatch;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* xxl-job info
|
||||
*
|
||||
* @author xuxueli 2016-1-12 18:25:49
|
||||
*/
|
||||
public class XxlJobInfo {
|
||||
|
||||
private int id; // 主键ID
|
||||
|
||||
private int jobGroup; // 执行器主键ID
|
||||
private String jobDesc;
|
||||
|
||||
private Date addTime;
|
||||
private Date updateTime;
|
||||
|
||||
private String author; // 负责人
|
||||
private String alarmEmail; // 报警邮件
|
||||
|
||||
private String scheduleType; // 调度类型
|
||||
private String scheduleConf; // 调度配置,值含义取决于调度类型
|
||||
private String misfireStrategy; // 调度过期策略
|
||||
|
||||
private String executorRouteStrategy; // 执行器路由策略
|
||||
private String executorHandler; // 执行器,任务Handler名称
|
||||
private String executorParam; // 执行器,任务参数
|
||||
private String executorBlockStrategy; // 阻塞处理策略
|
||||
private int executorTimeout; // 任务执行超时时间,单位秒
|
||||
private int executorFailRetryCount; // 失败重试次数
|
||||
|
||||
private String glueType; // GLUE类型 #com.xxl.job.core.glue.GlueTypeEnum
|
||||
private String glueSource; // GLUE源代码
|
||||
private String glueRemark; // GLUE备注
|
||||
private Date glueUpdatetime; // GLUE更新时间
|
||||
|
||||
private String childJobId; // 子任务ID,多个逗号分隔
|
||||
|
||||
private int triggerStatus; // 调度状态:0-停止,1-运行
|
||||
private long triggerLastTime; // 上次调度时间
|
||||
private long triggerNextTime; // 下次调度时间
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getJobGroup() {
|
||||
return jobGroup;
|
||||
}
|
||||
|
||||
public void setJobGroup(int jobGroup) {
|
||||
this.jobGroup = jobGroup;
|
||||
}
|
||||
|
||||
public String getJobDesc() {
|
||||
return jobDesc;
|
||||
}
|
||||
|
||||
public void setJobDesc(String jobDesc) {
|
||||
this.jobDesc = jobDesc;
|
||||
}
|
||||
|
||||
public Date getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
public void setAddTime(Date addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getAlarmEmail() {
|
||||
return alarmEmail;
|
||||
}
|
||||
|
||||
public void setAlarmEmail(String alarmEmail) {
|
||||
this.alarmEmail = alarmEmail;
|
||||
}
|
||||
|
||||
public String getScheduleType() {
|
||||
return scheduleType;
|
||||
}
|
||||
|
||||
public void setScheduleType(String scheduleType) {
|
||||
this.scheduleType = scheduleType;
|
||||
}
|
||||
|
||||
public String getScheduleConf() {
|
||||
return scheduleConf;
|
||||
}
|
||||
|
||||
public void setScheduleConf(String scheduleConf) {
|
||||
this.scheduleConf = scheduleConf;
|
||||
}
|
||||
|
||||
public String getMisfireStrategy() {
|
||||
return misfireStrategy;
|
||||
}
|
||||
|
||||
public void setMisfireStrategy(String misfireStrategy) {
|
||||
this.misfireStrategy = misfireStrategy;
|
||||
}
|
||||
|
||||
public String getExecutorRouteStrategy() {
|
||||
return executorRouteStrategy;
|
||||
}
|
||||
|
||||
public void setExecutorRouteStrategy(String executorRouteStrategy) {
|
||||
this.executorRouteStrategy = executorRouteStrategy;
|
||||
}
|
||||
|
||||
public String getExecutorHandler() {
|
||||
return executorHandler;
|
||||
}
|
||||
|
||||
public void setExecutorHandler(String executorHandler) {
|
||||
this.executorHandler = executorHandler;
|
||||
}
|
||||
|
||||
public String getExecutorParam() {
|
||||
return executorParam;
|
||||
}
|
||||
|
||||
public void setExecutorParam(String executorParam) {
|
||||
this.executorParam = executorParam;
|
||||
}
|
||||
|
||||
public String getExecutorBlockStrategy() {
|
||||
return executorBlockStrategy;
|
||||
}
|
||||
|
||||
public void setExecutorBlockStrategy(String executorBlockStrategy) {
|
||||
this.executorBlockStrategy = executorBlockStrategy;
|
||||
}
|
||||
|
||||
public int getExecutorTimeout() {
|
||||
return executorTimeout;
|
||||
}
|
||||
|
||||
public void setExecutorTimeout(int executorTimeout) {
|
||||
this.executorTimeout = executorTimeout;
|
||||
}
|
||||
|
||||
public int getExecutorFailRetryCount() {
|
||||
return executorFailRetryCount;
|
||||
}
|
||||
|
||||
public void setExecutorFailRetryCount(int executorFailRetryCount) {
|
||||
this.executorFailRetryCount = executorFailRetryCount;
|
||||
}
|
||||
|
||||
public String getGlueType() {
|
||||
return glueType;
|
||||
}
|
||||
|
||||
public void setGlueType(String glueType) {
|
||||
this.glueType = glueType;
|
||||
}
|
||||
|
||||
public String getGlueSource() {
|
||||
return glueSource;
|
||||
}
|
||||
|
||||
public void setGlueSource(String glueSource) {
|
||||
this.glueSource = glueSource;
|
||||
}
|
||||
|
||||
public String getGlueRemark() {
|
||||
return glueRemark;
|
||||
}
|
||||
|
||||
public void setGlueRemark(String glueRemark) {
|
||||
this.glueRemark = glueRemark;
|
||||
}
|
||||
|
||||
public Date getGlueUpdatetime() {
|
||||
return glueUpdatetime;
|
||||
}
|
||||
|
||||
public void setGlueUpdatetime(Date glueUpdatetime) {
|
||||
this.glueUpdatetime = glueUpdatetime;
|
||||
}
|
||||
|
||||
public String getChildJobId() {
|
||||
return childJobId;
|
||||
}
|
||||
|
||||
public void setChildJobId(String childJobId) {
|
||||
this.childJobId = childJobId;
|
||||
}
|
||||
|
||||
public int getTriggerStatus() {
|
||||
return triggerStatus;
|
||||
}
|
||||
|
||||
public void setTriggerStatus(int triggerStatus) {
|
||||
this.triggerStatus = triggerStatus;
|
||||
}
|
||||
|
||||
public long getTriggerLastTime() {
|
||||
return triggerLastTime;
|
||||
}
|
||||
|
||||
public void setTriggerLastTime(long triggerLastTime) {
|
||||
this.triggerLastTime = triggerLastTime;
|
||||
}
|
||||
|
||||
public long getTriggerNextTime() {
|
||||
return triggerNextTime;
|
||||
}
|
||||
|
||||
public void setTriggerNextTime(long triggerNextTime) {
|
||||
this.triggerNextTime = triggerNextTime;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.atguigu.daijia.model.entity.dispatch;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "XxlJobLog")
|
||||
@TableName("xxl_job_log")
|
||||
public class XxlJobLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务id")
|
||||
@TableField("job_id")
|
||||
private Long jobId;
|
||||
|
||||
@Schema(description = "任务状态 0:失败 1:成功")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "失败信息")
|
||||
@TableField("error")
|
||||
private String error;
|
||||
|
||||
@Schema(description = "耗时(单位:毫秒)")
|
||||
@TableField("times")
|
||||
private Integer times;
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.atguigu.daijia.model.entity.driver;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "DriverAccount")
|
||||
@TableName("driver_account")
|
||||
public class DriverAccount extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "司机id")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "账户总金额")
|
||||
@TableField("total_amount")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "锁定金额")
|
||||
@TableField("lock_amount")
|
||||
private BigDecimal lockAmount;
|
||||
|
||||
@Schema(description = "可用金额")
|
||||
@TableField("available_amount")
|
||||
private BigDecimal availableAmount;
|
||||
|
||||
@Schema(description = "总收入")
|
||||
@TableField("total_income_amount")
|
||||
private BigDecimal totalIncomeAmount;
|
||||
|
||||
@Schema(description = "总支出")
|
||||
@TableField("total_pay_amount")
|
||||
private BigDecimal totalPayAmount;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.atguigu.daijia.model.entity.driver;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "DriverAccountDetail")
|
||||
@TableName("driver_account_detail")
|
||||
public class DriverAccountDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "司机id")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "交易内容")
|
||||
@TableField("content")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "交易类型:1201-充值 1202-锁定 1203-解锁 1204-消费")
|
||||
@TableField("trade_type")
|
||||
private String tradeType;
|
||||
|
||||
@Schema(description = "金额")
|
||||
@TableField("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "交易号")
|
||||
@TableField("trade_no")
|
||||
private String tradeNo;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.atguigu.daijia.model.entity.driver;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "DriverFaceRecognition")
|
||||
@TableName("driver_face_recognition")
|
||||
public class DriverFaceRecognition extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "司机id")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "识别日期")
|
||||
@TableField("face_date")
|
||||
private Date faceDate;
|
||||
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
package com.atguigu.daijia.model.entity.driver;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "DriverInfo")
|
||||
@TableName("driver_info")
|
||||
public class DriverInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "微信openId")
|
||||
@TableField("wx_open_id")
|
||||
private String wxOpenId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField("nickname")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField("avatar_url")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "电话")
|
||||
@TableField("phone")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
@TableField("gender")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "生日")
|
||||
@TableField("birthday")
|
||||
private Date birthday;
|
||||
|
||||
@Schema(description = "身份证号码")
|
||||
@TableField("idcard_no")
|
||||
private String idcardNo;
|
||||
|
||||
@Schema(description = "身份证地址")
|
||||
@TableField("idcard_address")
|
||||
private String idcardAddress;
|
||||
|
||||
@Schema(description = "身份证有效期")
|
||||
@TableField("idcard_expire")
|
||||
private Date idcardExpire;
|
||||
|
||||
@Schema(description = "身份证正面")
|
||||
@TableField("idcard_front_url")
|
||||
private String idcardFrontUrl;
|
||||
|
||||
@Schema(description = "身份证背面")
|
||||
@TableField("idcard_back_url")
|
||||
private String idcardBackUrl;
|
||||
|
||||
@Schema(description = "手持身份证")
|
||||
@TableField("idcard_hand_url")
|
||||
private String idcardHandUrl;
|
||||
|
||||
@Schema(description = "准驾车型")
|
||||
@TableField("driver_license_class")
|
||||
private String driverLicenseClazz;
|
||||
|
||||
@Schema(description = "驾驶证证件号")
|
||||
@TableField("driver_license_no")
|
||||
private String driverLicenseNo;
|
||||
|
||||
@Schema(description = "驾驶证有效期")
|
||||
@TableField("driver_license_expire")
|
||||
private Date driverLicenseExpire;
|
||||
|
||||
@Schema(description = "驾驶证初次领证日期")
|
||||
@TableField("driver_license_issue_date")
|
||||
private Date driverLicenseIssueDate;
|
||||
|
||||
@Schema(description = "驾驶证正面")
|
||||
@TableField("driver_license_front_url")
|
||||
private String driverLicenseFrontUrl;
|
||||
|
||||
@Schema(description = "行驶证副页正面")
|
||||
@TableField("driver_license_back_url")
|
||||
private String driverLicenseBackUrl;
|
||||
|
||||
@Schema(description = "手持驾驶证")
|
||||
@TableField("driver_license_hand_url")
|
||||
private String driverLicenseHandUrl;
|
||||
|
||||
@Schema(description = "紧急联系人")
|
||||
@TableField("contact_name")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "紧急联系人电话")
|
||||
@TableField("contact_phone")
|
||||
private String contactPhone;
|
||||
|
||||
@Schema(description = "紧急联系人关系")
|
||||
@TableField("contact_relationship")
|
||||
private String contactRelationship;
|
||||
|
||||
@Schema(description = "腾讯云人脸模型id")
|
||||
@TableField("face_model_id")
|
||||
private String faceModelId;
|
||||
|
||||
@Schema(description = "司机工号")
|
||||
@TableField("job_no")
|
||||
private String jobNo;
|
||||
|
||||
@Schema(description = "订单量统计")
|
||||
@TableField("order_count")
|
||||
private Integer orderCount;
|
||||
|
||||
@Schema(description = "评分")
|
||||
@TableField("score")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "认证状态")
|
||||
@TableField("auth_status")
|
||||
private Integer authStatus;
|
||||
|
||||
@Schema(description = "状态,1正常,2禁用")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.atguigu.daijia.model.entity.driver;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "DriverLoginLog")
|
||||
@TableName("driver_login_log")
|
||||
public class DriverLoginLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "司机id")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "登录IP地址")
|
||||
@TableField("ipaddr")
|
||||
private String ipaddr;
|
||||
|
||||
@Schema(description = "登录状态(0成功 1失败)")
|
||||
@TableField("status")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "提示信息")
|
||||
@TableField("msg")
|
||||
private String msg;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.atguigu.daijia.model.entity.driver;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "DriverSet")
|
||||
@TableName("driver_set")
|
||||
public class DriverSet extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "司机ID")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "服务状态 1:开始接单 0:未接单")
|
||||
@TableField("service_status")
|
||||
private Integer serviceStatus;
|
||||
|
||||
@Schema(description = "订单里程设置")
|
||||
@TableField("order_distance")
|
||||
private BigDecimal orderDistance;
|
||||
|
||||
@Schema(description = "接单里程设置")
|
||||
@TableField("accept_distance")
|
||||
private BigDecimal acceptDistance;
|
||||
|
||||
@Schema(description = "是否自动接单")
|
||||
@TableField("is_auto_accept")
|
||||
private Integer isAutoAccept;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.atguigu.daijia.model.entity.map;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单代驾服务位置")
|
||||
@Document
|
||||
public class OrderServiceLocation {
|
||||
|
||||
@Schema(description = "id")
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderBill")
|
||||
@TableName("order_bill")
|
||||
public class OrderBill extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "规则ID")
|
||||
@TableField("fee_rule_id")
|
||||
private Long feeRuleId;
|
||||
|
||||
@Schema(description = "总金额")
|
||||
@TableField("total_amount")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "应付款金额")
|
||||
@TableField("pay_amount")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@Schema(description = "里程费")
|
||||
@TableField("distance_fee")
|
||||
private BigDecimal distanceFee;
|
||||
|
||||
@Schema(description = "等时费用")
|
||||
@TableField("wait_fee")
|
||||
private BigDecimal waitFee;
|
||||
|
||||
@Schema(description = "路桥费")
|
||||
@TableField("toll_fee")
|
||||
private BigDecimal tollFee;
|
||||
|
||||
@Schema(description = "停车费")
|
||||
@TableField("parking_fee")
|
||||
private BigDecimal parkingFee;
|
||||
|
||||
@Schema(description = "其他费用")
|
||||
@TableField("other_fee")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "远程费")
|
||||
@TableField("long_distance_fee")
|
||||
private BigDecimal longDistanceFee;
|
||||
|
||||
@Schema(description = "顾客好处费")
|
||||
@TableField("favour_fee")
|
||||
private BigDecimal favourFee;
|
||||
|
||||
@Schema(description = "系统奖励费")
|
||||
@TableField("reward_fee")
|
||||
private BigDecimal rewardFee;
|
||||
|
||||
@Schema(description = "系统奖励规则id")
|
||||
@TableField("reward_rule_id")
|
||||
private Long rewardRuleId;
|
||||
|
||||
@Schema(description = "优惠券金额")
|
||||
@TableField("coupon_amount")
|
||||
private BigDecimal couponAmount;
|
||||
|
||||
@Schema(description = "基础里程(公里)")
|
||||
@TableField("base_distance")
|
||||
private BigDecimal baseDistance;
|
||||
|
||||
@Schema(description = "基础里程费")
|
||||
@TableField("base_distance_fee")
|
||||
private BigDecimal baseDistanceFee;
|
||||
|
||||
@Schema(description = "超出基础里程的里程(公里)")
|
||||
@TableField("exceed_distance")
|
||||
private BigDecimal exceedDistance;
|
||||
|
||||
@Schema(description = "超出基础里程的价格")
|
||||
@TableField("exceed_distance_price")
|
||||
private BigDecimal exceedDistancePrice;
|
||||
|
||||
@Schema(description = "基础等时分钟")
|
||||
@TableField("base_wait_minute")
|
||||
private Integer baseWaitMinute;
|
||||
|
||||
@Schema(description = "超出基础等时的分钟")
|
||||
@TableField("exceed_wait_minute")
|
||||
private Integer exceedWaitMinute;
|
||||
|
||||
@Schema(description = "超出基础分钟的价格")
|
||||
@TableField("exceed_wait_minute_price")
|
||||
private BigDecimal exceedWaitMinutePrice;
|
||||
|
||||
@Schema(description = "基础远途里程(公里)")
|
||||
@TableField("base_long_distance")
|
||||
private BigDecimal baseLongDistance;
|
||||
|
||||
@Schema(description = "超出基础远程里程的里程")
|
||||
@TableField("exceed_long_distance")
|
||||
private BigDecimal exceedLongDistance;
|
||||
|
||||
@Schema(description = "超出基础远程里程的价格")
|
||||
@TableField("exceed_long_distance_price")
|
||||
private BigDecimal exceedLongDistancePrice;
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderComment")
|
||||
@TableName("order_comment")
|
||||
public class OrderComment extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "司机ID")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "顾客ID")
|
||||
@TableField("customer_id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "评分,1星~5星")
|
||||
@TableField("rate")
|
||||
private Integer rate;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "状态,1未申诉,2已申诉,3申诉失败,4申诉成功")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "申诉工作流ID")
|
||||
@TableField("instance_id")
|
||||
private String instanceId;
|
||||
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.atguigu.daijia.model.enums.OrderStatus;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderInfo")
|
||||
@TableName("order_info")
|
||||
public class OrderInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
@TableField("customer_id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@TableField("order_no")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "起始地点")
|
||||
@TableField("start_location")
|
||||
private String startLocation;
|
||||
|
||||
@Schema(description = "起始地点经度")
|
||||
@TableField("start_point_longitude")
|
||||
private BigDecimal startPointLongitude;
|
||||
|
||||
@Schema(description = "起始点伟度")
|
||||
@TableField("start_point_latitude")
|
||||
private BigDecimal startPointLatitude;
|
||||
|
||||
@Schema(description = "结束地点")
|
||||
@TableField("end_location")
|
||||
private String endLocation;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
@TableField("end_point_longitude")
|
||||
private BigDecimal endPointLongitude;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
@TableField("end_point_latitude")
|
||||
private BigDecimal endPointLatitude;
|
||||
|
||||
@Schema(description = "预估里程")
|
||||
@TableField("expect_distance")
|
||||
private BigDecimal expectDistance;
|
||||
|
||||
@Schema(description = "实际里程")
|
||||
@TableField("real_distance")
|
||||
private BigDecimal realDistance;
|
||||
|
||||
@Schema(description = "预估订单金额")
|
||||
@TableField("expect_amount")
|
||||
private BigDecimal expectAmount;
|
||||
|
||||
@Schema(description = "实际订单金额")
|
||||
@TableField("real_amount")
|
||||
private BigDecimal realAmount;
|
||||
|
||||
@Schema(description = "顾客好处费")
|
||||
@TableField("favour_fee")
|
||||
private BigDecimal favourFee;
|
||||
|
||||
@Schema(description = "司机ID")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "司机接单时间")
|
||||
@TableField("accept_time")
|
||||
private Date acceptTime;
|
||||
|
||||
@Schema(description = "司机到达时间")
|
||||
@TableField("arrive_time")
|
||||
private Date arriveTime;
|
||||
|
||||
@Schema(description = "开始服务时间")
|
||||
@TableField("start_service_time")
|
||||
private Date startServiceTime;
|
||||
|
||||
@Schema(description = "结束服务时间")
|
||||
@TableField("end_service_time")
|
||||
private Date endServiceTime;
|
||||
|
||||
@Schema(description = "微信付款时间")
|
||||
@TableField("pay_time")
|
||||
private Date payTime;
|
||||
|
||||
@Schema(description = "订单取消规则ID")
|
||||
@TableField("cancel_rule_id")
|
||||
private Long cancelRuleId;
|
||||
|
||||
@Schema(description = "车牌号")
|
||||
@TableField("car_license")
|
||||
private String carLicense;
|
||||
|
||||
@Schema(description = "车型")
|
||||
@TableField("car_type")
|
||||
private String carType;
|
||||
|
||||
@Schema(description = "司机到达拍照:车前照")
|
||||
@TableField("car_front_url")
|
||||
private String carFrontUrl;
|
||||
|
||||
@Schema(description = "司机到达拍照:车后照")
|
||||
@TableField("car_back_url")
|
||||
private String carBackUrl;
|
||||
|
||||
@Schema(description = "微信支付订单号")
|
||||
@TableField("transaction_id")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "订单状态:1等待接单,2已接单,3司机已到达,4开始代驾,5结束代驾,6未付款,7已付款,8订单已结束,9顾客撤单,10司机撤单,11事故关闭,12其他")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "订单备注信息")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderMonitor")
|
||||
@TableName("order_monitor")
|
||||
public class OrderMonitor extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "文件个数")
|
||||
@TableField("file_num")
|
||||
private Integer fileNum;
|
||||
|
||||
@Schema(description = "需要审核的个数")
|
||||
@TableField("audit_num")
|
||||
private Integer auditNum;
|
||||
|
||||
@Schema(description = "是否报警")
|
||||
@TableField("is_alarm")
|
||||
private Integer isAlarm;
|
||||
|
||||
@Schema(description = "状态")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderMonitorRecord")
|
||||
@Document("order_monitor_record")
|
||||
public class OrderMonitorRecord {
|
||||
|
||||
@Schema(description = "id")
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "审核结果")
|
||||
private String result;
|
||||
|
||||
@Schema(description = "风险关键词")
|
||||
private String keywords;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderProfitsharing")
|
||||
@TableName("order_profitsharing")
|
||||
public class OrderProfitsharing extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "规则ID")
|
||||
@TableField("rule_id")
|
||||
private Long ruleId;
|
||||
|
||||
@Schema(description = "订单金额")
|
||||
@TableField("order_amount")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
@Schema(description = "微信支付平台费率")
|
||||
@TableField("payment_rate")
|
||||
private BigDecimal paymentRate;
|
||||
|
||||
@Schema(description = "微信支付平台费用")
|
||||
@TableField("payment_fee")
|
||||
private BigDecimal paymentFee;
|
||||
|
||||
@Schema(description = "代驾司机代缴个税税率")
|
||||
@TableField("driver_tax_rate")
|
||||
private BigDecimal driverTaxRate;
|
||||
|
||||
@Schema(description = "代驾司机税率支出费用")
|
||||
@TableField("driver_tax_fee")
|
||||
private BigDecimal driverTaxFee;
|
||||
|
||||
@Schema(description = "平台分账收入")
|
||||
@TableField("platform_income")
|
||||
private BigDecimal platformIncome;
|
||||
|
||||
@Schema(description = "司机分账收入")
|
||||
@TableField("driver_income")
|
||||
private BigDecimal driverIncome;
|
||||
|
||||
@Schema(description = "分账状态,1未分账,2已分账")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderStatusLog")
|
||||
@TableName("order_status_log")
|
||||
public class OrderStatusLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "orderId")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "订单状态")
|
||||
@TableField("order_status")
|
||||
private Integer orderStatus;
|
||||
|
||||
@Schema(description = "操作时间")
|
||||
@TableField("operate_time")
|
||||
private Date operateTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.atguigu.daijia.model.entity.order;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderTrack")
|
||||
@TableName("order_track")
|
||||
public class OrderTrack extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "订单id")
|
||||
@TableField("order_id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "司机id")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "客户id")
|
||||
@TableField("customer_id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "经度")
|
||||
@TableField("longitude")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
@TableField("latitude")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "速度")
|
||||
@TableField("speed")
|
||||
private String speed;
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.atguigu.daijia.model.entity.payment;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "PaymentInfo")
|
||||
@TableName("payment_info")
|
||||
public class PaymentInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "乘客微信openid")
|
||||
@TableField("customer_open_id")
|
||||
private String customerOpenId;
|
||||
|
||||
@Schema(description = "司机微信openid")
|
||||
@TableField("driver_open_id")
|
||||
private String driverOpenId;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@TableField("order_no")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "付款方式:1101-微信 1102-支付宝")
|
||||
@TableField("pay_way")
|
||||
private Integer payWay;
|
||||
|
||||
@Schema(description = "交易编号(微信或支付)")
|
||||
@TableField("transaction_id")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "支付金额")
|
||||
@TableField("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "交易内容")
|
||||
@TableField("content")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "支付状态:0-未支付 1-已支付")
|
||||
@TableField("payment_status")
|
||||
private Integer paymentStatus;
|
||||
|
||||
@Schema(description = "回调时间")
|
||||
@TableField("callback_time")
|
||||
private Date callbackTime;
|
||||
|
||||
@Schema(description = "回调信息")
|
||||
@TableField("callback_content")
|
||||
private String callbackContent;
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.atguigu.daijia.model.entity.payment;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "ProfitsharingInfo")
|
||||
@TableName("profitsharing_info")
|
||||
public class ProfitsharingInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "司机id")
|
||||
@TableField("driver_id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@TableField("order_no")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "微信支付订单号")
|
||||
@TableField("transaction_id")
|
||||
private String transactionId;
|
||||
|
||||
@Schema(description = "商户分账单号")
|
||||
@TableField("out_trade_no")
|
||||
private String outTradeNo;
|
||||
|
||||
@Schema(description = "司机分账金额")
|
||||
@TableField("amount")
|
||||
private String amount;
|
||||
|
||||
@Schema(description = "分账单状态 PROCESSING:处理中 FINISHED:分账完成")
|
||||
@TableField("state")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "返回信息")
|
||||
@TableField("respone_content")
|
||||
private String responeContent;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.atguigu.daijia.model.entity.rule;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "CancelRule")
|
||||
@TableName("cancel_rule")
|
||||
public class CancelRule extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "规则名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规则代码")
|
||||
@TableField("rule")
|
||||
private String rule;
|
||||
|
||||
@Schema(description = "状态代码,1有效,2关闭")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.atguigu.daijia.model.entity.rule;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "FeeRule")
|
||||
@TableName("fee_rule")
|
||||
public class FeeRule extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "规则名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规则代码")
|
||||
@TableField("rule")
|
||||
private String rule;
|
||||
|
||||
@Schema(description = "状态代码,1有效,2关闭")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.atguigu.daijia.model.entity.rule;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "ProfitsharingRule")
|
||||
@TableName("profitsharing_rule")
|
||||
public class ProfitsharingRule extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "规则名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规则代码")
|
||||
@TableField("rule")
|
||||
private String rule;
|
||||
|
||||
@Schema(description = "状态代码,1有效,2关闭")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.atguigu.daijia.model.entity.rule;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "RewardRule")
|
||||
@TableName("reward_rule")
|
||||
public class RewardRule extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "规则名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规则代码")
|
||||
@TableField("rule")
|
||||
private String rule;
|
||||
|
||||
@Schema(description = "状态代码,1有效,2关闭")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "部门")
|
||||
@TableName("sys_dept")
|
||||
public class SysDept extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "上级部门id")
|
||||
@TableField("parent_id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "树结构")
|
||||
@TableField("tree_path")
|
||||
private String treePath;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@TableField("sort_value")
|
||||
private Integer sortValue;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
@TableField("leader")
|
||||
private String leader;
|
||||
|
||||
@Schema(description = "电话")
|
||||
@TableField("phone")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "状态(1正常 0停用)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "下级部门")
|
||||
@TableField(exist = false)
|
||||
private List<SysDept> children;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "SysLoginLog")
|
||||
@TableName("sys_login_log")
|
||||
public class SysLoginLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户账号")
|
||||
@TableField("username")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "登录IP地址")
|
||||
@TableField("ipaddr")
|
||||
private String ipaddr;
|
||||
|
||||
@Schema(description = "登录状态(0成功 1失败)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "提示信息")
|
||||
@TableField("msg")
|
||||
private String msg;
|
||||
|
||||
@Schema(description = "访问时间")
|
||||
@TableField("access_time")
|
||||
private Date accessTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "菜单")
|
||||
@TableName("sys_menu")
|
||||
public class SysMenu extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "所属上级")
|
||||
@TableField("parent_id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型(1:菜单,2:按钮)")
|
||||
@TableField("type")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "路由地址")
|
||||
@TableField("path")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "组件路径")
|
||||
@TableField("component")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "权限标识")
|
||||
@TableField("perms")
|
||||
private String perms;
|
||||
|
||||
@Schema(description = "图标")
|
||||
@TableField("icon")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@TableField("sort_value")
|
||||
private Integer sortValue;
|
||||
|
||||
@Schema(description = "状态(0:禁止,1:正常)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "高亮的路径")
|
||||
@TableField("active_menu")
|
||||
private String activeMenu;
|
||||
|
||||
@Schema(description = "是否隐藏")
|
||||
@TableField("is_hide")
|
||||
private Integer isHide;
|
||||
|
||||
// 下级列表
|
||||
@TableField(exist = false)
|
||||
private List<SysMenu> children;
|
||||
//是否选中
|
||||
@TableField(exist = false)
|
||||
private boolean isSelect;
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "SysOperLog")
|
||||
@TableName("sys_oper_log")
|
||||
public class SysOperLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "模块标题")
|
||||
@TableField("title")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型(0其它 1新增 2修改 3删除)")
|
||||
@TableField("business_type")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "方法名称")
|
||||
@TableField("method")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "请求方式")
|
||||
@TableField("request_method")
|
||||
private String requestMethod;
|
||||
|
||||
@Schema(description = "操作类别(0其它 1后台用户 2手机端用户)")
|
||||
@TableField("operator_type")
|
||||
private String operatorType;
|
||||
|
||||
@Schema(description = "操作人员")
|
||||
@TableField("oper_name")
|
||||
private String operName;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
@TableField("dept_name")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "请求URL")
|
||||
@TableField("oper_url")
|
||||
private String operUrl;
|
||||
|
||||
@Schema(description = "主机地址")
|
||||
@TableField("oper_ip")
|
||||
private String operIp;
|
||||
|
||||
@Schema(description = "请求参数")
|
||||
@TableField("oper_param")
|
||||
private String operParam;
|
||||
|
||||
@Schema(description = "返回参数")
|
||||
@TableField("json_result")
|
||||
private String jsonResult;
|
||||
|
||||
@Schema(description = "操作状态(0正常 1异常)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "错误消息")
|
||||
@TableField("error_msg")
|
||||
private String errorMsg;
|
||||
|
||||
@Schema(description = "操作时间")
|
||||
@TableField("oper_time")
|
||||
private Date operTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "岗位")
|
||||
@TableName("sys_post")
|
||||
public class SysPost extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "岗位编码")
|
||||
@TableField("post_code")
|
||||
private String postCode;
|
||||
|
||||
@Schema(description = "岗位名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "显示顺序")
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "状态(1正常 0停用)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
@Schema(description = "角色")
|
||||
@TableName("sys_role")
|
||||
public class SysRole extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//@NotBlank(message = "角色名称不能为空")
|
||||
@Schema(description = "角色名称")
|
||||
@TableField("role_name")
|
||||
private String roleName;
|
||||
|
||||
@Schema(description = "角色编码")
|
||||
@TableField("role_code")
|
||||
private String roleCode;
|
||||
|
||||
@Schema(description = "描述")
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "角色菜单")
|
||||
@TableName("sys_role_menu")
|
||||
public class SysRoleMenu extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "角色id")
|
||||
@TableField("role_id")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "菜单id")
|
||||
@TableField("menu_id")
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "用户")
|
||||
@TableName("sys_user")
|
||||
public class SysUser extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
@TableField("username")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
@TableField("password")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "手机")
|
||||
@TableField("phone")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "头像地址")
|
||||
@TableField("head_url")
|
||||
private String headUrl;
|
||||
|
||||
@Schema(description = "部门id")
|
||||
@TableField("dept_id")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "岗位id")
|
||||
@TableField("post_id")
|
||||
private Long postId;
|
||||
|
||||
@Schema(description = "描述")
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "状态(1:正常 0:停用)")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<SysRole> roleList;
|
||||
//岗位
|
||||
@TableField(exist = false)
|
||||
private String postName;
|
||||
//部门
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
|
||||
@TableField(exist = false)
|
||||
List<String> userPermsList;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.atguigu.daijia.model.entity.system;
|
||||
|
||||
import com.atguigu.daijia.model.entity.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "用户角色")
|
||||
@TableName("sys_user_role")
|
||||
public class SysUserRole extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "角色id")
|
||||
@TableField("role_id")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
@TableField("user_id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.atguigu.daijia.model.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum OrderStatus {
|
||||
WAITING_ACCEPT(1, "等待接单"),
|
||||
ACCEPTED(2, "已接单"),
|
||||
DRIVER_ARRIVED(3, "司机已到达"),
|
||||
UPDATE_CART_INFO(4, "更新代驾车辆信息"),
|
||||
START_SERVICE(5, "开始服务"),
|
||||
END_SERVICE(6, "结束服务"),
|
||||
UNPAID(7, "待付款"),
|
||||
PAID(8, "已付款"),
|
||||
FINISH(9, "完成"),
|
||||
CANCEL_ORDER(-1, "未接单取消订单"),
|
||||
NULL_ORDER(-100, "不存在"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
private Integer status;
|
||||
private String comment;
|
||||
|
||||
OrderStatus(Integer status, String comment) {
|
||||
this.status = status;
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.atguigu.daijia.model.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum TradeType {
|
||||
|
||||
REWARD(1, "系统奖励"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
private Integer type;
|
||||
private String content;
|
||||
|
||||
TradeType(Integer type, String content) {
|
||||
this.type = type;
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.atguigu.daijia.model.form.coupon;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class UseCouponForm {
|
||||
|
||||
@Schema(description = "乘客id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "乘客优惠券id")
|
||||
private Long customerCouponId;
|
||||
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "订单金额")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.daijia.model.form.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ExpectOrderForm {
|
||||
|
||||
@Schema(description = "起始地点经度")
|
||||
private BigDecimal startPointLongitude;
|
||||
|
||||
@Schema(description = "起始点伟度")
|
||||
private BigDecimal startPointLatitude;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLongitude;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLatitude;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.atguigu.daijia.model.form.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SubmitOrderForm {
|
||||
|
||||
@Schema(description = "乘客id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "起始地点")
|
||||
private String startLocation;
|
||||
|
||||
@Schema(description = "起始地点经度")
|
||||
private BigDecimal startPointLongitude;
|
||||
|
||||
@Schema(description = "起始点伟度")
|
||||
private BigDecimal startPointLatitude;
|
||||
|
||||
@Schema(description = "结束地点")
|
||||
private String endLocation;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLongitude;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLatitude;
|
||||
|
||||
@Schema(description = "顾客好处费")
|
||||
private BigDecimal favourFee = new BigDecimal(0);
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.daijia.model.form.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpdateCustomerInfoForm {
|
||||
|
||||
@Schema(description = "客户Id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "客户昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatarUrl;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.atguigu.daijia.model.form.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpdateCustomerPhoneForm {
|
||||
|
||||
@Schema(description = "客户Id")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "手机验证码")
|
||||
private String code;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.atguigu.daijia.model.form.customer;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpdateWxPhoneForm {
|
||||
|
||||
@Schema(description = "客户Id")
|
||||
private Long customerId;
|
||||
|
||||
private String code;
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.atguigu.daijia.model.form.driver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DriverFaceModelForm {
|
||||
|
||||
@Schema(description = "司机id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "图片 base64 数据")
|
||||
private String imageBase64 ;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.atguigu.daijia.model.form.driver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IdCardOcrForm {
|
||||
|
||||
@Schema(description = "身份证Base64字符串")
|
||||
private String idCardBase64;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.atguigu.daijia.model.form.driver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TransferForm {
|
||||
|
||||
@Schema(description = "身份证Base64字符串")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "交易内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "交易类型")
|
||||
private Integer tradeType;
|
||||
|
||||
@Schema(description = "交易金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "交易编号")
|
||||
private String tradeNo;
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package com.atguigu.daijia.model.form.driver;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class UpdateDriverAuthInfoForm {
|
||||
|
||||
@Schema(description = "司机Id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
@TableField("gender")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "生日")
|
||||
private Date birthday;
|
||||
|
||||
@Schema(description = "身份证号码")
|
||||
private String idcardNo;
|
||||
|
||||
@Schema(description = "身份证地址")
|
||||
private String idcardAddress;
|
||||
|
||||
@Schema(description = "身份证有效期")
|
||||
private Date idcardExpire;
|
||||
|
||||
@Schema(description = "身份证正面")
|
||||
private String idcardFrontUrl;
|
||||
|
||||
@Schema(description = "身份证背面")
|
||||
private String idcardBackUrl;
|
||||
|
||||
@Schema(description = "手持身份证")
|
||||
private String idcardHandUrl;
|
||||
|
||||
@Schema(description = "准驾车型")
|
||||
private String driverLicenseClazz;
|
||||
|
||||
@Schema(description = "驾驶证证件号")
|
||||
private String driverLicenseNo;
|
||||
|
||||
@Schema(description = "驾驶证有效期")
|
||||
private Date driverLicenseExpire;
|
||||
|
||||
@Schema(description = "驾驶证初次领证日期")
|
||||
private Date driverLicenseIssueDate;
|
||||
|
||||
@Schema(description = "驾驶证正面")
|
||||
private String driverLicenseFrontUrl;
|
||||
|
||||
@Schema(description = "行驶证副页正面")
|
||||
private String driverLicenseBackUrl;
|
||||
|
||||
@Schema(description = "手持驾驶证")
|
||||
private String driverLicenseHandUrl;
|
||||
|
||||
@Schema(description = "紧急联系人")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "紧急联系人电话")
|
||||
private String contactPhone;
|
||||
|
||||
@Schema(description = "紧急联系人关系")
|
||||
private String contactRelationship;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.atguigu.daijia.model.form.driver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpdateDriverPhoneForm {
|
||||
|
||||
@Schema(description = "司机Id")
|
||||
private Long driverId;
|
||||
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.daijia.model.form.map;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CalculateDrivingLineForm {
|
||||
|
||||
@Schema(description = "起始地点经度")
|
||||
private BigDecimal startPointLongitude;
|
||||
|
||||
@Schema(description = "起始点纬度")
|
||||
private BigDecimal startPointLatitude;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLongitude;
|
||||
|
||||
@Schema(description = "结束地点纬度")
|
||||
private BigDecimal endPointLatitude;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.daijia.model.form.map;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class OrderServiceLocationForm {
|
||||
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "伟度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.atguigu.daijia.model.form.map;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SearchNearByDriverForm {
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "伟度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@Schema(description = "里程")
|
||||
private BigDecimal mileageDistance;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.daijia.model.form.map;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class UpdateDriverLocationForm {
|
||||
|
||||
@Schema(description = "司机id")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "伟度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.daijia.model.form.map;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class UpdateOrderLocationForm {
|
||||
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "伟度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.atguigu.daijia.model.form.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单评论")
|
||||
public class OrderCommentForm {
|
||||
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "司机ID")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "顾客ID")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "评分,1星~5星")
|
||||
private Integer rate;
|
||||
|
||||
@Schema(description = "差评备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.atguigu.daijia.model.form.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单费用表单")
|
||||
public class OrderFeeForm {
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "司机ID")
|
||||
private Long driverId;
|
||||
|
||||
@Schema(description = "路桥费")
|
||||
private BigDecimal tollFee;
|
||||
|
||||
@Schema(description = "停车费")
|
||||
private BigDecimal parkingFee;
|
||||
|
||||
@Schema(description = "其他费用")
|
||||
@TableField("other_fee")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.atguigu.daijia.model.form.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "OrderInfo")
|
||||
public class OrderInfoForm {
|
||||
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "起始地点")
|
||||
private String startLocation;
|
||||
|
||||
@Schema(description = "起始地点经度")
|
||||
private BigDecimal startPointLongitude;
|
||||
|
||||
@Schema(description = "起始点伟度")
|
||||
private BigDecimal startPointLatitude;
|
||||
|
||||
@Schema(description = "结束地点")
|
||||
private String endLocation;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLongitude;
|
||||
|
||||
@Schema(description = "结束地点经度")
|
||||
private BigDecimal endPointLatitude;
|
||||
|
||||
@Schema(description = "顾客好处费")
|
||||
private BigDecimal favourFee;
|
||||
|
||||
@Schema(description = "订单备注信息")
|
||||
private String remark;
|
||||
|
||||
|
||||
//预期费用信息
|
||||
@Schema(description = "预估订单费用")
|
||||
private BigDecimal expectAmount;
|
||||
|
||||
@Schema(description = "预估里程")
|
||||
private BigDecimal expectDistance;
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.daijia.model.form.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单监控")
|
||||
public class OrderMonitorForm {
|
||||
|
||||
@Schema(description = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "监控内容")
|
||||
private String content;
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue