Skip to content

Commit

Permalink
+企业微信的卡片消息;
Browse files Browse the repository at this point in the history
+企业微信的文件消息;
+微信公众号的短网址功能;
  • Loading branch information
Yunfeng committed Mar 2, 2021
1 parent 5aa3ea2 commit 4a24fb7
Show file tree
Hide file tree
Showing 57 changed files with 2,017 additions and 699 deletions.
46 changes: 16 additions & 30 deletions 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.15-SNAPSHOT</version>
<version>2.1.5-SNAPSHOT</version>
<packaging>pom</packaging>

<name>weniu</name>
Expand Down Expand Up @@ -34,12 +34,13 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springframework.version>5.2.9.RELEASE</springframework.version>
<hibernate.version>5.4.22.Final</hibernate.version>
<java.version>1.8</java.version>
<springframework.version>5.3.4</springframework.version>
<hibernate.version>5.4.28.Final</hibernate.version>

<httpclient.version>4.5.13</httpclient.version>

<junit.jupiter.version>5.5.2</junit.jupiter.version>
<junit.jupiter.version>5.7.1</junit.jupiter.version>
<log4j.version>2.12.1</log4j.version>

<ognl.version>3.2.11</ognl.version>
Expand Down Expand Up @@ -155,7 +156,7 @@
<dependency>
<groupId>cn.buk.common</groupId>
<artifactId>buk-common-util</artifactId>
<version>2.2.5</version>
<version>2.2.21</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -187,7 +188,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.60</version>
<version>1.2.75</version>
</dependency>

<dependency>
Expand All @@ -198,12 +199,12 @@
</dependency>

<!-- test -->
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.junit.vintage</groupId>-->
<!-- <artifactId>junit-vintage-engine</artifactId>-->
<!-- <version>${junit.jupiter.version}</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -245,27 +246,12 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version> <!-- this is critical -->
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-checkstyle-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<logViolationsToConsole>true</logViolationsToConsole>
<checkstyleRules>
<module name="JavadocMethod">
<!-- <property name="scope" value="public"/>-->
<!-- <property name="allowUndeclaredRTE" value="true"/>-->
<!-- <property name="allowMissingParamTags" value="false"/>-->
</module>
</checkstyleRules>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>


</plugins>
</build>

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.15-SNAPSHOT</version>
<version>2.1.5-SNAPSHOT</version>
</parent>

<artifactId>weniu-dao</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ protected EntityManager createEntityManager() {

/**
* 保存新对象
* @param object
* @return
* 1 表示成功
* -100 表示出错
Expand Down
10 changes: 0 additions & 10 deletions weniu-dao/src/main/java/cn/buk/api/wechat/dao/WeixinDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,18 @@ public interface WeixinDao {

/**
* 保存Token
* @param token
* @return
*/
int createWeixinOauthToken(WeixinOauthToken token);

int createWeixinAccessTime(String weixinOpenId, int weixinId);

/**
* 获取当前有效的token
*
* @return
*/
Token retrieveWeixinToken(int weixinId, int weixinType, int msgType);

/**
* 保存Token
*
* @param token
* @return
*/
int createWeixinToken(Token token);

Expand Down Expand Up @@ -70,7 +63,6 @@ public interface WeixinDao {
* 获取企业微信的设置参数
* @param enterpriseId 企业ID
* @param msgType 消息类型
* @return
*/
WeixinEntConfig getWeixinEntConfig(int enterpriseId, int msgType);

Expand Down Expand Up @@ -108,8 +100,6 @@ public interface WeixinDao {

/**
* 获取微信服务号的配置信息
* @param enterpriseId
* @return
*/
WeixinServiceConfig getWeixinServiceConfig(int enterpriseId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Token retrieveWeixinToken(final int weixinId, final int weixinType, final
.setParameter("msgType", msgType)
.setMaxResults(1)
.getResultList();
if (tokens == null || tokens.size() == 0)
if (tokens == null || tokens.isEmpty())
return null;
else
return tokens.get(0);
Expand Down Expand Up @@ -287,9 +287,6 @@ public int updateWeixinMaterial(WeixinMaterial wm) {

/**
* 本地查找微信永久素材
* @param enterpriseId
* @param sc
* @return
*/
public List<WeixinMaterial> searchMaterials(int enterpriseId, CommonSearchCriteria sc) {
List<WeixinMaterial> results = null;
Expand Down Expand Up @@ -704,8 +701,6 @@ public int saveWwProviderToken(int enterpriseId, String suiteId, String suiteAcc

/**
* 保存授权企业的信息
* @param corpInfo
* @return
*/
public int saveWwpAuthCorpInfo(WwProviderAuthCorpInfo corpInfo) {
int retCode = 0;
Expand Down Expand Up @@ -851,8 +846,6 @@ public int cancelSuiteAuthInfo(int enterpriseId, String suiteId, String authCorp

/**
* 获取微信服务号的API配置
* @param enterpriseId
* @return
*/
public WeixinServiceConfig getWeixinServiceConfig(int enterpriseId) {
EntityManager em = createEntityManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
/**
*
* @author yfdai
* @date 16/7/9
*
* 企业微信应用的API参数
*/
@Entity
Expand Down
10 changes: 5 additions & 5 deletions 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.15-SNAPSHOT</version>
<version>2.1.5-SNAPSHOT</version>
</parent>

<name>weniu-service</name>
Expand Down Expand Up @@ -32,10 +32,10 @@
<artifactId>httpclient</artifactId>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.junit.vintage</groupId>-->
<!-- <artifactId>junit-vintage-engine</artifactId>-->
<!-- </dependency>-->

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cn.buk.api.wechat.dto;

import com.alibaba.fastjson.annotation.JSONField;

public class Long2ShortUrlDto extends BaseResponse {

// {"errcode":0,"errmsg":"ok","short_url":"http:\/\/w.url.cn\/s\/AvCo6Ih"}

@JSONField(name = "short_url")
private String shortUrl;

public String getShortUrl() {
return shortUrl;
}

public void setShortUrl(String shortUrl) {
this.shortUrl = shortUrl;
}
}
95 changes: 0 additions & 95 deletions weniu-service/src/main/java/cn/buk/api/wechat/dto/TextMessage.java

This file was deleted.

Loading

0 comments on commit 4a24fb7

Please sign in to comment.