5 changed files with 65 additions and 10 deletions
@ -0,0 +1,47 @@ |
|||||
|
package com.bnyer.file.enumeration; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
|
||||
|
/** |
||||
|
* @Author qyh |
||||
|
* @Date 2023/4/29 18:58 |
||||
|
* @Description |
||||
|
*/ |
||||
|
public enum AddressEnum { |
||||
|
ICON(0,"icon/"), |
||||
|
HEAD(1,"head/"), |
||||
|
GIF(2,"gif/"), |
||||
|
PHONEBACK(3,"phoneBack/"), |
||||
|
FRIEND(4,"friend/"), |
||||
|
EMOJI(5,"emoji/"), |
||||
|
WATCH(6,"watch/"); |
||||
|
|
||||
|
|
||||
|
private Integer businessType; |
||||
|
private String fileAddress; |
||||
|
|
||||
|
AddressEnum(Integer businessType, String fileAddress) { |
||||
|
this.businessType = businessType; |
||||
|
this.fileAddress = fileAddress; |
||||
|
} |
||||
|
|
||||
|
public Integer getBusinessType() { |
||||
|
return businessType; |
||||
|
} |
||||
|
|
||||
|
public void setBusinessType(Integer businessType) { |
||||
|
this.businessType = businessType; |
||||
|
} |
||||
|
|
||||
|
public String getFileAddress() { |
||||
|
return fileAddress; |
||||
|
} |
||||
|
|
||||
|
public void setFileAddress(String fileAddress) { |
||||
|
this.fileAddress = fileAddress; |
||||
|
} |
||||
|
|
||||
|
public static AddressEnum getMessageEnum(Integer businessType) { |
||||
|
return Arrays.stream(AddressEnum.values()).filter(x -> x.businessType.equals(businessType)).findFirst().orElse(null); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue