BizException.java 520 B

12345678910111213141516171819202122232425
  1. package com.usky.rule.exception;
  2. import org.springframework.http.HttpStatus;
  3. public class BizException extends RuntimeException {
  4. private final String code;
  5. public BizException(String message) {
  6. super(message);
  7. this.code = "200001";
  8. }
  9. public BizException(String code, String message) {
  10. super(message);
  11. this.code = code;
  12. }
  13. public String getCode() {
  14. return this.code;
  15. }
  16. public HttpStatus getHttpStatus() {
  17. return HttpStatus.OK;
  18. }
  19. }