-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/io/github/dbstarll/weixin/sdk/SessionResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package io.github.dbstarll.weixin.sdk; | ||
|
||
import java.io.Serializable; | ||
import java.util.StringJoiner; | ||
|
||
public final class SessionResponse implements Serializable { | ||
private String sessionKey; | ||
private String unionid; | ||
private String openid; | ||
|
||
/** | ||
* 获得会话密钥. | ||
* | ||
* @return 会话密钥 | ||
*/ | ||
public String getSessionKey() { | ||
return sessionKey; | ||
} | ||
|
||
void setSessionKey(final String sessionKey) { | ||
this.sessionKey = sessionKey; | ||
} | ||
|
||
/** | ||
* 获得用户在开放平台的唯一标识符,若当前小程序已绑定到微信开放平台帐号下会返回. | ||
* | ||
* @return 用户在开放平台的唯一标识符 | ||
*/ | ||
public String getUnionid() { | ||
return unionid; | ||
} | ||
|
||
void setUnionid(final String unionid) { | ||
this.unionid = unionid; | ||
} | ||
|
||
/** | ||
* 获得用户唯一标识. | ||
* | ||
* @return 用户唯一标识 | ||
*/ | ||
public String getOpenid() { | ||
return openid; | ||
} | ||
|
||
void setOpenid(final String openid) { | ||
this.openid = openid; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new StringJoiner(", ", SessionResponse.class.getSimpleName() + "[", "]") | ||
.add("openid='" + getOpenid() + "'") | ||
.add("sessionKey='" + getSessionKey() + "'") | ||
.add("unionid='" + getUnionid() + "'") | ||
.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters