权限改造后相关接口改动

This commit is contained in:
jinyu 2016-03-28 13:16:21 +08:00
parent 08ab083e57
commit 7f2c1ddaab
3 changed files with 458 additions and 276 deletions

View File

@ -115,10 +115,9 @@ public class OUserInfo implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "OUserInfo [isSysAdmin=" + isSysAdmin + ", isInnerAdmin=" return "OUserInfo [isSysAdmin=" + isSysAdmin + ", isInnerAdmin=" + isInnerAdmin + ", adminInfo=" + adminInfo
+ isInnerAdmin + ", adminInfo=" + adminInfo + ", corpInfo=" + ", corpInfo=" + corpInfo + ", agentInfo=" + agentInfo + ", authInfo=" + authInfo
+ corpInfo + ", agentInfo=" + agentInfo + ", authInfo=" + ", redirectLoginInfo=" + redirectLoginInfo + "]";
+ authInfo + ", redirectLoginInfo=" + redirectLoginInfo + "]";
} }
/** /**
@ -134,12 +133,17 @@ public class OUserInfo implements Serializable {
private static final long serialVersionUID = -4290240764958942370L; private static final long serialVersionUID = -4290240764958942370L;
/** /**
* 授权的应用信息 * 是否采用了新的授权没有该字段或者该字段为false表示是旧授权true表示是新授权
*/
@JSONField(name = "is_new_auth")
private boolean isNewAuth;
/**
* 授权的应用信息,新的权限体系其中通讯录权限以应用为节点
*/ */
@JSONField(name = "agent") @JSONField(name = "agent")
private List<AgentItem> agentItems; private List<AgentItem> agentItems;
/** /**
* 授权的通讯录部门 * 授权的通讯录部门,<font color="red">新的权限体系将废弃</font>
*/ */
@JSONField(name = "department") @JSONField(name = "department")
private List<DepartItem> departItems; private List<DepartItem> departItems;
@ -154,6 +158,14 @@ public class OUserInfo implements Serializable {
// ---------- setter 应该全部去掉 // ---------- setter 应该全部去掉
public boolean isNewAuth() {
return isNewAuth;
}
public void setNewAuth(boolean isNewAuth) {
this.isNewAuth = isNewAuth;
}
public void setAgentItems(List<AgentItem> agentItems) { public void setAgentItems(List<AgentItem> agentItems) {
this.agentItems = agentItems; this.agentItems = agentItems;
} }
@ -164,8 +176,8 @@ public class OUserInfo implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "AuthInfo [agentItems=" + agentItems + ", departItems=" return "AuthInfo [isNewAuth=" + isNewAuth + ", agentItems=" + agentItems + ", departItems=" + departItems
+ departItems + "]"; + "]";
} }
} }
@ -192,10 +204,16 @@ public class OUserInfo implements Serializable {
@JSONField(name = "appid") @JSONField(name = "appid")
private int appId; private int appId;
/** /**
* 授权方应用敏感权限组目前仅有get_location表示是否有权限设置应用获取地理位置的开关 * 授权方应用敏感权限组目前仅有get_location表示是否有权限设置应用获取地理位置的开关,
* <font color="red">新的权限体系将废弃</font>
*/ */
@JSONField(name = "api_group") @JSONField(name = "api_group")
private List<String> apiGroup; private List<String> apiGroup;
/**
* 应用对应的权限,<font color="red">新的权限体系</font>
*/
@JSONField(name = "privilege")
private PrivilegeInfo privilege;
public int getAuthType() { public int getAuthType() {
return authType; return authType;
@ -221,6 +239,14 @@ public class OUserInfo implements Serializable {
// ---------- setter 应该全部去掉 // ---------- setter 应该全部去掉
public PrivilegeInfo getPrivilege() {
return privilege;
}
public void setPrivilege(PrivilegeInfo privilege) {
this.privilege = privilege;
}
public void setAuthType(int authType) { public void setAuthType(int authType) {
this.authType = authType; this.authType = authType;
} }
@ -235,8 +261,8 @@ public class OUserInfo implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "AgentItem [authType=" + authType + ", appId=" + appId return "AgentItem [authType=" + authType + ", appId=" + appId + ", apiGroup=" + apiGroup + ", privilege="
+ ", apiGroup=" + apiGroup + ", " + super.toString() + "]"; + privilege + ", " + super.toString() + "]";
} }
} }
@ -269,8 +295,7 @@ public class OUserInfo implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "DepartItem [writable=" + writable + ", " + super.toString() return "DepartItem [writable=" + writable + ", " + super.toString() + "]";
+ "]";
} }
} }
} }

View File

@ -0,0 +1,122 @@
package com.foxinmy.weixin4j.qy.model;
import java.io.Serializable;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
/**
* 权限信息
*
* @className Privilege
* @author jy
* @date 2016年3月28日
* @since JDK 1.6
* @see
*/
public class PrivilegeInfo implements Serializable {
private static final long serialVersionUID = 2689295767648714897L;
/**
* 权限级别
*/
private int level;
/**
* 应用可见范围成员
*/
@JSONField(name = "allow_user")
private List<String> allowUserIds;
/**
* 应用可见范围部门
*/
@JSONField(name = "allow_party")
private List<Integer> allowPartyIds;
/**
* 应用可见范围标签
*/
@JSONField(name = "allow_tag")
private List<Integer> allowTagIds;
/**
* 额外通讯录成员
*/
@JSONField(name = "extra_user")
private List<String> extraUserIds;
/**
* 额外通讯录部门
*/
@JSONField(name = "extra_party")
private List<Integer> extraPartyIds;
/**
* 额外通讯录标签
*/
@JSONField(name = "extra_tag")
private List<Integer> extraTagIds;
public int getLevel() {
return level;
}
@JSONField(serialize = false)
public PrivilegeLevel getFormatLevel() {
return PrivilegeLevel.values()[level - 1];
}
public void setLevel(int level) {
this.level = level;
}
public List<String> getAllowUserIds() {
return allowUserIds;
}
public void setAllowUserIds(List<String> allowUserIds) {
this.allowUserIds = allowUserIds;
}
public List<Integer> getAllowPartyIds() {
return allowPartyIds;
}
public void setAllowPartyIds(List<Integer> allowPartyIds) {
this.allowPartyIds = allowPartyIds;
}
public List<Integer> getAllowTagIds() {
return allowTagIds;
}
public void setAllowTagIds(List<Integer> allowTagIds) {
this.allowTagIds = allowTagIds;
}
public List<String> getExtraUserIds() {
return extraUserIds;
}
public void setExtraUserIds(List<String> extraUserIds) {
this.extraUserIds = extraUserIds;
}
public List<Integer> getExtraPartyIds() {
return extraPartyIds;
}
public void setExtraPartyIds(List<Integer> extraPartyIds) {
this.extraPartyIds = extraPartyIds;
}
public List<Integer> getExtraTagIds() {
return extraTagIds;
}
public void setExtraTagIds(List<Integer> extraTagIds) {
this.extraTagIds = extraTagIds;
}
@Override
public String toString() {
return "PrivilegeInfo [level=" + level + ", allowUserIds=" + allowUserIds + ", allowPartyIds=" + allowPartyIds
+ ", allowTagIds=" + allowTagIds + ", extraUserIds=" + extraUserIds + ", extraPartyIds=" + extraPartyIds
+ ", extraTagIds=" + extraTagIds + "]";
}
}

View File

@ -0,0 +1,35 @@
package com.foxinmy.weixin4j.qy.model;
/**
* 权限级别
*
* @className Privilege
* @author jy
* @date 2016年3月28日
* @since JDK 1.6
* @see
*/
public enum PrivilegeLevel {
/**
* 标识只读
*/
IDENTIFYING_READABLE(1),
/**
* 信息只读
*/
INFORMATION_READABLE(2),
/**
* 信息读写
*/
INFORMATION_READABLE$WRITABLE(3);
private int level;
PrivilegeLevel(int level) {
this.level = level;
}
public int getLevel() {
return this.level;
}
}