Skip to content

Commit

Permalink
使用snsapi_userinfo方式进行公众号网页授权
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunfeng committed Oct 26, 2020
1 parent 29ff28b commit 391362d
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 213 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>cn.buk.api.wechat</groupId>
<artifactId>weniu</artifactId>
<version>2.0.10-SNAPSHOT</version>
<version>2.0.12-SNAPSHOT</version>
<packaging>pom</packaging>

<name>weniu</name>
Expand Down
2 changes: 1 addition & 1 deletion weniu-dao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.buk.api.wechat</groupId>
<artifactId>weniu</artifactId>
<version>2.0.10-SNAPSHOT</version>
<version>2.0.12-SNAPSHOT</version>
</parent>

<artifactId>weniu-dao</artifactId>
Expand Down
12 changes: 7 additions & 5 deletions weniu-dao/src/main/java/cn/buk/api/wechat/dao/WeixinDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public Token retrieveWeixinToken(final int weixinId, final int weixinType, final
EntityManager em = createEntityManager();
try {
List<Token> tokens = em.createQuery("select o from Token o " +
"where o.weixinId = :weixinId and o.weixinType = :weixinType and o.msgType = :msgType " +
"where o.enterpriseId = :weixinId and o.weixinType = :weixinType and o.msgType = :msgType " +
"order by o.id desc", Token.class)
.setParameter("weixinId", weixinId)
.setParameter("weixinType", weixinType)
Expand Down Expand Up @@ -185,7 +185,7 @@ public WeixinTemplate searchWeixinTemplate(int ownerId, String id) {
EntityManager em = createEntityManager();
try {
List<WeixinTemplate> list = em.createQuery("select o from WeixinTemplate o " +
"where o.ownerId = :ownerId and o.businessId = :id", WeixinTemplate.class)
"where o.enterpriseId = :ownerId and o.businessId = :id", WeixinTemplate.class)
.setParameter("ownerId",ownerId)
.setParameter("id", id)
.getResultList();
Expand All @@ -202,7 +202,7 @@ public List<WeixinTemplate> searchWeixinTemplates(int ownerId) {
EntityManager em = createEntityManager();
try {
List<WeixinTemplate> list = em.createQuery("select o from WeixinTemplate o " +
"where o.ownerId = :ownerId ", WeixinTemplate.class)
"where o.enterpriseId = :ownerId ", WeixinTemplate.class)
.setParameter("ownerId",ownerId)
.getResultList();

Expand Down Expand Up @@ -347,7 +347,8 @@ public List<WeixinMaterial> searchMaterials(int enterpriseId, CommonSearchCriter
public List<WeixinMaterial> searchMaterials(int enterpriseId, String mediaId) {
EntityManager em = createEntityManager();
try {
return em.createQuery("select o from WeixinMaterial o where o.ownerId = :ownerId and o.mediaId = :mediaId")
return em.createQuery("select o from WeixinMaterial o " +
"where o.enterpriseId = :ownerId and o.mediaId = :mediaId", WeixinMaterial.class)
.setParameter("ownerId", enterpriseId)
.setParameter("mediaId", mediaId)
.getResultList();
Expand All @@ -374,7 +375,8 @@ public WeixinMaterial searchWeixinMaterial(int weixinId, int id) {
public List<WeixinNews> searchWeixinNews(int weixinId) {
EntityManager em = createEntityManager();
try {
return em.createQuery("select o from WeixinNews o where o.enterpriseId = :enterpriseId order by o.displayOrder")
return em.createQuery("select o from WeixinNews o " +
"where o.enterpriseId = :enterpriseId order by o.displayOrder", WeixinNews.class)
.setParameter("enterpriseId", weixinId)
.getResultList();

Expand Down
2 changes: 1 addition & 1 deletion weniu-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.buk.api.wechat</groupId>
<artifactId>weniu</artifactId>
<version>2.0.10-SNAPSHOT</version>
<version>2.0.12-SNAPSHOT</version>
</parent>

<name>weniu-service</name>
Expand Down
Loading

0 comments on commit 391362d

Please sign in to comment.