陈士柏 2 лет назад
Родитель
Сommit
25c56f04af

+ 89 - 0
src/main/java/com/template/model/weixin/AccessToken.java

@@ -0,0 +1,89 @@
+package com.template.model.weixin;
+
+/**
+ * <p>Title: AccessToken</p>
+ * <p>Description: 通过code获取access_token</p>
+ * @author fengyong
+ * @date 2018年9月4日
+ */
+public class AccessToken {
+	
+	/**
+	 * 接口调用凭证
+	 */
+	private String access_token;
+	
+	/**
+	 * access_token接口调用凭证超时时间,单位(秒)
+	 */
+	private Integer expires_in;
+	
+	/**
+	 * 用户刷新access_token
+	 */
+	private String refresh_token;
+	
+	/**
+	 * 授权用户唯一标识
+	 */
+	private String openid;
+	
+	/**
+	 * 用户授权的作用域,使用逗号(,)分隔
+	 */
+	private String scope;
+	
+	/**
+	 * 当且仅当该网站应用已获得该用户的userinfo授权时,才会出现该字段。
+	 */
+	private String unionid;
+
+	public String getAccess_token() {
+		return access_token;
+	}
+
+	public void setAccess_token(String access_token) {
+		this.access_token = access_token;
+	}
+
+	public Integer getExpires_in() {
+		return expires_in;
+	}
+
+	public void setExpires_in(Integer expires_in) {
+		this.expires_in = expires_in;
+	}
+
+	public String getRefresh_token() {
+		return refresh_token;
+	}
+
+	public void setRefresh_token(String refresh_token) {
+		this.refresh_token = refresh_token;
+	}
+
+	public String getOpenid() {
+		return openid;
+	}
+
+	public void setOpenid(String openid) {
+		this.openid = openid;
+	}
+
+	public String getScope() {
+		return scope;
+	}
+
+	public void setScope(String scope) {
+		this.scope = scope;
+	}
+
+	public String getUnionid() {
+		return unionid;
+	}
+
+	public void setUnionid(String unionid) {
+		this.unionid = unionid;
+	}
+
+}

+ 36 - 0
src/main/java/com/template/model/weixin/AuthorAndGroup.java

@@ -0,0 +1,36 @@
+package com.template.model.weixin;
+
+import com.template.model.pojo.SmartAuthorGroup;
+
+import java.util.Date;
+
+public class AuthorAndGroup {
+
+    public SmartAuthorGroup smartAuthorGroup;
+    public String department_view;
+    public String department_manage;
+
+    public SmartAuthorGroup getSmartAuthorGroup() {
+        return smartAuthorGroup;
+    }
+
+    public void setSmartAuthorGroup(SmartAuthorGroup smartAuthorGroup) {
+        this.smartAuthorGroup = smartAuthorGroup;
+    }
+
+    public String getDepartment_view() {
+        return department_view;
+    }
+
+    public void setDepartment_view(String department_view) {
+        this.department_view = department_view;
+    }
+
+    public String getDepartment_manage() {
+        return department_manage;
+    }
+
+    public void setDepartment_manage(String department_manage) {
+        this.department_manage = department_manage;
+    }
+}

+ 27 - 0
src/main/java/com/template/model/weixin/AuthorAndGroup2.java

@@ -0,0 +1,27 @@
+package com.template.model.weixin;
+
+import com.template.model.pojo.SmartAuthorGroup;
+
+import java.util.List;
+
+public class AuthorAndGroup2 {
+
+    public SmartAuthorGroup smartAuthorGroup;
+    public List<userAuthor> userAuthors;
+
+    public SmartAuthorGroup getSmartAuthorGroup() {
+        return smartAuthorGroup;
+    }
+
+    public void setSmartAuthorGroup(SmartAuthorGroup smartAuthorGroup) {
+        this.smartAuthorGroup = smartAuthorGroup;
+    }
+
+    public List<userAuthor> getUserAuthors() {
+        return userAuthors;
+    }
+
+    public void setUserAuthors(List<userAuthor> userAuthors) {
+        this.userAuthors = userAuthors;
+    }
+}

+ 101 - 0
src/main/java/com/template/model/weixin/AuthorListGroup.java

@@ -0,0 +1,101 @@
+package com.template.model.weixin;
+
+import lombok.Builder;
+
+import java.util.Date;
+import java.util.List;
+
+@Builder
+public class AuthorListGroup {
+
+    public Integer id;
+    public Integer parentId;
+    public String name;
+    public String userId;
+    public String applyId;
+    public Date updateTime;
+    public String createUser;
+    public String updateUser;
+    public Integer deleted;
+    public List<AuthorListGroup> authorListGroups;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Integer parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getApplyId() {
+        return applyId;
+    }
+
+    public void setApplyId(String applyId) {
+        this.applyId = applyId;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getCreateUser() {
+        return createUser;
+    }
+
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser;
+    }
+
+    public String getUpdateUser() {
+        return updateUser;
+    }
+
+    public void setUpdateUser(String updateUser) {
+        this.updateUser = updateUser;
+    }
+
+    public Integer getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(Integer deleted) {
+        this.deleted = deleted;
+    }
+
+    public List<AuthorListGroup> getAuthorListGroups() {
+        return authorListGroups;
+    }
+
+    public void setAuthorListGroups(List<AuthorListGroup> authorListGroups) {
+        this.authorListGroups = authorListGroups;
+    }
+}

+ 43 - 0
src/main/java/com/template/model/weixin/HttpParame.java

@@ -0,0 +1,43 @@
+package com.template.model.weixin;
+
+/**
+ * Title: HttpParame Description: 请求参数
+ * @author fengyong
+ * @date 2018年9月3日
+ */
+public class HttpParame {
+
+	// 应用唯一标识
+	public static final String APPID = "appid";
+
+	// 密匙
+	public static final String SECRET = "secret";
+
+	// 微信用户唯一标识
+	public static final String OPENID = "openid";
+
+	// 接口调用凭证
+	public static final String ACCESS_TOKEN = "access_token";
+
+	// 回调地址
+	public static final String REDIRECT_URI = "redirect_uri";
+
+	// 回调地址
+	public static final String BIND_URI = "bind_uri";
+
+	// 前端地址
+	public static final String FRONT_URI = "https://www.campussmartlife.com/smartManage";
+
+	// 网页授权回调地址
+	public static final String AUTHORIZATION_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect";
+
+	// 网页授权绑定地址
+	public static final String BIND_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect";
+
+	// 通过code获取access_token
+	public static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
+
+	// 此接口用于获取用户个人信息 UnionID机制
+	public static final String GET_UNIONID_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID";
+
+}

+ 65 - 0
src/main/java/com/template/model/weixin/Result.java

@@ -0,0 +1,65 @@
+package com.template.model.weixin;
+
+/**
+ * Title: Result
+ * Description: 返回结果包装对象使用
+ * @author fengyong
+ * @date 2018年9月5日
+ */
+public class Result {
+	/**
+	 * 状态
+	 */
+	private Object status;
+	/**
+	 * 结果
+	 */
+	private Object result;
+	/**
+	 * 消息
+	 */
+	private String message;
+
+	public Result() {
+	}
+
+	public Result(Object status, String message) {
+		this.status = status;
+		this.message = message;
+	}
+
+	public Result(Object status, Object result) {
+		this.status = status;
+		this.result = result;
+	}
+
+	public Result(Object status, Object result, String message) {
+		this.status = status;
+		this.result = result;
+		this.message = message;
+	}
+
+	public Object getStatus() {
+		return status;
+	}
+
+	public void setStatus(Object status) {
+		this.status = status;
+	}
+
+	public Object getResult() {
+		return result;
+	}
+
+	public void setResult(Object result) {
+		this.result = result;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+}

+ 135 - 0
src/main/java/com/template/model/weixin/WechatUserUnionID.java

@@ -0,0 +1,135 @@
+package com.template.model.weixin;
+
+import java.util.List;
+
+/**
+ * Title: WechatUserUnionID
+ * Description: 获取用户个人信息(UnionID机制)
+ * @author fengyong
+ * @date 2018年9月5日
+ */
+public class WechatUserUnionID {
+
+	/**
+	 * 普通用户的标识,对当前开发者帐号唯一
+	 */
+	private String openid;
+
+	/**
+	 * 普通用户昵称
+	 */
+	private String nickname;
+
+	/**
+	 * 普通用户性别,1为男性,2为女性
+	 */
+	private Integer sex;
+
+	/**
+	 * 普通用户个人资料填写的省份
+	 */
+	private String province;
+
+	/**
+	 * 普通用户个人资料填写的城市
+	 */
+	private String city;
+
+	/**
+	 * 国家,如中国为CN
+	 */
+	private String country;
+
+	/**
+	 * 用户头像,最后一个数值代表正方形头像大小 (有0、46、64、96、132数值可选,0代表640*640正方形头像) 用户没有头像时该项为空
+	 */
+	private String headimgurl;
+
+	/**
+	 * 用户特权信息,json数组,如微信沃卡用户为(chinaunicom)
+	 */
+	private List<String> privilege;
+
+	/**
+	 * 用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。
+	 */
+	private String unionid;
+
+	public String getOpenid() {
+		return openid;
+	}
+
+	public void setOpenid(String openid) {
+		this.openid = openid;
+	}
+
+	public String getNickname() {
+		return nickname;
+	}
+
+	public void setNickname(String nickname) {
+		this.nickname = nickname;
+	}
+
+	public Integer getSex() {
+		return sex;
+	}
+
+	public void setSex(Integer sex) {
+		this.sex = sex;
+	}
+	
+	public String getSexStr(){
+		if (getSex() != null) return getSex() == 1 ? "男" : "女";
+		return "";
+	}
+
+	public String getProvince() {
+		return province;
+	}
+
+	public void setProvince(String province) {
+		this.province = province;
+	}
+
+	public String getCity() {
+		return city;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public String getCountry() {
+		return country;
+	}
+
+	public void setCountry(String country) {
+		this.country = country;
+	}
+
+	public String getHeadimgurl() {
+		return headimgurl;
+	}
+
+	public void setHeadimgurl(String headimgurl) {
+		this.headimgurl = headimgurl;
+	}
+
+	public List<String> getPrivilege() {
+		return privilege;
+	}
+
+	public void setPrivilege(List<String> privilege) {
+		this.privilege = privilege;
+	}
+
+	public String getUnionid() {
+		return unionid;
+	}
+
+	public void setUnionid(String unionid) {
+		this.unionid = unionid;
+	}
+
+}

+ 42 - 0
src/main/java/com/template/model/weixin/userAuthor.java

@@ -0,0 +1,42 @@
+package com.template.model.weixin;
+
+public class userAuthor {
+
+    public Integer userId;
+    public String department_view;
+    public String department_manage;
+    public Integer deleted;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getDepartment_view() {
+        return department_view;
+    }
+
+    public void setDepartment_view(String department_view) {
+        this.department_view = department_view;
+    }
+
+    public String getDepartment_manage() {
+        return department_manage;
+    }
+
+    public void setDepartment_manage(String department_manage) {
+        this.department_manage = department_manage;
+    }
+
+    public Integer getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(Integer deleted) {
+        this.deleted = deleted;
+    }
+
+}