package com.ots.project.tool.sms; import lombok.Getter; import lombok.Setter; @Getter @Setter public class ResponseSms { private String command; private String cpid; private String cppwd; private String mtmsgid; private String mtstat; private String mterrcode; @Getter public enum Mterrcode { RET_000("000", "成功"), RET_401("401", "无下行权限(余额不足)"), RET_402("402", "内容含非法关键字"), RET_403("403", "内容未含白名单关键字"), RET_404("404", "其他错误导致信息未能下发(可咨询客服)"), RET_501("501", "未知错误(可咨询客服)"), RET_502("502", "程序异常:"); private String code; private String message; Mterrcode(String code, String message) { this.code = code; this.message = message; } public static String getEnumMessageBycode(String code) { for (Mterrcode inner : Mterrcode.class.getEnumConstants()) { if (code.equals(inner.getCode())) { return inner.getMessage(); } } return null; } } }