Skip to content

refactor: 将异常类的双参构造方法,参数顺序互换 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions latticy
Submodule latticy added at 7c3a62
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class AuthenticationException extends HttpException {

Expand All @@ -18,7 +19,7 @@ public class AuthenticationException extends HttpException {
protected int code = Code.UN_AUTHENTICATION.getCode();

public AuthenticationException() {
super(Code.UN_AUTHENTICATION.getDescription(), Code.UN_AUTHENTICATION.getCode());
super(Code.UN_AUTHENTICATION.getCode(), Code.UN_AUTHENTICATION.getDescription());
}

public AuthenticationException(String message) {
Expand All @@ -31,7 +32,13 @@ public AuthenticationException(int code) {
}


@Deprecated
public AuthenticationException(String message, int code) {
super(code, message);
this.code = code;
}

public AuthenticationException(int code, String message) {
super(message, code);
this.code = code;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class AuthorizationException extends HttpException {

Expand All @@ -19,23 +20,31 @@ public class AuthorizationException extends HttpException {
protected int code = Code.UN_AUTHORIZATION.getCode();

public AuthorizationException() {
super(Code.UN_AUTHORIZATION.getDescription(), Code.UN_AUTHORIZATION.getCode());
super(Code.UN_AUTHORIZATION.getCode(), Code.UN_AUTHORIZATION.getDescription());
}

public AuthorizationException(String message) {
super(message);
}

public AuthorizationException(int code) {
super(Code.UN_AUTHORIZATION.getDescription(), code);
super(code, Code.UN_AUTHORIZATION.getDescription());
this.code = code;
}

@Deprecated
public AuthorizationException(String message, int code) {
super(message, code);
this.code = code;
}

public AuthorizationException(int code, String message) {
super(code, message);
this.code = code;
}



@Override
public int getHttpCode() {
return httpCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class DuplicatedException extends HttpException {

Expand All @@ -22,19 +23,26 @@ public DuplicatedException(String message) {
}

public DuplicatedException() {
super(Code.DUPLICATED.getDescription());
super(Code.DUPLICATED.getCode(), Code.DUPLICATED.getDescription());
}

public DuplicatedException(int code) {
super(Code.DUPLICATED.getDescription(), Code.DUPLICATED.getCode());
super(Code.DUPLICATED.getCode(), Code.DUPLICATED.getDescription());
this.code = code;
}

@Deprecated
public DuplicatedException(String message, int code) {
super(message, Code.DUPLICATED.getCode());
this.code = code;
}


public DuplicatedException(int code, String message) {
super(Code.DUPLICATED.getCode(), message);
this.code = code;
}

@Override
public int getCode() {
return code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class FailedException extends HttpException {

Expand All @@ -18,23 +19,29 @@ public class FailedException extends HttpException {
protected int httpCode = HttpStatus.INTERNAL_SERVER_ERROR.value();

public FailedException() {
super(Code.FAIL.getDescription(), Code.FAIL.getCode());
super(Code.FAIL.getCode(), Code.FAIL.getDescription());
}

public FailedException(String message) {
super(message);
}

public FailedException(int code) {
super(Code.FAIL.getDescription(), code);
super(code, Code.FAIL.getDescription());
this.code = code;
}

@Deprecated
public FailedException(String message, int code) {
super(message, code);
this.code = code;
}

public FailedException(int code, String message) {
super(code, message);
this.code = code;
}

@Override
public int getCode() {
return code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class FileExtensionException extends HttpException {

Expand All @@ -18,7 +19,7 @@ public class FileExtensionException extends HttpException {
protected int httpCode = HttpStatus.NOT_ACCEPTABLE.value();

public FileExtensionException() {
super(Code.FILE_EXTENSION.getDescription(), Code.FILE_EXTENSION.getCode());
super(Code.FILE_EXTENSION.getCode(), Code.FILE_EXTENSION.getDescription());
}

public FileExtensionException(String message) {
Expand All @@ -27,15 +28,21 @@ public FileExtensionException(String message) {


public FileExtensionException(int code) {
super(Code.FILE_EXTENSION.getDescription(), code);
super(code, Code.FILE_EXTENSION.getDescription());
this.code = code;
}

@Deprecated
public FileExtensionException(String message, int code) {
super(message, code);
this.code = code;
}

public FileExtensionException(int code, String message) {
super(code, message);
this.code = code;
}

@Override
public int getCode() {
return code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class FileTooLargeException extends HttpException {

Expand All @@ -18,23 +19,29 @@ public class FileTooLargeException extends HttpException {
protected int httpCode = HttpStatus.PAYLOAD_TOO_LARGE.value();

public FileTooLargeException() {
super(Code.FILE_TOO_LARGE.getDescription(), Code.FILE_TOO_LARGE.getCode());
super(Code.FILE_TOO_LARGE.getCode(), Code.FILE_TOO_LARGE.getDescription());
}

public FileTooLargeException(String message) {
super(message);
}

public FileTooLargeException(int code) {
super(Code.FILE_TOO_LARGE.getDescription(), code);
super(code, Code.FILE_TOO_LARGE.getDescription());
this.code = code;
}

@Deprecated
public FileTooLargeException(String message, int code) {
super(message, code);
this.code = code;
}

public FileTooLargeException(int code, String message) {
super(code, message);
this.code = code;
}

@Override
public int getCode() {
return code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class FileTooManyException extends HttpException {

Expand All @@ -19,24 +20,30 @@ public class FileTooManyException extends HttpException {


public FileTooManyException() {
super(Code.FILE_TOO_MANY.getDescription(), Code.FILE_TOO_MANY.getCode());
super(Code.FILE_TOO_MANY.getCode(), Code.FILE_TOO_MANY.getDescription());
}

public FileTooManyException(String message) {
super(message);
}

public FileTooManyException(int code) {
super(Code.FILE_TOO_MANY.getDescription(), code);
super(code, Code.FILE_TOO_MANY.getDescription());
this.code = code;
}


@Deprecated
public FileTooManyException(String message, int code) {
super(message, code);
this.code = code;
}

public FileTooManyException(int code, String message) {
super(code, message);
this.code = code;
}

@Override
public int getCode() {
return code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class ForbiddenException extends HttpException {

Expand All @@ -19,22 +20,29 @@ public class ForbiddenException extends HttpException {


public ForbiddenException() {
super(Code.FORBIDDEN.getDescription(), Code.FORBIDDEN.getCode());
super(Code.FORBIDDEN.getCode(), Code.FORBIDDEN.getDescription());
}

public ForbiddenException(int code) {
super(code, Code.FORBIDDEN.getDescription());
this.code = code;
}

@Deprecated
public ForbiddenException(String message, int code) {
super(message, code);
this.code = code;
}

public ForbiddenException(int code, String message) {
super(code, message);
this.code = code;
}

public ForbiddenException(String message) {
super(message);
}

public ForbiddenException(int code) {
super(Code.FORBIDDEN.getDescription(), code);
this.code = code;
}

@Override
public int getCode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class HttpException extends RuntimeException implements BaseResponse {

Expand Down Expand Up @@ -43,17 +44,30 @@ public HttpException(int code, int httpCode) {
this.code = code;
}

@Deprecated
public HttpException(String message, int code) {
super(message);
this.code = code;
}

@Deprecated
public HttpException(String message, int code, int httpCode) {
super(message);
this.httpCode = httpCode;
this.code = code;
}

public HttpException(int code, String message) {
super(message);
this.code = code;
}

public HttpException(int code, String message, int httpCode) {
super(message);
this.code = code;
this.httpCode = httpCode;
}

public HttpException(Throwable cause, int code) {
super(cause);
this.code = code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author pedro@TaleLin
* @author Juzi@TaleLin
* @author colorful@TaleLin
*/
public class MethodNotAllowedException extends HttpException {

Expand All @@ -18,23 +19,29 @@ public class MethodNotAllowedException extends HttpException {
protected int httpCode = HttpStatus.METHOD_NOT_ALLOWED.value();

public MethodNotAllowedException() {
super(Code.METHOD_NOT_ALLOWED.getDescription(), Code.METHOD_NOT_ALLOWED.getCode());
super(Code.METHOD_NOT_ALLOWED.getCode(), Code.METHOD_NOT_ALLOWED.getDescription());
}

public MethodNotAllowedException(String message) {
super(message);
}

public MethodNotAllowedException(int code) {
super(Code.METHOD_NOT_ALLOWED.getDescription(), code);
super(code, Code.METHOD_NOT_ALLOWED.getDescription());
this.code = code;
}

@Deprecated
public MethodNotAllowedException(String message, int code) {
super(message, code);
this.code = code;
}

public MethodNotAllowedException(int code, String message) {
super(code, message);
this.code = code;
}

@Override
public int getCode() {
return code;
Expand Down
Loading