BusinessPrefixEnum.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.hrsk.cloud.eg.constant;
  2. /**
  3. * @description: BusinessPrefixEnum
  4. * @author zhangyy
  5. * @date 2024/8/28 14:48
  6. * @version 1.0
  7. */
  8. public enum BusinessPrefixEnum {
  9. CHECK_INTO_PREFIX("CHECK_INTO","撞库API前缀"),
  10. APPLY_PREFIX("APPLY","进件API前缀")
  11. ;
  12. private String code;
  13. private String msg;
  14. public String getMsg() {
  15. return msg;
  16. }
  17. public void setMsg(String msg) {
  18. this.msg = msg;
  19. }
  20. public String getCode() {
  21. return code;
  22. }
  23. public void setCode(String code) {
  24. this.code = code;
  25. }
  26. BusinessPrefixEnum (String code,String msg) {
  27. this.code = code;
  28. this.msg = msg;
  29. }
  30. /**
  31. * @description: 获取code
  32. * @param:
  33. * @return:
  34. * @author zhangyy
  35. * @date: 2024/8/28 14:51
  36. */
  37. public static BusinessPrefixEnum getByCode(String code) {
  38. for (BusinessPrefixEnum dataStatus : values()) {
  39. if (dataStatus.getCode().equals(code)) {
  40. return dataStatus;
  41. }
  42. }
  43. return null;
  44. }
  45. /**
  46. * @description: 获取信息
  47. * @param:
  48. * @return:
  49. * @author zhangyy
  50. * @date: 2024/8/28 14:51
  51. */
  52. public static String getByMsg(String code) {
  53. for (BusinessPrefixEnum prefixEnum : values()) {
  54. if (prefixEnum.getCode().equals(code)) {
  55. return prefixEnum.getMsg();
  56. }
  57. }
  58. return null;
  59. }
  60. }