BlueWhaleException.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.seecoder.BlueWhale.exception;
  2. /**
  3. * @Author: DingXiaoyu
  4. * @Date: 0:26 2023/11/26
  5. * 你可以在这里自定义Exception
  6. */
  7. public class BlueWhaleException extends RuntimeException{
  8. public BlueWhaleException(String message){
  9. super(message);
  10. }
  11. public static BlueWhaleException phoneAlreadyExists(){
  12. return new BlueWhaleException("手机号已经存在!");
  13. }
  14. public static BlueWhaleException notLogin(){
  15. return new BlueWhaleException("未登录!");
  16. }
  17. public static BlueWhaleException phoneOrPasswordError(){
  18. return new BlueWhaleException("手机号或密码错误!");
  19. }
  20. public static BlueWhaleException fileUploadFail(){
  21. return new BlueWhaleException("文件上传失败!");
  22. }
  23. public static BlueWhaleException nameAlreadyExists(){
  24. return new BlueWhaleException("名称已经存在!");
  25. }
  26. public static BlueWhaleException storeNotExists(){
  27. return new BlueWhaleException("店铺不存在!");
  28. }
  29. public static BlueWhaleException productNotExists(){
  30. return new BlueWhaleException("商品不存在!");
  31. }
  32. }