6 changed files with 124 additions and 15 deletions
@ -0,0 +1,57 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
*/ |
||||
|
public enum ChannelEnum { |
||||
|
//通知渠道 0小程序通知,1短信通知
|
||||
|
APP("0", "小程序通知"), |
||||
|
MESSAGE("1", "短信通知"), |
||||
|
ALL("2", "小程序通知,短信通知"); |
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
ChannelEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public static String getName(String code) { |
||||
|
ChannelEnum[] houseTypeEnums = values(); |
||||
|
for (ChannelEnum houseTypeEnum : houseTypeEnums) { |
||||
|
if (houseTypeEnum.getCode() == code) { |
||||
|
return houseTypeEnum.getName(); |
||||
|
} |
||||
|
} |
||||
|
return EpmetErrorCode.SERVER_ERROR.getMsg(); |
||||
|
} |
||||
|
|
||||
|
public static String getCode(String name) { |
||||
|
ChannelEnum[] houseTypeEnums = values(); |
||||
|
for (ChannelEnum houseTypeEnum : houseTypeEnums) { |
||||
|
if (houseTypeEnum.getName().equals(name)) { |
||||
|
return houseTypeEnum.getCode(); |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/3/28 16:13 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcNoticeFormDTO extends PageFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 7392894573654015338L; |
||||
|
private String customerId; |
||||
|
@NotBlank(message = "身份证号不能为空", groups = DefaultGroup.class) |
||||
|
private String idCard; |
||||
|
} |
Loading…
Reference in new issue