移除无用VO及其其他

This commit is contained in:
hupeng
2020-06-28 14:00:18 +08:00
parent f29b38947b
commit f7a79714d5
27 changed files with 93 additions and 858 deletions

View File

@ -1,36 +0,0 @@
///**
// * Copyright (C) 2018-2020
// * All rights reserved, Designed By www.yixiang.co
//
// */
//package co.yixiang.exception.handler;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//import lombok.Data;
//
//import java.time.LocalDateTime;
//
///**
// * @author hupeng
// * @since 2019-10-02
// */
//@Data
//class ApiErr {
//
// private Integer status;
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
// private LocalDateTime timestamp;
// private String msg;
//
// private ApiErr() {
// timestamp = LocalDateTime.now();
// }
//
// public ApiErr(Integer status, String message) {
// this();
// this.status = status;
// this.msg = message;
// }
//}
//
//

View File

@ -1,43 +0,0 @@
///**
// * Copyright (C) 2018-2020
// * All rights reserved, Designed By www.yixiang.co
//
// */
//package co.yixiang.exception.handler;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//import lombok.Data;
//
//import java.time.LocalDateTime;
//
///**
// * @author Zheng Jie
// * @date 2018-11-23
// */
//@Data
//class ApiError {
//
// private Integer status = 400;
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
// private LocalDateTime timestamp;
// private String message;
//
// private ApiError() {
// timestamp = LocalDateTime.now();
// }
//
// public static ApiError error(String message){
// ApiError apiError = new ApiError();
// apiError.setMessage(message);
// return apiError;
// }
//
// public static ApiError error(Integer status, String message){
// ApiError apiError = new ApiError();
// apiError.setStatus(status);
// apiError.setMessage(message);
// return apiError;
// }
//}
//
//

View File

@ -1,130 +0,0 @@
///**
// * Copyright (C) 2018-2020
// * All rights reserved, Designed By www.yixiang.co
//
// */
//package co.yixiang.exception.handler;
//
//import co.yixiang.exception.BadRequestException;
//import co.yixiang.exception.EntityExistException;
//import co.yixiang.exception.EntityNotFoundException;
//import co.yixiang.exception.ErrorRequestException;
//import co.yixiang.utils.ThrowableUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.security.authentication.BadCredentialsException;
//import org.springframework.web.bind.MethodArgumentNotValidException;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.RestControllerAdvice;
//
//import java.util.Objects;
//
//import static org.springframework.http.HttpStatus.NOT_FOUND;
//import static org.springframework.http.HttpStatus.valueOf;
//
///**
// * @author Zheng Jie
// * @date 2018-11-23
// */
//@Slf4j
//@RestControllerAdvice
//@SuppressWarnings("unchecked")
//public class GlobalExceptionHandler {
//
// /**
// * 处理所有不可知的异常
// */
// @ExceptionHandler(Throwable.class)
// public ResponseEntity<ApiError> handleException(Throwable e){
// // 打印堆栈信息
// log.error(ThrowableUtil.getStackTrace(e));
// return buildResponseEntity(ApiError.error(e.getMessage()));
// }
//
// /**
// * BadCredentialsException
// */
// @ExceptionHandler(BadCredentialsException.class)
// public ResponseEntity<ApiError> badCredentialsException(BadCredentialsException e){
// // 打印堆栈信息
// String message = "坏的凭证".equals(e.getMessage()) ? "用户名或密码不正确" : e.getMessage();
// log.error(message);
// return buildResponseEntity(ApiError.error(message));
// }
//
// /**
// * 处理自定义异常
// */
// @ExceptionHandler(value = BadRequestException.class)
// public ResponseEntity<ApiError> badRequestException(BadRequestException e) {
// // 打印堆栈信息
// log.error(ThrowableUtil.getStackTrace(e));
// return buildResponseEntity(ApiError.error(e.getStatus(),e.getMessage()));
// }
//
// /**
// * 处理自定义异常
// * @param e
// * @return
// */
// @ExceptionHandler(value = ErrorRequestException.class)
// public ResponseEntity<ApiErr> errorRequestException(ErrorRequestException e) {
// // 打印堆栈信息
// log.error(ThrowableUtil.getStackTrace(e));
// ApiErr apiError = new ApiErr(e.getStatus(),e.getMessage());
// return buildResponseEntity2(apiError);
// }
//
// /**
// * 处理 EntityExist
// */
// @ExceptionHandler(value = EntityExistException.class)
// public ResponseEntity<ApiError> entityExistException(EntityExistException e) {
// // 打印堆栈信息
// log.error(ThrowableUtil.getStackTrace(e));
// return buildResponseEntity(ApiError.error(e.getMessage()));
// }
//
// /**
// * 处理 EntityNotFound
// */
// @ExceptionHandler(value = EntityNotFoundException.class)
// public ResponseEntity<ApiError> entityNotFoundException(EntityNotFoundException e) {
// // 打印堆栈信息
// log.error(ThrowableUtil.getStackTrace(e));
// return buildResponseEntity(ApiError.error(NOT_FOUND.value(),e.getMessage()));
// }
//
// /**
// * 处理所有接口数据验证异常
// */
// @ExceptionHandler(MethodArgumentNotValidException.class)
// public ResponseEntity<ApiError> handleMethodArgumentNotValidException(MethodArgumentNotValidException e){
// // 打印堆栈信息
// log.error(ThrowableUtil.getStackTrace(e));
// String[] str = Objects.requireNonNull(e.getBindingResult().getAllErrors().get(0).getCodes())[1].split("\\.");
// String message = e.getBindingResult().getAllErrors().get(0).getDefaultMessage();
// String msg = "不能为空";
// if(msg.equals(message)){
// message = str[1] + ":" + message;
// }
// return buildResponseEntity(ApiError.error(message));
// }
//
// /**
// * 统一返回
// */
// private ResponseEntity<ApiError> buildResponseEntity(ApiError apiError) {
// return new ResponseEntity<>(apiError, valueOf(apiError.getStatus()));
// }
//
// /**
// * 统一返回
// * @param apiError
// * @return
// */
// private ResponseEntity<ApiErr> buildResponseEntity2(ApiErr apiError) {
// return new ResponseEntity(apiError, HttpStatus.valueOf(apiError.getStatus()));
// }
//}

View File

@ -8,7 +8,7 @@
<trim-strings>false</trim-strings>
<!-- 自定义的枚举与Integer转换器, 下节介绍 -->
<!--<custom-converters>
<converter type="com.dongao.beacon.ds.web.admin.tookit.EnumIntegerBiDirectionalDozerConverter">
<converter type="com.dongao.beacon.ds.rest.admin.tookit.EnumIntegerBiDirectionalDozerConverter">
<class-a>java.lang.Enum</class-a>
<class-b>java.lang.Integer</class-b>
</converter>