mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-03 04:13:37 +08:00
🎨 #1432 企业微信部门类增加英文名称属性
This commit is contained in:
parent
e761174270
commit
704a389ddb
@ -6,16 +6,17 @@ import lombok.Data;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
/**
|
||||
* 微信部门.
|
||||
* 企业微信的部门.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
@Data
|
||||
public class WxCpDepart implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5028321625140879571L;
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String enName;
|
||||
private Long parentId;
|
||||
private Long order;
|
||||
|
||||
|
@ -28,6 +28,7 @@ import me.chanjar.weixin.cp.bean.WxCpDepart;
|
||||
public class WxCpDepartGsonAdapter implements JsonSerializer<WxCpDepart>, JsonDeserializer<WxCpDepart> {
|
||||
private static final String ID = "id";
|
||||
private static final String NAME = "name";
|
||||
private static final String EN_NAME = "name_en";
|
||||
private static final String PARENT_ID = "parentid";
|
||||
private static final String ORDER = "order";
|
||||
|
||||
@ -40,6 +41,9 @@ public class WxCpDepartGsonAdapter implements JsonSerializer<WxCpDepart>, JsonDe
|
||||
if (group.getName() != null) {
|
||||
json.addProperty(NAME, group.getName());
|
||||
}
|
||||
if (group.getEnName() != null) {
|
||||
json.addProperty(EN_NAME, group.getEnName());
|
||||
}
|
||||
if (group.getParentId() != null) {
|
||||
json.addProperty(PARENT_ID, group.getParentId());
|
||||
}
|
||||
@ -60,6 +64,9 @@ public class WxCpDepartGsonAdapter implements JsonSerializer<WxCpDepart>, JsonDe
|
||||
if (departJson.get(NAME) != null && !departJson.get(NAME).isJsonNull()) {
|
||||
depart.setName(GsonHelper.getAsString(departJson.get(NAME)));
|
||||
}
|
||||
if (departJson.get(EN_NAME) != null && !departJson.get(EN_NAME).isJsonNull()) {
|
||||
depart.setEnName(GsonHelper.getAsString(departJson.get(EN_NAME)));
|
||||
}
|
||||
if (departJson.get(ORDER) != null && !departJson.get(ORDER).isJsonNull()) {
|
||||
depart.setOrder(GsonHelper.getAsLong(departJson.get(ORDER)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user