Browse Source

移除模版消息/QRcode

heavyrian2012 3 years ago
parent
commit
3e8baa544d
63 changed files with 209 additions and 1448 deletions
  1. 17 0
      release.sh
  2. 1 1
      server/src/main/java/com/github/niefy/common/exception/RRExceptionHandler.java
  3. 1 1
      server/src/main/java/com/github/niefy/common/utils/Constant.java
  4. 1 1
      server/src/main/java/com/github/niefy/config/SwaggerConfig.java
  5. 8 8
      server/src/main/java/com/github/niefy/modules/wx/controller/WxAuthController.java
  6. 5 5
      server/src/main/java/com/github/niefy/modules/wx/controller/WxMpPortalController.java
  7. 2 2
      server/src/main/java/com/github/niefy/modules/wx/controller/WxUserController.java
  8. 0 11
      server/src/main/java/com/github/niefy/modules/wx/dao/MsgTemplateMapper.java
  9. 0 9
      server/src/main/java/com/github/niefy/modules/wx/dao/TemplateMsgLogMapper.java
  10. 1 1
      server/src/main/java/com/github/niefy/modules/wx/dao/WxMsgMapper.java
  11. 0 19
      server/src/main/java/com/github/niefy/modules/wx/dao/WxQrCodeMapper.java
  12. 0 56
      server/src/main/java/com/github/niefy/modules/wx/entity/MsgTemplate.java
  13. 0 56
      server/src/main/java/com/github/niefy/modules/wx/entity/TemplateMsgLog.java
  14. 2 2
      server/src/main/java/com/github/niefy/modules/wx/entity/WxMsg.java
  15. 0 64
      server/src/main/java/com/github/niefy/modules/wx/entity/WxQrCode.java
  16. 1 1
      server/src/main/java/com/github/niefy/modules/wx/entity/WxUser.java
  17. 0 33
      server/src/main/java/com/github/niefy/modules/wx/form/TemplateMsgBatchForm.java
  18. 0 24
      server/src/main/java/com/github/niefy/modules/wx/form/TemplateMsgForm.java
  19. 0 17
      server/src/main/java/com/github/niefy/modules/wx/form/WxQrCodeForm.java
  20. 2 2
      server/src/main/java/com/github/niefy/modules/wx/handler/WxMpMessageHandler.java
  21. 0 135
      server/src/main/java/com/github/niefy/modules/wx/manage/MsgTemplateManageController.java
  22. 0 94
      server/src/main/java/com/github/niefy/modules/wx/manage/TemplateMsgLogManageController.java
  23. 2 2
      server/src/main/java/com/github/niefy/modules/wx/manage/WxAssetsManageController.java
  24. 2 2
      server/src/main/java/com/github/niefy/modules/wx/manage/WxMenuManageController.java
  25. 1 1
      server/src/main/java/com/github/niefy/modules/wx/manage/WxMsgManageController.java
  26. 0 85
      server/src/main/java/com/github/niefy/modules/wx/manage/WxQrCodeManageController.java
  27. 1 1
      server/src/main/java/com/github/niefy/modules/wx/port/TicketType.java
  28. 9 9
      server/src/main/java/com/github/niefy/modules/wx/port/WxConsts.java
  29. 4 4
      server/src/main/java/com/github/niefy/modules/wx/port/WxCpErrorMsgEnum.java
  30. 4 4
      server/src/main/java/com/github/niefy/modules/wx/port/WxError.java
  31. 11 11
      server/src/main/java/com/github/niefy/modules/wx/port/WxMaErrorMsgEnum.java
  32. 1 1
      server/src/main/java/com/github/niefy/modules/wx/port/WxMenuRule.java
  33. 2 2
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpConfigStorage.java
  34. 6 6
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpErrorMsgEnum.java
  35. 2 2
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpMessageInterceptor.java
  36. 3 3
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpMessageRouter.java
  37. 7 7
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpMessageRouterRule.java
  38. 0 26
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpQrCodeTicket.java
  39. 0 63
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpTemplate.java
  40. 0 29
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpTemplateData.java
  41. 0 78
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpTemplateMessage.java
  42. 4 4
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpUser.java
  43. 22 22
      server/src/main/java/com/github/niefy/modules/wx/port/WxMpXmlMessage.java
  44. 2 2
      server/src/main/java/com/github/niefy/modules/wx/port/WxOAuth2UserInfo.java
  45. 68 68
      server/src/main/java/com/github/niefy/modules/wx/port/WxOpenErrorMsgEnum.java
  46. 5 5
      server/src/main/java/com/github/niefy/modules/wx/port/WxType.java
  47. 1 1
      server/src/main/java/com/github/niefy/modules/wx/port/WxUserTag.java
  48. 2 2
      server/src/main/java/com/github/niefy/modules/wx/service/MsgReplyService.java
  49. 0 41
      server/src/main/java/com/github/niefy/modules/wx/service/MsgTemplateService.java
  50. 0 23
      server/src/main/java/com/github/niefy/modules/wx/service/TemplateMsgLogService.java
  51. 0 18
      server/src/main/java/com/github/niefy/modules/wx/service/TemplateMsgService.java
  52. 1 1
      server/src/main/java/com/github/niefy/modules/wx/service/WxMsgService.java
  53. 0 37
      server/src/main/java/com/github/niefy/modules/wx/service/WxQrCodeService.java
  54. 3 3
      server/src/main/java/com/github/niefy/modules/wx/service/impl/MsgReplyServiceImpl.java
  55. 0 59
      server/src/main/java/com/github/niefy/modules/wx/service/impl/MsgTemplateServiceImpl.java
  56. 0 42
      server/src/main/java/com/github/niefy/modules/wx/service/impl/TemplateMsgLogServiceImpl.java
  57. 0 93
      server/src/main/java/com/github/niefy/modules/wx/service/impl/TemplateMsgServiceImpl.java
  58. 0 69
      server/src/main/java/com/github/niefy/modules/wx/service/impl/WxQrCodeServiceImpl.java
  59. 1 1
      server/src/main/java/com/github/niefy/modules/wx/service/impl/WxUserServiceImpl.java
  60. 0 5
      server/src/main/resources/mapper/wx/MsgTemplateMapper.xml
  61. 0 6
      server/src/main/resources/mapper/wx/TemplateMsgLogMapper.xml
  62. 0 7
      server/src/main/resources/mapper/wx/WxQrCodeMapper.xml
  63. 4 61
      server/src/main/resources/sql/data.sql

+ 17 - 0
release.sh

@@ -0,0 +1,17 @@
+set -e
+
+cd manage
+npm install
+npm run build
+cd ..
+
+cd client
+npm install
+npm run build
+cd ..
+
+cd server
+mvn clean package
+cd ..
+
+echo "Build success!"

+ 1 - 1
server/src/main/java/com/github/niefy/common/exception/RRExceptionHandler.java

@@ -50,7 +50,7 @@ public class RRExceptionHandler {
 //    @ExceptionHandler({WxErrorException.class})
 //    public R handleWxErrorException(WxErrorException e) {
 //        logger.error(e.getMessage(), e);
-//        return R.error("微信公众平台接口错误:" + e.getError().getErrorMsg());
+//        return R.error("公众平台接口错误:" + e.getError().getErrorMsg());
 //    }
 
     @ExceptionHandler(Exception.class)

+ 1 - 1
server/src/main/java/com/github/niefy/common/utils/Constant.java

@@ -29,7 +29,7 @@ public class Constant {
     public static final String ASC = "asc";
 
     /**
-     *  请求header中的微信用户端源链接参数
+     *  请求header中的用户端源链接参数
      */
     public static final String WX_CLIENT_HREF_HEADER = "wx-client-href";
 

+ 1 - 1
server/src/main/java/com/github/niefy/config/SwaggerConfig.java

@@ -29,7 +29,7 @@ public class SwaggerConfig implements WebMvcConfigurer {
 
     private ApiInfo apiInfo() {
         return new ApiInfoBuilder()
-            .title("微信公众号对接后台")
+            .title("公众号对接后台")
             .description("wx-api文档,管理后台相关接口需先登录后获取token使用,token获取步骤:1.获取验证码接口获取验证码图片 2.登录接口填写账号密码和刚刚的验证码信息")
             .version("0.8.0")
             .build();

+ 8 - 8
server/src/main/java/com/github/niefy/modules/wx/controller/WxAuthController.java

@@ -21,11 +21,11 @@ import java.util.TreeMap;
 import java.util.UUID;
 
 /**
- * 微信网页授权相关
+ * 网页授权相关
  */
 @RestController
 @RequestMapping("/wxAuth")
-@Api(tags = {"微信网页授权"})
+@Api(tags = {"网页授权"})
 @RequiredArgsConstructor
 public class WxAuthController {
     Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -34,7 +34,7 @@ public class WxAuthController {
 //    private final WxMpService wxMpService;
 
     /**
-     * 使用微信授权code换取openid
+     * 使用授权code换取openid
      *
      * @param request
      * @param response
@@ -62,7 +62,7 @@ public class WxAuthController {
     }
 
     /**
-     * 使用微信授权code换取用户信息(需scope为 snsapi_userinfo)
+     * 使用授权code换取用户信息(需scope为 snsapi_userinfo)
      *
      * @param request
      * @param response
@@ -91,21 +91,21 @@ public class WxAuthController {
     }
 
     /**
-     * 获取微信分享的签名配置
-     * 允许跨域(只有微信公众号添加了js安全域名的网站才能加载微信分享,故这里不对域名进行校验)
+     * 获取分享的签名配置
+     * 允许跨域(只有公众号添加了js安全域名的网站才能加载分享,故这里不对域名进行校验)
      *
      * @param request
      * @param response
      * @return
      */
     @GetMapping("/getShareSignature")
-    @ApiOperation(value = "获取微信分享的签名配置",notes = "微信公众号添加了js安全域名的网站才能加载微信分享")
+    @ApiOperation(value = "获取分享的签名配置",notes = "公众号添加了js安全域名的网站才能加载分享")
     public R getShareSignature(HttpServletRequest request, HttpServletResponse response,@CookieValue String appid) throws WxErrorException {
 //        this.wxMpService.switchoverTo(appid);
 //        // 1.拼接url(当前网页的URL,不包含#及其后面部分)
 //        String wxShareUrl = request.getHeader(Constant.WX_CLIENT_HREF_HEADER);
 //        if (!StringUtils.hasText(wxShareUrl)) {
-//            return R.error("header中缺少"+Constant.WX_CLIENT_HREF_HEADER+"参数,微信分享加载失败");
+//            return R.error("header中缺少"+Constant.WX_CLIENT_HREF_HEADER+"参数,分享加载失败");
 //        }
 //        wxShareUrl = wxShareUrl.split("#")[0];
 //        Map<String, String> wxMap = new TreeMap<>();

+ 5 - 5
server/src/main/java/com/github/niefy/modules/wx/controller/WxMpPortalController.java

@@ -20,12 +20,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 /**
- * 微信消息
+ * 消息
  * @author Binary Wang
  */
 @RequiredArgsConstructor
 @RestController
-@Api(tags = {"微信消息 - 腾讯会调用"})
+@Api(tags = {"消息 - 腾讯会调用"})
 public class WxMpPortalController {
 //    private final WxMpService wxService;
 //    private final WxMpMessageRouter messageRouter;
@@ -42,10 +42,10 @@ public class WxMpPortalController {
 
 
     @PostMapping(path = "/{appid}/message", produces = "application/json; charset=UTF-8")
-    @ApiOperation(value = "微信各类消息",notes = "公众号接入开发模式后才有效")
+    @ApiOperation(value = "各类消息",notes = "公众号接入开发模式后才有效")
     public String post(@PathVariable String appid,
                        @RequestBody OutputMessageData event) {
-//		logger.debug("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+//		logger.debug("\n接收请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
 //						+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
 //				openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
 //        this.wxService.switchoverTo(appid);
@@ -79,7 +79,7 @@ public class WxMpPortalController {
     }
 
     @PostMapping(path = "/{appid}/subscribe", produces = "application/json; charset=UTF-8")
-    @ApiOperation(value = "微信各类消息",notes = "公众号接入开发模式后才有效")
+    @ApiOperation(value = "各类消息",notes = "公众号接入开发模式后才有效")
     public String subscribe(@PathVariable String appid,
                             @RequestBody OutputNotifyChannelSubscribeStatus event) {
         try {

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/controller/WxUserController.java

@@ -15,12 +15,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
- * 微信用户(粉丝)
+ * 用户(粉丝)
  */
 @RestController
 @RequestMapping("/wxUser")
 @RequiredArgsConstructor
-@Api(tags = {"微信粉丝"})
+@Api(tags = {"粉丝"})
 public class WxUserController {
     Logger logger = LoggerFactory.getLogger(this.getClass());
     @Autowired

+ 0 - 11
server/src/main/java/com/github/niefy/modules/wx/dao/MsgTemplateMapper.java

@@ -1,11 +0,0 @@
-package com.github.niefy.modules.wx.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.niefy.modules.wx.entity.MsgTemplate;
-import org.apache.ibatis.annotations.CacheNamespace;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-@CacheNamespace(flushInterval = 300000L)//缓存五分钟过期
-public interface MsgTemplateMapper extends BaseMapper<MsgTemplate> {
-}

+ 0 - 9
server/src/main/java/com/github/niefy/modules/wx/dao/TemplateMsgLogMapper.java

@@ -1,9 +0,0 @@
-package com.github.niefy.modules.wx.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.niefy.modules.wx.entity.TemplateMsgLog;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface TemplateMsgLogMapper extends BaseMapper<TemplateMsgLog> {
-}

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/dao/WxMsgMapper.java

@@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.CacheNamespace;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * 微信消息
+ * 消息
  * 
  * @author niefy
  * @date 2020-05-14 17:28:34

+ 0 - 19
server/src/main/java/com/github/niefy/modules/wx/dao/WxQrCodeMapper.java

@@ -1,19 +0,0 @@
-package com.github.niefy.modules.wx.dao;
-
-import com.github.niefy.modules.wx.entity.WxQrCode;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.CacheNamespace;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 公众号带参二维码
- *
- * @author niefy
- * @email niefy@qq.com
- * @date 2020-01-02 11:11:55
- */
-@Mapper
-@CacheNamespace(flushInterval = 300000L)//缓存五分钟过期
-public interface WxQrCodeMapper extends BaseMapper<WxQrCode> {
-
-}

+ 0 - 56
server/src/main/java/com/github/niefy/modules/wx/entity/MsgTemplate.java

@@ -1,56 +0,0 @@
-package com.github.niefy.modules.wx.entity;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.github.niefy.common.utils.Json;
-import com.github.niefy.modules.wx.port.WxMpTemplate;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 模板消息模板
- * @author Nifury
- * @date 2017-9-27
- */
-@Data
-@TableName("wx_msg_template")
-public class MsgTemplate implements Serializable {
-    private static final long serialVersionUID = 1L;
-    @TableId(type = IdType.AUTO)
-    private Long id;
-    private String appid;
-    private String templateId;
-    @TableField(value = "`name`")
-    private String name;
-    private String title;
-    private String content;
-    private JSONArray data;
-    private String url;
-    private JSONObject miniprogram;
-    @TableField(value = "`status`")
-    private boolean status;
-    private Date updateTime;
-    public MsgTemplate() {
-
-    }
-    public MsgTemplate(WxMpTemplate mpTemplate, String appid) {
-        this.appid = appid;
-        this.templateId=mpTemplate.getTemplateId();
-        this.title=mpTemplate.getTitle();
-        this.name=mpTemplate.getTemplateId();
-        this.content = mpTemplate.getContent();
-        this.status=true;
-    }
-
-    @Override
-    public String toString() {
-        return Json.toJsonString(this);
-    }
-
-}

+ 0 - 56
server/src/main/java/com/github/niefy/modules/wx/entity/TemplateMsgLog.java

@@ -1,56 +0,0 @@
-package com.github.niefy.modules.wx.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.github.niefy.common.utils.Json;
-import com.github.niefy.modules.wx.port.WxMpTemplateMessage;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 模板消息日志
- * @author Nifury
- * @date 2017-9-27
- */
-@Data
-@TableName("wx_template_msg_log")
-public class TemplateMsgLog implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-    @TableId(type = IdType.AUTO)
-    private Long logId;
-    private String appid;
-    private String touser;
-    private String templateId;
-    private JSONArray data;
-    private String url;
-    private JSONObject miniprogram;
-    private Date sendTime;
-    private String sendResult;
-
-    public TemplateMsgLog() {
-    }
-
-    public TemplateMsgLog(WxMpTemplateMessage msg, String appid, String sendResult) {
-        this.appid = appid;
-        this.touser = msg.getToUser();
-        this.templateId = msg.getTemplateId();
-        this.url = msg.getUrl();
-        this.miniprogram = JSONObject.parseObject(JSON.toJSONString(msg.getMiniProgram()));
-        this.data = JSONArray.parseArray(JSON.toJSONString(msg.getData()));
-        this.sendTime = new Date();
-        this.sendResult = sendResult;
-    }
-
-    @Override
-    public String toString() {
-        return Json.toJsonString(this);
-    }
-
-}

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/entity/WxMsg.java

@@ -13,7 +13,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 /**
- * 微信消息
+ * 消息
  * 
  * @author niefy
  * @date 2020-05-14 17:28:34
@@ -30,7 +30,7 @@ public class WxMsg implements Serializable {
 	private Long id;
 	private String appid;
 	/**
-	 * 微信用户ID
+	 * 用户ID
 	 */
 	private String openid;
 	/**

+ 0 - 64
server/src/main/java/com/github/niefy/modules/wx/entity/WxQrCode.java

@@ -1,64 +0,0 @@
-package com.github.niefy.modules.wx.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.github.niefy.modules.wx.form.WxQrCodeForm;
-import lombok.Data;
-
-/**
- * 公众号带参二维码
- *
- * @author niefy
- * @email niefy@qq.com
- * @date 2020-01-02 11:11:55
- */
-@Data
-@TableName("wx_qr_code")
-public class WxQrCode implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * ID
-     */
-    @TableId
-    private Long id;
-    private String appid;
-    /**
-     * 二维码类型
-     */
-    private Boolean isTemp;
-    /**
-     * 场景值ID
-     */
-    private String sceneStr;
-    /**
-     * 二维码ticket
-     */
-    private String ticket;
-    /**
-     * 二维码图片解析后的地址
-     */
-    private String url;
-    /**
-     * 该二维码失效时间
-     */
-    private Date expireTime;
-    /**
-     * 该二维码创建时间
-     */
-    private Date createTime;
-
-    public WxQrCode() {
-    }
-
-    public WxQrCode(WxQrCodeForm form,String appid) {
-        this.appid = appid;
-        this.isTemp = form.getIsTemp();
-        this.sceneStr = form.getSceneStr();
-        this.createTime = new Date();
-    }
-}

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/entity/WxUser.java

@@ -17,7 +17,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 /**
- * 微信粉丝
+ * 粉丝
  * @author Nifury
  * @date 2017-9-27
  */

+ 0 - 33
server/src/main/java/com/github/niefy/modules/wx/form/TemplateMsgBatchForm.java

@@ -1,33 +0,0 @@
-package com.github.niefy.modules.wx.form;
-
-import com.github.niefy.common.utils.Json;
-import com.github.niefy.modules.wx.port.WxMpTemplateData;
-import com.github.niefy.modules.wx.port.WxMpTemplateMessage;
-import lombok.Data;
-
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 批量发送模板消息表单
- * 通过用户筛选条件(一般使用标签筛选),将消息发送给数据库中所有符合筛选条件的用户
- * 若所有筛选条件都为空,则表示发送给所有用户
- *
- */
-@Data
-public class TemplateMsgBatchForm {
-    @NotNull(message = "需用户筛选条件参数")
-    Map<String, Object> wxUserFilterParams;
-    @NotEmpty(message = "模板ID不得为空")
-    private String templateId;
-    private String url;
-    private WxMpTemplateMessage.MiniProgram miniprogram;
-    @NotEmpty(message = "消息模板数据不得为空")
-    private List<WxMpTemplateData> data;
-    @Override
-    public String toString() {
-        return Json.toJsonString(this);
-    }
-}

+ 0 - 24
server/src/main/java/com/github/niefy/modules/wx/form/TemplateMsgForm.java

@@ -1,24 +0,0 @@
-package com.github.niefy.modules.wx.form;
-
-import com.github.niefy.common.exception.RRException;
-import com.github.niefy.common.utils.Json;
-import lombok.Data;
-
-@Data
-public class TemplateMsgForm {
-    private String openid;
-    private String msg;
-    private String template;
-
-    @Override
-    public String toString() {
-        return Json.toJsonString(this);
-    }
-
-    public boolean isValid() {
-        if (openid == null || openid.isEmpty() || msg == null || msg.isEmpty() || template == null || template.isEmpty()) {
-            throw new RRException("缺少必要参数");
-        }
-        return true;
-    }
-}

+ 0 - 17
server/src/main/java/com/github/niefy/modules/wx/form/WxQrCodeForm.java

@@ -1,17 +0,0 @@
-package com.github.niefy.modules.wx.form;
-
-import lombok.Data;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.Size;
-
-@Data
-public class WxQrCodeForm {
-    @NotEmpty(message = "场景值ID不得为空")
-    @Size(min = 1, max = 64, message = "场景值长度限制为1到64")
-    private String sceneStr;
-    @Max(value = 2592000, message = "过期时间不得超过30天")
-    private Integer expireSeconds;
-    private Boolean isTemp = true;
-}

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/handler/WxMpMessageHandler.java

@@ -6,9 +6,9 @@ import java.util.Map;
 
 public interface WxMpMessageHandler {
     /**
-     * 处理微信推送消息.
+     * 处理推送消息.
      *
-     * @param wxMessage      微信推送消息
+     * @param wxMessage      推送消息
      * @param context        上下文,如果handler或interceptor之间有信息要传递,可以用这个
      * @param wxMpService    服务类
      * @param sessionManager session管理器

+ 0 - 135
server/src/main/java/com/github/niefy/modules/wx/manage/MsgTemplateManageController.java

@@ -1,135 +0,0 @@
-package com.github.niefy.modules.wx.manage;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import com.github.niefy.modules.wx.entity.MsgTemplate;
-import com.github.niefy.modules.wx.form.TemplateMsgBatchForm;
-
-import com.github.niefy.modules.wx.port.WxErrorException;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import com.github.niefy.modules.wx.service.MsgTemplateService;
-import com.github.niefy.modules.wx.service.TemplateMsgService;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.common.utils.R;
-
-
-/**
- * 消息模板
- *
- * @author niefy
- * @email niefy@qq.com
- * @date 2019-11-12 18:30:15
- */
-@RestController
-@RequestMapping("/manage/msgTemplate")
-@Api(tags = {"消息模板-管理后台","模板消息的模板"})
-public class MsgTemplateManageController {
-    @Autowired
-    private MsgTemplateService msgTemplateService;
-    @Autowired
-    private TemplateMsgService templateMsgService;
-
-    /**
-     * 列表
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("wx:msgtemplate:list")
-    @ApiOperation(value = "列表")
-    public R list(@CookieValue String appid,@RequestParam Map<String, Object> params) {
-        params.put("appid",appid);
-        PageUtils page = msgTemplateService.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-
-    /**
-     * 信息
-     */
-    @GetMapping("/info/{id}")
-    @RequiresPermissions("wx:msgtemplate:info")
-    @ApiOperation(value = "详情-通过ID")
-    public R info(@PathVariable("id") Long id) {
-        MsgTemplate msgTemplate = msgTemplateService.getById(id);
-
-        return R.ok().put("msgTemplate", msgTemplate);
-    }
-    /**
-     * 信息
-     */
-    @GetMapping("/getByName")
-    @RequiresPermissions("wx:msgtemplate:info")
-    @ApiOperation(value = "详情-通过名称")
-    public R getByName( String name){
-        MsgTemplate msgTemplate = msgTemplateService.selectByName(name);
-
-        return R.ok().put("msgTemplate", msgTemplate);
-    }
-
-    /**
-     * 保存
-     */
-    @PostMapping("/save")
-    @RequiresPermissions("wx:msgtemplate:save")
-    @ApiOperation(value = "保存")
-    public R save(@RequestBody MsgTemplate msgTemplate) {
-        msgTemplateService.save(msgTemplate);
-
-        return R.ok();
-    }
-
-    /**
-     * 修改
-     */
-    @PostMapping("/update")
-    @RequiresPermissions("wx:msgtemplate:update")
-    @ApiOperation(value = "修改")
-    public R update(@RequestBody MsgTemplate msgTemplate) {
-        msgTemplateService.updateById(msgTemplate);
-
-        return R.ok();
-    }
-
-    /**
-     * 删除
-     */
-    @PostMapping("/delete")
-    @RequiresPermissions("wx:msgtemplate:delete")
-    @ApiOperation(value = "删除")
-    public R delete(@RequestBody String[] ids) {
-        msgTemplateService.removeByIds(Arrays.asList(ids));
-
-        return R.ok();
-    }
-
-    /**
-     * 同步公众号模板
-     */
-    @PostMapping("/syncWxTemplate")
-    @RequiresPermissions("wx:msgtemplate:save")
-    @ApiOperation(value = "同步公众号模板")
-    public R syncWxTemplate(@CookieValue String appid) throws WxErrorException {
-        msgTemplateService.syncWxTemplate(appid);
-        return R.ok();
-    }
-
-    /**
-     * 批量向用户发送模板消息
-     * 通过用户筛选条件(一般使用标签筛选),将消息发送给数据库中所有符合筛选条件的用户
-     */
-    @PostMapping("/sendMsgBatch")
-    @RequiresPermissions("wx:msgtemplate:save")
-    @ApiOperation(value = "批量向用户发送模板消息",notes = "将消息发送给数据库中所有符合筛选条件的用户")
-    public R sendMsgBatch(@CookieValue String appid,@RequestBody TemplateMsgBatchForm form) {
-        templateMsgService.sendMsgBatch(form, appid);
-        return R.ok();
-    }
-
-
-}

+ 0 - 94
server/src/main/java/com/github/niefy/modules/wx/manage/TemplateMsgLogManageController.java

@@ -1,94 +0,0 @@
-package com.github.niefy.modules.wx.manage;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import com.github.niefy.modules.wx.entity.TemplateMsgLog;
-import com.github.niefy.modules.wx.service.TemplateMsgLogService;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.common.utils.R;
-
-
-/**
- * 模版消息发送记录
- *
- * @author niefy
- * @email niefy@qq.com
- * @date 2019-11-12 18:30:15
- */
-@RestController
-@RequestMapping("/manage/templateMsgLog")
-@Api(tags = {"模板消息发送记录-管理后台"})
-public class TemplateMsgLogManageController {
-    @Autowired
-    private TemplateMsgLogService templateMsgLogService;
-
-    /**
-     * 列表
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("wx:templatemsglog:list")
-    @ApiOperation(value = "列表")
-    public R list(@CookieValue String appid,@RequestParam Map<String, Object> params) {
-        params.put("appid",appid);
-        PageUtils page = templateMsgLogService.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-
-    /**
-     * 信息
-     */
-    @GetMapping("/info/{logId}")
-    @RequiresPermissions("wx:templatemsglog:info")
-    @ApiOperation(value = "详情")
-    public R info(@CookieValue String appid,@PathVariable("logId") Integer logId) {
-        TemplateMsgLog templateMsgLog = templateMsgLogService.getById(logId);
-
-        return R.ok().put("templateMsgLog", templateMsgLog);
-    }
-
-    /**
-     * 保存
-     */
-    @PostMapping("/save")
-    @RequiresPermissions("wx:templatemsglog:save")
-    @ApiOperation(value = "保存")
-    public R save(@CookieValue String appid,@RequestBody TemplateMsgLog templateMsgLog) {
-        templateMsgLogService.save(templateMsgLog);
-
-        return R.ok();
-    }
-
-    /**
-     * 修改
-     */
-    @PostMapping("/update")
-    @RequiresPermissions("wx:templatemsglog:update")
-    @ApiOperation(value = "修改")
-    public R update(@CookieValue String appid,@RequestBody TemplateMsgLog templateMsgLog) {
-        templateMsgLogService.updateById(templateMsgLog);
-
-        return R.ok();
-    }
-
-    /**
-     * 删除
-     */
-    @PostMapping("/delete")
-    @RequiresPermissions("wx:templatemsglog:delete")
-    @ApiOperation(value = "删除")
-    public R delete(@CookieValue String appid,@RequestBody Integer[] logIds) {
-        templateMsgLogService.removeByIds(Arrays.asList(logIds));
-
-        return R.ok();
-    }
-
-}

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/manage/WxAssetsManageController.java

@@ -17,9 +17,9 @@ import java.io.IOException;
 import java.util.List;
 
 /**
- * 微信公众号素材管理
+ * 公众号素材管理
  * 参考官方文档:https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html
- * 参考WxJava开发文档:https://github.com/Wechat-Group/WxJava/wiki/MP_永久素材管理
+ * 参考WxJava开发文档:https://github.com/-Group/WxJava/wiki/MP_永久素材管理
  */
 @RestController
 @RequestMapping("/manage/wxAssets")

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/manage/WxMenuManageController.java

@@ -28,9 +28,9 @@ import java.util.UUID;
 import java.util.function.Consumer;
 
 /**
- * 微信公众号菜单管理
+ * 公众号菜单管理
  * 官方文档:https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Creating_Custom-Defined_Menu.html
- * WxJava开发文档:https://github.com/Wechat-Group/WxJava/wiki/MP_自定义菜单管理
+ * WxJava开发文档:https://github.com/-Group/WxJava/wiki/MP_自定义菜单管理
  */
 @RestController
 @RequestMapping("/manage/wxMenu")

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/manage/WxMsgManageController.java

@@ -19,7 +19,7 @@ import java.util.Map;
 
 
 /**
- * 微信消息
+ * 消息
  *
  * @author niefy
  * @date 2020-05-14 17:28:34

+ 0 - 85
server/src/main/java/com/github/niefy/modules/wx/manage/WxQrCodeManageController.java

@@ -1,85 +0,0 @@
-package com.github.niefy.modules.wx.manage;
-
-import com.github.niefy.modules.wx.form.WxQrCodeForm;
-import com.github.niefy.modules.wx.port.WxErrorException;
-import com.github.niefy.modules.wx.port.WxMpQrCodeTicket;
-import com.github.niefy.modules.wx.service.WxQrCodeService;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.common.utils.R;
-import com.github.niefy.modules.wx.entity.WxQrCode;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Arrays;
-import java.util.Map;
-
-/**
- * 公众号带参二维码管理
- * https://github.com/Wechat-Group/WxJava/wiki/MP_二维码管理
- */
-@RestController
-@RequestMapping("/manage/wxQrCode")
-@Api(tags = {"公众号带参二维码-管理后台"})
-public class WxQrCodeManageController {
-    Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private WxQrCodeService wxQrCodeService;
-//    @Autowired
-//    private WxMpService wxMpService;
-
-    /**
-     * 创建带参二维码ticket
-     */
-    @PostMapping("/createTicket")
-    @RequiresPermissions("wx:wxqrcode:save")
-    @ApiOperation(value = "创建带参二维码ticket",notes = "ticket可以换取二维码图片")
-    public R createTicket(@CookieValue String appid,@RequestBody WxQrCodeForm form) throws WxErrorException {
-//        wxMpService.switchoverTo(appid);
-        WxMpQrCodeTicket ticket = wxQrCodeService.createQrCode(appid,form);
-        return R.ok().put(ticket);
-    }
-
-    /**
-     * 列表
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("wx:wxqrcode:list")
-    @ApiOperation(value = "列表")
-    public R list(@CookieValue String appid,@RequestParam Map<String, Object> params) {
-        params.put("appid",appid);
-        PageUtils page = wxQrCodeService.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-
-    /**
-     * 信息
-     */
-    @GetMapping("/info/{id}")
-    @RequiresPermissions("wx:wxqrcode:info")
-    @ApiOperation(value = "详情")
-    public R info(@CookieValue String appid,@PathVariable("id") Long id) {
-        WxQrCode wxQrCode = wxQrCodeService.getById(id);
-
-        return R.ok().put("wxQrCode", wxQrCode);
-    }
-
-    /**
-     * 删除
-     */
-    @PostMapping("/delete")
-    @RequiresPermissions("wx:wxqrcode:delete")
-    @ApiOperation(value = "删除")
-    public R delete(@CookieValue String appid,@RequestBody Long[] ids) {
-        wxQrCodeService.removeByIds(Arrays.asList(ids));
-
-        return R.ok();
-    }
-}

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/port/TicketType.java

@@ -15,7 +15,7 @@ public enum TicketType {
      */
     SDK("2"),
     /**
-     * 微信卡券
+     * 卡券
      */
     WX_CARD("wx_card");
 

+ 9 - 9
server/src/main/java/com/github/niefy/modules/wx/port/WxConsts.java

@@ -19,7 +19,7 @@ public class WxConsts {
             WxMpErrorMsgEnum.CODE_40014.getCode(), WxMpErrorMsgEnum.CODE_42001.getCode());
 
     /**
-     * 微信推送过来的消息的类型,和发送给微信xml格式消息的消息类型.
+     * 推送过来的消息的类型,和发送给xml格式消息的消息类型.
      */
     public static class XmlMsgType {
         public static final String TEXT = "text";
@@ -176,7 +176,7 @@ public class WxConsts {
     }
 
     /**
-     * 企业微信模板卡片消息的卡片类型
+     * 企业模板卡片消息的卡片类型
      */
     public static class TemplateCardType {
         /**
@@ -221,7 +221,7 @@ public class WxConsts {
     }
 
     /**
-     * 群发消息后微信端推送给服务器的反馈消息.
+     * 群发消息后端推送给服务器的反馈消息.
      */
     public static class MassMsgStatus {
         public static final String SEND_SUCCESS = "send success";
@@ -268,7 +268,7 @@ public class WxConsts {
     }
 
     /**
-     * 微信端推送过来的事件类型.
+     * 端推送过来的事件类型.
      */
     public static class EventType {
         public static final String SUBSCRIBE = "subscribe";
@@ -295,7 +295,7 @@ public class WxConsts {
          */
         public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
         /**
-         * 弹出微信相册发图器的事件推送.
+         * 弹出相册发图器的事件推送.
          */
         public static final String PIC_WEIXIN = "pic_weixin";
         /**
@@ -305,7 +305,7 @@ public class WxConsts {
 
         public static final String TEMPLATE_SEND_JOB_FINISH = "TEMPLATESENDJOBFINISH";
         /**
-         * 微信小店 订单付款通知.
+         * 小店 订单付款通知.
          */
         public static final String MERCHANT_ORDER = "merchant_order";
 
@@ -341,7 +341,7 @@ public class WxConsts {
 
 
         /**
-         * 卡券事件:用户通过卡券的微信买单完成时推送
+         * 卡券事件:用户通过卡券的买单完成时推送
          */
         public static final String CARD_USER_PAY_FROM_PAY_CELL = "user_pay_from_pay_cell";
 
@@ -442,7 +442,7 @@ public class WxConsts {
          */
         public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
         /**
-         * 弹出微信相册发图器.
+         * 弹出相册发图器.
          */
         public static final String PIC_WEIXIN = "pic_weixin";
         /**
@@ -474,7 +474,7 @@ public class WxConsts {
         public static final String SNSAPI_USERINFO = "snsapi_userinfo";
 
         /**
-         * 手动授权,可获取成员的详细信息,包含手机、邮箱。只适用于企业微信或企业号.
+         * 手动授权,可获取成员的详细信息,包含手机、邮箱。只适用于企业或企业号.
          */
         public static final String SNSAPI_PRIVATEINFO = "snsapi_privateinfo";
     }

+ 4 - 4
server/src/main/java/com/github/niefy/modules/wx/port/WxCpErrorMsgEnum.java

@@ -325,9 +325,9 @@ public enum WxCpErrorMsgEnum {
      */
     CODE_42009(42009, "suite_access_token已过期;suite_access_token有时效性,需要重新获取一次"),
     /**
-     * 指定的userid未绑定微信或未关注微信插件;需要成员使用微信登录企业微信或者关注微信插件才能获取openid.
+     * 指定的userid未绑定或未关注插件;需要成员使用登录企业或者关注插件才能获取openid.
      */
-    CODE_43004(43004, "指定的userid未绑定微信或未关注微信插件;需要成员使用微信登录企业微信或者关注微信插件才能获取openid"),
+    CODE_43004(43004, "指定的userid未绑定或未关注插件;需要成员使用登录企业或者关注插件才能获取openid"),
     /**
      * 多媒体文件为空;上传格式参考:上传临时素材,确认header和body的内容正确.
      */
@@ -489,9 +489,9 @@ public enum WxCpErrorMsgEnum {
      */
     CODE_60106(60106, "邮箱已存在;同一个企业内,成员的邮箱不能重复。建议更换邮箱,或者更新已有的邮箱记录。"),
     /**
-     * 微信号不合法;微信号格式由字母、数字、”-“、”_“组成,长度为 3-20 字节,首字符必须是字母或”-“或”_“.
+     * 野火号不合法;野火号格式由字母、数字、”-“、”_“组成,长度为 3-20 字节,首字符必须是字母或”-“或”_“.
      */
-    CODE_60107(60107, "微信号不合法;微信号格式由字母、数字、”-“、”_“组成,长度为 3-20 字节,首字符必须是字母或”-“或”_“"),
+    CODE_60107(60107, "野火号不合法;野火号格式由字母、数字、”-“、”_“组成,长度为 3-20 字节,首字符必须是字母或”-“或”_“"),
     /**
      * 用户所属部门数量超过限制;用户同时归属部门不超过20个.
      */

+ 4 - 4
server/src/main/java/com/github/niefy/modules/wx/port/WxError.java

@@ -16,18 +16,18 @@ public class WxError implements Serializable {
     private static final long serialVersionUID = 7869786563361406291L;
 
     /**
-     * 微信错误代码.
+     * 错误代码.
      */
     private int errorCode;
 
     /**
-     * 微信错误信息.
+     * 错误信息.
      * (如果可以翻译为中文,就为中文)
      */
     private String errorMsg;
 
     /**
-     * 微信接口返回的错误原始信息(英文).
+     * 接口返回的错误原始信息(英文).
      */
     private String errorMsgEn;
 
@@ -94,7 +94,7 @@ public class WxError implements Serializable {
             return "错误代码:" + this.errorCode + ", 错误信息:" + this.errorMsg;
         }
 
-        return "错误代码:" + this.errorCode + ", 错误信息:" + this.errorMsg + ",微信原始报文:" + this.json;
+        return "错误代码:" + this.errorCode + ", 错误信息:" + this.errorMsg + ",原始报文:" + this.json;
     }
 
 }

+ 11 - 11
server/src/main/java/com/github/niefy/modules/wx/port/WxMaErrorMsgEnum.java

@@ -281,7 +281,7 @@ public enum WxMaErrorMsgEnum {
 
     CODE_85061(85061, "手机号绑定管理员名额达到上限"),
 
-    CODE_85026(85026, "微信号绑定管理员名额达到上限"),
+    CODE_85026(85026, "野火号绑定管理员名额达到上限"),
 
     CODE_85063(85063, "身份证黑名单"),
 
@@ -313,7 +313,7 @@ public enum WxMaErrorMsgEnum {
 
     CODE_91005(91005, "昵称 15 天主体保护"),
 
-    CODE_91006(91006, "昵称命中微信号"),
+    CODE_91006(91006, "昵称命中野火号"),
 
     CODE_91007(91007, "昵称已被占用"),
 
@@ -454,13 +454,13 @@ public enum WxMaErrorMsgEnum {
     /**
      * 小程序绑定体验者
      */
-    CODE_85001(85001, "微信号不存在或微信号设置为不可搜索"),
+    CODE_85001(85001, "野火号不存在或野火号设置为不可搜索"),
 
     CODE_85002(85002, "小程序绑定的体验者数量达到上限"),
 
-    CODE_85003(85003, "微信号绑定的小程序体验者达到上限"),
+    CODE_85003(85003, "野火号绑定的小程序体验者达到上限"),
 
-    CODE_85004(85004, "微信号已经绑定"),
+    CODE_85004(85004, "野火号已经绑定"),
 
     /**
      * 53010
@@ -512,9 +512,9 @@ public enum WxMaErrorMsgEnum {
 
     /**
      * 53018
-     * 名称命中微信
+     * 名称命中野火
      */
-    CODE_53018(53018, "名称命中微信号"),
+    CODE_53018(53018, "名称命中野火号"),
 
     /**
      * 53019
@@ -524,9 +524,9 @@ public enum WxMaErrorMsgEnum {
 
     /**
      * 61070
-     * 法人姓名与微信号不一致 name, wechat name not in accordance
+     * 法人姓名与野火号不一致 name,  name not in accordance
      */
-    CODE_61070(61070, "法人姓名与微信号不一致"),
+    CODE_61070(61070, "法人姓名与野火号不一致"),
 
     /**
      * 85015
@@ -590,9 +590,9 @@ public enum WxMaErrorMsgEnum {
 
     /**
      * 86004
-     * 无效微信号 invalid wechat
+     * 无效野火号 invalid 
      */
-    CODE_86004(86004, "无效微信号"),
+    CODE_86004(86004, "无效野火号"),
 
     /**
      * 89247

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/port/WxMenuRule.java

@@ -10,7 +10,7 @@ public class WxMenuRule implements Serializable {
     private static final long serialVersionUID = -4587181819499286670L;
 
     /**
-     * 变态的微信接口,反序列化时这里反人类的使用和序列化时不一样的名字.
+     * 变态的接口,反序列化时这里反人类的使用和序列化时不一样的名字.
      */
     @SerializedName(value = "tag_id", alternate = "group_id")
     private String tagId;

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/port/WxMpConfigStorage.java

@@ -201,14 +201,14 @@ public interface WxMpConfigStorage {
     boolean autoRefreshToken();
 
     /**
-     * 得到微信接口地址域名部分的自定义设置信息.
+     * 得到接口地址域名部分的自定义设置信息.
      *
      * @return the host config
      */
     WxMpHostConfig getHostConfig();
 
     /**
-     * 设置微信接口地址域名部分的自定义设置信息.
+     * 设置接口地址域名部分的自定义设置信息.
      *
      * @param hostConfig host config
      */

+ 6 - 6
server/src/main/java/com/github/niefy/modules/wx/port/WxMpErrorMsgEnum.java

@@ -192,9 +192,9 @@ public enum WxMpErrorMsgEnum {
      */
     CODE_40121(40121, "不合法的 media_id 类型"),
     /**
-     * 微信号不合法.
+     * 野火号不合法.
      */
-    CODE_40132(40132, "微信号不合法"),
+    CODE_40132(40132, "野火号不合法"),
     /**
      * 不支持的图片格式.
      */
@@ -256,9 +256,9 @@ public enum WxMpErrorMsgEnum {
      */
     CODE_42003(42003, "oauth_code 超时"),
     /**
-     * 用户修改微信密码, accesstoken 和 refreshtoken 失效,需要重新授权.
+     * 用户修改密码, accesstoken 和 refreshtoken 失效,需要重新授权.
      */
-    CODE_42007(42007, "用户修改微信密码, accesstoken 和 refreshtoken 失效,需要重新授权"),
+    CODE_42007(42007, "用户修改密码, accesstoken 和 refreshtoken 失效,需要重新授权"),
     /**
      * 需要 GET 请求.
      */
@@ -448,9 +448,9 @@ public enum WxMpErrorMsgEnum {
      */
     CODE_61453(61453, "客服帐号已存在 (kf_account exsited)"),
     /**
-     * 客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的微信号 )(invalid kf_acount length).
+     * 客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的野火号 )(invalid kf_acount length).
      */
-    CODE_61454(61454, "客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的微信号 )(invalid kf_acount length)"),
+    CODE_61454(61454, "客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的野火号 )(invalid kf_acount length)"),
     /**
      * 客服帐号名包含非法字符 ( 仅允许英文 + 数字 )(illegal character in kf_account).
      */

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/port/WxMpMessageInterceptor.java

@@ -4,14 +4,14 @@ package com.github.niefy.modules.wx.port;
 import java.util.Map;
 
 /**
- * 微信消息拦截器,可以用来做验证
+ * 消息拦截器,可以用来做验证
  *
  * @author Daniel Qian
  */
 public interface WxMpMessageInterceptor {
 
     /**
-     * 拦截微信消息
+     * 拦截消息
      *
      * @param wxMessage
      * @param context        上下文,如果handler或interceptor之间有信息要传递,可以用这个

+ 3 - 3
server/src/main/java/com/github/niefy/modules/wx/port/WxMpMessageRouter.java

@@ -106,21 +106,21 @@ public class WxMpMessageRouter {
     }
 
     /**
-     * 处理微信消息.
+     * 处理消息.
      */
     public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) {
         return route(wxMessage, context, null);
     }
 
     /**
-     * 处理不同appid微信消息
+     * 处理不同appid消息
      */
     public WxMpXmlOutMessage route(final String appid, final WxMpXmlMessage wxMessage, final Map<String, Object> context) {
         return route(wxMessage, context, null);
     }
 
     /**
-     * 处理微信消息.
+     * 处理消息.
      */
     public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context, WxMpService wxMpService) {
         if (wxMpService == null) {

+ 7 - 7
server/src/main/java/com/github/niefy/modules/wx/port/WxMpMessageRouterRule.java

@@ -112,14 +112,14 @@ public class WxMpMessageRouterRule {
     }
 
     /**
-     * 设置微信消息拦截器
+     * 设置消息拦截器
      */
     public WxMpMessageRouterRule interceptor(WxMpMessageInterceptor interceptor) {
         return interceptor(interceptor, (WxMpMessageInterceptor[]) null);
     }
 
     /**
-     * 设置微信消息拦截器
+     * 设置消息拦截器
      */
     public WxMpMessageRouterRule interceptor(WxMpMessageInterceptor interceptor, WxMpMessageInterceptor... otherInterceptors) {
         this.interceptors.add(interceptor);
@@ -130,14 +130,14 @@ public class WxMpMessageRouterRule {
     }
 
     /**
-     * 设置微信消息处理器
+     * 设置消息处理器
      */
     public WxMpMessageRouterRule handler(WxMpMessageHandler handler) {
         return handler(handler, (WxMpMessageHandler[]) null);
     }
 
     /**
-     * 设置微信消息处理器
+     * 设置消息处理器
      */
     public WxMpMessageRouterRule handler(WxMpMessageHandler handler, WxMpMessageHandler... otherHandlers) {
         this.handlers.add(handler);
@@ -166,8 +166,8 @@ public class WxMpMessageRouterRule {
     }
 
     /**
-     * 将微信自定义的事件修正为不区分大小写,
-     * 比如框架定义的事件常量为click,但微信传递过来的却是CLICK
+     * 将自定义的事件修正为不区分大小写,
+     * 比如框架定义的事件常量为click,但传递过来的却是CLICK
      */
     protected boolean test(WxMpXmlMessage wxMessage) {
         return
@@ -190,7 +190,7 @@ public class WxMpMessageRouterRule {
     }
 
     /**
-     * 处理微信推送过来的消息
+     * 处理推送过来的消息
      *
      * @param wxMessage
      * @return true 代表继续执行别的router,false 代表停止执行别的router

+ 0 - 26
server/src/main/java/com/github/niefy/modules/wx/port/WxMpQrCodeTicket.java

@@ -1,26 +0,0 @@
-package com.github.niefy.modules.wx.port;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-@Data
-public class WxMpQrCodeTicket implements Serializable {
-    private static final long serialVersionUID = 5777119669111011584L;
-
-    protected String ticket;
-    /**
-     * 如果为-1,说明是永久
-     */
-    protected int expireSeconds = -1;
-    protected String url;
-
-    public static WxMpQrCodeTicket fromJson(String json) {
-        return WxMpGsonBuilder.create().fromJson(json, WxMpQrCodeTicket.class);
-    }
-
-    @Override
-    public String toString() {
-        return WxMpGsonBuilder.create().toJson(this);
-    }
-}

+ 0 - 63
server/src/main/java/com/github/niefy/modules/wx/port/WxMpTemplate.java

@@ -1,63 +0,0 @@
-package com.github.niefy.modules.wx.port;
-
-import com.google.gson.annotations.SerializedName;
-import com.google.gson.reflect.TypeToken;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-@Data
-public class WxMpTemplate implements Serializable {
-
-    private static final long serialVersionUID = -7366474522571199372L;
-
-    /**
-     * template_id.
-     * 模板ID
-     */
-    @SerializedName("template_id")
-    private String templateId;
-    /**
-     * title.
-     * 模板标题
-     */
-    @SerializedName("title")
-    private String title;
-    /**
-     * primary_industry.
-     * 模板所属行业的一级行业
-     */
-    @SerializedName("primary_industry")
-    private String primaryIndustry;
-    /**
-     * deputy_industry.
-     * 模板所属行业的二级行业
-     */
-    @SerializedName("deputy_industry")
-    private String deputyIndustry;
-    /**
-     * content.
-     * 模板内容
-     */
-    @SerializedName("content")
-    private String content;
-    /**
-     * example.
-     * 模板示例
-     */
-    @SerializedName("example")
-    private String example;
-
-    public static List<WxMpTemplate> fromJson(String json) {
-        return WxMpGsonBuilder.create().fromJson(GsonParser.parse(json).get("template_list"),
-                new TypeToken<List<WxMpTemplate>>() {
-                }.getType());
-    }
-
-    @Override
-    public String toString() {
-        return WxMpGsonBuilder.create().toJson(this);
-    }
-
-}

+ 0 - 29
server/src/main/java/com/github/niefy/modules/wx/port/WxMpTemplateData.java

@@ -1,29 +0,0 @@
-package com.github.niefy.modules.wx.port;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-@Data
-public class WxMpTemplateData implements Serializable {
-    private static final long serialVersionUID = 6301835292940277870L;
-
-    private String name;
-    private String value;
-    private String color;
-
-    public WxMpTemplateData() {
-    }
-
-    public WxMpTemplateData(String name, String value) {
-        this.name = name;
-        this.value = value;
-    }
-
-    public WxMpTemplateData(String name, String value, String color) {
-        this.name = name;
-        this.value = value;
-        this.color = color;
-    }
-
-}

+ 0 - 78
server/src/main/java/com/github/niefy/modules/wx/port/WxMpTemplateMessage.java

@@ -1,78 +0,0 @@
-package com.github.niefy.modules.wx.port;
-
-import lombok.*;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Builder
-public class WxMpTemplateMessage implements Serializable {
-    private static final long serialVersionUID = 5063374783759519418L;
-
-    /**
-     * 接收者openid.
-     */
-    private String toUser;
-
-    /**
-     * 模板ID.
-     */
-    private String templateId;
-
-    /**
-     * 模板跳转链接.
-     * <pre>
-     * url和miniprogram都是非必填字段,若都不传则模板无跳转;若都传,会优先跳转至小程序。
-     * 开发者可根据实际需要选择其中一种跳转方式即可。当用户的微信客户端版本不支持跳小程序时,将会跳转至url。
-     * </pre>
-     */
-    private String url;
-
-    /**
-     * 跳小程序所需数据,不需跳小程序可不用传该数据.
-     *
-     * @see #url
-     */
-    private MiniProgram miniProgram;
-
-    /**
-     * 模板数据.
-     */
-    @Builder.Default
-    private List<WxMpTemplateData> data = new ArrayList<>();
-
-    public WxMpTemplateMessage addData(WxMpTemplateData datum) {
-        if (this.data == null) {
-            this.data = new ArrayList<>();
-        }
-        this.data.add(datum);
-        return this;
-    }
-
-    public String toJson() {
-        return WxMpGsonBuilder.create().toJson(this);
-    }
-
-    @Data
-    @NoArgsConstructor
-    @AllArgsConstructor
-    public static class MiniProgram implements Serializable {
-        private static final long serialVersionUID = -7945254706501974849L;
-
-        private String appid;
-        private String pagePath;
-
-        /**
-         * 是否使用path,否则使用pagepath.
-         * 加入此字段是基于微信官方接口变化多端的考虑
-         */
-        private boolean usePath = false;
-    }
-
-}
-

+ 4 - 4
server/src/main/java/com/github/niefy/modules/wx/port/WxMpUser.java

@@ -30,10 +30,10 @@ public class WxMpUser implements Serializable {
     /**
      * https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&announce_id=11513156443eZYea&version=&lang=zh_CN
      * <pre>
-     * 只有在将公众号绑定到微信开放平台帐号后,才会出现该字段。
+     * 只有在将公众号绑定到开放平台帐号后,才会出现该字段。
      * 另外,在用户未关注公众号时,将不返回用户unionID信息。
      * 已关注的用户,开发者可使用“获取用户基本信息接口”获取unionID;
-     * 未关注用户,开发者可使用“微信授权登录接口”并将scope参数设置为snsapi_userinfo,获取用户unionID
+     * 未关注用户,开发者可使用“授权登录接口”并将scope参数设置为snsapi_userinfo,获取用户unionID
      * </pre>
      */
     private String unionId;
@@ -42,12 +42,12 @@ public class WxMpUser implements Serializable {
     private Long[] tagIds;
 
     /**
-     * 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom).
+     * 用户特权信息,json 数组,如沃卡用户为(chinaunicom).
      */
     private String[] privileges;
 
     /**
-     * subscribe_scene 返回用户关注的渠道来源,ADD_SCENE_SEARCH 公众号搜索,ADD_SCENE_ACCOUNT_MIGRATION 公众号迁移,ADD_SCENE_PROFILE_CARD 名片分享,ADD_SCENE_QR_CODE 扫描二维码,ADD_SCENE_PROFILE_LINK 图文页内名称点击,ADD_SCENE_PROFILE_ITEM 图文页右上角菜单,ADD_SCENE_PAID 支付后关注,ADD_SCENE_WECHAT_ADVERTISEMENT 微信广告,ADD_SCENE_OTHERS 其他
+     * subscribe_scene 返回用户关注的渠道来源,ADD_SCENE_SEARCH 公众号搜索,ADD_SCENE_ACCOUNT_MIGRATION 公众号迁移,ADD_SCENE_PROFILE_CARD 名片分享,ADD_SCENE_QR_CODE 扫描二维码,ADD_SCENE_PROFILE_LINK 图文页内名称点击,ADD_SCENE_PROFILE_ITEM 图文页右上角菜单,ADD_SCENE_PAID 支付后关注,ADD_SCENE__ADVERTISEMENT 广告,ADD_SCENE_OTHERS 其他
      */
     private String subscribeScene;
 

+ 22 - 22
server/src/main/java/com/github/niefy/modules/wx/port/WxMpXmlMessage.java

@@ -21,7 +21,7 @@ public class WxMpXmlMessage implements Serializable {
     private Map<String, Object> allFieldsMap;
 
     ///////////////////////
-    // 以下都是微信推送过来的消息的xml的element所对应的属性
+    // 以下都是推送过来的消息的xml的element所对应的属性
     ///////////////////////
 
     private String toUser;
@@ -150,7 +150,7 @@ public class WxMpXmlMessage implements Serializable {
      * 领取场景值,用于领取渠道数据统计。可在生成二维码接口及添加Addcard接口中自定义该字段的字符串值.
      * 核销卡券时:开发者发起核销时传入的自定义参数,用于进行核销渠道统计
      * 另外:
-     * 官网文档中,微信卡券>>卡券事件推送>>2.7 进入会员卡事件推送 user_view_card
+     * 官网文档中,卡券>>卡券事件推送>>2.7 进入会员卡事件推送 user_view_card
      * OuterStr:商户自定义二维码渠道参数,用于标识本次扫码打开会员卡来源来自于某个渠道值的二维码
      * </pre>
      */
@@ -168,7 +168,7 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * 核销来源.
-     * 支持开发者统计API核销(FROM_API)、公众平台核销(FROM_MP)、卡券商户助手核销(FROM_MOBILE_HELPER)(核销员微信号)
+     * 支持开发者统计API核销(FROM_API)、公众平台核销(FROM_MP)、卡券商户助手核销(FROM_MOBILE_HELPER)(核销员野火号)
      */
     private String consumeSource;
 
@@ -195,7 +195,7 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.10 库存报警事件card_sku_remind
+     * 官网文档中,卡券>>卡券事件推送>>2.10 库存报警事件card_sku_remind
      * Detail:报警详细信息.
      * </pre>
      */
@@ -203,7 +203,7 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.9 会员卡内容更新事件 update_member_card
+     * 官网文档中,卡券>>卡券事件推送>>2.9 会员卡内容更新事件 update_member_card
      * ModifyBonus:变动的积分值.
      * </pre>
      */
@@ -211,7 +211,7 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.9 会员卡内容更新事件 update_member_card
+     * 官网文档中,卡券>>卡券事件推送>>2.9 会员卡内容更新事件 update_member_card
      * ModifyBalance:变动的余额值.
      * </pre>
      */
@@ -219,15 +219,15 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
-     * TransId:微信支付交易订单号(只有使用买单功能核销的卡券才会出现).
+     * 官网文档中,卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
+     * TransId:支付交易订单号(只有使用买单功能核销的卡券才会出现).
      * </pre>
      */
     private String transId;
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
+     * 官网文档中,卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
      * LocationId:门店ID,当前卡券核销的门店ID(只有通过卡券商户助手和买单核销时才会出现)
      * </pre>
      */
@@ -235,7 +235,7 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
+     * 官网文档中,卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
      * Fee:实付金额,单位为分
      * </pre>
      */
@@ -243,7 +243,7 @@ public class WxMpXmlMessage implements Serializable {
 
     /**
      * <pre>
-     * 官网文档中,微信卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
+     * 官网文档中,卡券>>卡券事件推送>>2.6 买单事件推送 User_pay_from_pay_cell
      * OriginalFee:应付金额,单位为分
      * </pre>
      */
@@ -360,7 +360,7 @@ public class WxMpXmlMessage implements Serializable {
     private String storeUniqId;
 
     /**
-     * 微信的门店ID,微信内门店唯一标示ID.
+     * 的门店ID,内门店唯一标示ID.
      */
     //@XStreamAlias("PoiId")
     //@JacksonXmlProperty(localName = "PoiId")
@@ -383,12 +383,12 @@ public class WxMpXmlMessage implements Serializable {
     private String msg;
 
     ///////////////////////////////////////
-    // 微信认证事件推送
+    // 认证事件推送
     ///////////////////////////////////////
     /**
      * 资质认证成功/名称认证成功: 有效期 (整形),指的是时间戳,将于该时间戳认证过期.
      * 年审通知: 有效期 (整形),指的是时间戳,将于该时间戳认证过期,需尽快年审
-     * 认证过期失效通知: 有效期 (整形),指的是时间戳,表示已于该时间戳认证过期,需要重新发起微信认证
+     * 认证过期失效通知: 有效期 (整形),指的是时间戳,表示已于该时间戳认证过期,需要重新发起认证
      */
     //@XStreamAlias("ExpiredTime")
     //@JacksonXmlProperty(localName = "ExpiredTime")
@@ -407,7 +407,7 @@ public class WxMpXmlMessage implements Serializable {
     private String failReason;
 
     ///////////////////////////////////////
-    // 微信小店 6.1订单付款通知
+    // 小店 6.1订单付款通知
     ///////////////////////////////////////
     /**
      * 订单ID.
@@ -444,7 +444,7 @@ public class WxMpXmlMessage implements Serializable {
     private String skuInfo;
 
     ///////////////////////////////////////
-    // 微信硬件平台相关事件推送
+    // 硬件平台相关事件推送
     ///////////////////////////////////////
     /**
      * 设备类型.
@@ -467,7 +467,7 @@ public class WxMpXmlMessage implements Serializable {
     private String deviceId;
 
     /**
-     * 微信客户端生成的session id,用于request和response对应,
+     * 客户端生成的session id,用于request和response对应,
      * 因此响应中该字段第三方需要原封不变的带回
      */
     //@XStreamAlias("SessionID")
@@ -477,7 +477,7 @@ public class WxMpXmlMessage implements Serializable {
     private String sessionId;
 
     /**
-     * 微信用户账号的OpenID.
+     * 用户账号的OpenID.
      */
     //@XStreamAlias("OpenID")
     //@XStreamConverter(value = XStreamCDataConverter.class)
@@ -541,21 +541,21 @@ public class WxMpXmlMessage implements Serializable {
     private String keyStr;
 
     /**
-     * 用户在微信内设置的国家
+     * 用户在内设置的国家
      */
     //@XStreamAlias("Country")
     //@JacksonXmlProperty(localName = "Country")
     private String country;
 
     /**
-     * 用户在微信内设置的省份
+     * 用户在内设置的省份
      */
     //@XStreamAlias("Province")
     //@JacksonXmlProperty(localName = "Province")
     private String province;
 
     /**
-     * 用户在微信内设置的城市
+     * 用户在内设置的城市
      */
     //@XStreamAlias("City")
     //@JacksonXmlProperty(localName = "City")
@@ -654,7 +654,7 @@ public class WxMpXmlMessage implements Serializable {
     private String encrypt;
 
     public static WxMpXmlMessage fromXml(String xml) {
-        //修改微信变态的消息内容格式,方便解析
+        //修改变态的消息内容格式,方便解析
 //        xml = xml.replace("</PicList><PicList>", "");
 //        final WxMpXmlMessage xmlMessage = XStreamTransformer.fromXml(WxMpXmlMessage.class, xml);
 //        xmlMessage.setAllFieldsMap(XmlUtils.xml2Map(xml));

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/port/WxOAuth2UserInfo.java

@@ -41,13 +41,13 @@ public class WxOAuth2UserInfo implements Serializable {
     @SerializedName("headimgurl")
     private String headImgUrl;
     /**
-     * unionid	用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。
+     * unionid	用户统一标识。针对一个开放平台帐号下的应用,同一用户的unionid是唯一的。
      */
     @SerializedName("unionid")
     private String unionId;
 
     /**
-     * privilege	用户特权信息,json数组,如微信沃卡用户为(chinaunicom)
+     * privilege	用户特权信息,json数组,如沃卡用户为(chinaunicom)
      */
     @SerializedName("privilege")
     private String[] privileges;

+ 68 - 68
server/src/main/java/com/github/niefy/modules/wx/port/WxOpenErrorMsgEnum.java

@@ -678,9 +678,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_40131(40131, "out of limit of ticket"),
 
     /**
-     * 微信号不合法  invalid username
+     * 野火号不合法  invalid username
      */
-    CODE_40132(40132, "微信号不合法"),
+    CODE_40132(40132, "野火号不合法"),
 
     /**
      * invalid encryt data
@@ -1338,9 +1338,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_42006(42006, "component_access_token expired"),
 
     /**
-     * 用户修改微信密码, accesstoken 和 refreshtoken 失效,需要重新授权  access_token and refresh_token exception
+     * 用户修改密码, accesstoken 和 refreshtoken 失效,需要重新授权  access_token and refresh_token exception
      */
-    CODE_42007(42007, "用户修改微信密码, accesstoken 和 refreshtoken 失效,需要重新授权"),
+    CODE_42007(42007, "用户修改密码, accesstoken 和 refreshtoken 失效,需要重新授权"),
 
     /**
      * voip call key expired
@@ -1423,9 +1423,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_43014(43014, "require check agent"),
 
     /**
-     * require authorize by wechat team to use this function!
+     * require authorize by  team to use this function!
      */
-    CODE_43015(43015, "require authorize by wechat team to use this function!"),
+    CODE_43015(43015, "require authorize by  team to use this function!"),
 
     /**
      * 小程序未认证  require verify
@@ -2588,9 +2588,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_52000(52000, "pic is not from cdn"),
 
     /**
-     * wechat price is not less than origin price
+     *  price is not less than origin price
      */
-    CODE_52001(52001, "wechat price is not less than origin price"),
+    CODE_52001(52001, " price is not less than origin price"),
 
     /**
      * category/sku is wrong
@@ -2743,9 +2743,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_53017(53017, "公众号:小程序已有{名称  A+}时,需与该帐号相同主体才可申请{名称 A};小程序:公众号已有{名称 A+}时,需与该帐号相同主体才可申请{名称 A}"),
 
     /**
-     * 名称命中微信号  nickname hit alias
+     * 名称命中野火号  nickname hit alias
      */
-    CODE_53018(53018, "名称命中微信号"),
+    CODE_53018(53018, "名称命中野火号"),
 
     /**
      * 名称在保护期内  nickname protected by infringement
@@ -3098,9 +3098,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_61069(61069, "invalid admin"),
 
     /**
-     * name, idcard, wechat name not in accordance
+     * name, idcard,  name not in accordance
      */
-    CODE_61070(61070, "name, idcard, wechat name not in accordance"),
+    CODE_61070(61070, "name, idcard,  name not in accordance"),
 
     /**
      * invalid url
@@ -3408,9 +3408,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_61453(61453, "客服帐号已存在 (kf_account exsited)"),
 
     /**
-     * 客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的微信号 )(invalid  kf_acount  length)
+     * 客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的野火号 )(invalid  kf_acount  length)
      */
-    CODE_61454(61454, "客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的微信号 )(invalid  kf_acount  length)"),
+    CODE_61454(61454, "客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的野火号 )(invalid  kf_acount  length)"),
 
     /**
      * 客服帐号名包含非法字符 ( 仅允许英文 + 数字 )(illegal character in   kf_account)
@@ -3883,9 +3883,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_65401(65401, "invalid custom service account"),
 
     /**
-     * the custom service account need to bind a wechat user
+     * the custom service account need to bind a  user
      */
-    CODE_65402(65402, "the custom service account need to bind a wechat user"),
+    CODE_65402(65402, "the custom service account need to bind a  user"),
 
     /**
      * illegal nickname
@@ -3908,19 +3908,19 @@ public enum WxOpenErrorMsgEnum {
     CODE_65406(65406, "custom service account exists"),
 
     /**
-     * the wechat user have been one of your workers
+     * the  user have been one of your workers
      */
-    CODE_65407(65407, "the wechat user have been one of your workers"),
+    CODE_65407(65407, "the  user have been one of your workers"),
 
     /**
-     * you have already invited the wechat user
+     * you have already invited the  user
      */
-    CODE_65408(65408, "you have already invited the wechat user"),
+    CODE_65408(65408, "you have already invited the  user"),
 
     /**
-     * wechat account invalid
+     *  account invalid
      */
-    CODE_65409(65409, "wechat account invalid"),
+    CODE_65409(65409, " account invalid"),
 
     /**
      * too many custom service accounts bound by the worker
@@ -3933,9 +3933,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_65411(65411, "a effective invitation to bind the  custom service account exists"),
 
     /**
-     * the custom service account have been  bound by a wechat user
+     * the custom service account have been  bound by a  user
      */
-    CODE_65412(65412, "the custom service account have been  bound by a wechat user"),
+    CODE_65412(65412, "the custom service account have been  bound by a  user"),
 
     /**
      * no effective session for the customer
@@ -4153,9 +4153,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_68038(68038, "shipped but no fast mail info"),
 
     /**
-     * invalid wechat pay no
+     * invalid  pay no
      */
-    CODE_68039(68039, "invalid wechat pay no"),
+    CODE_68039(68039, "invalid  pay no"),
 
     /**
      * all product has been refunded, the  order can not be finished
@@ -4913,9 +4913,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_73214(73214, "the user is already a member"),
 
     /**
-     * 支付打通券能力已下线,请直接使用微信支付代金券API:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter1_1.shtml
+     * 支付打通券能力已下线,请直接使用支付代金券API:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter1_1.shtml
      */
-    CODE_73215(73215, "支付打通券能力已下线,请直接使用微信支付代金券API:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter1_1.shtml"),
+    CODE_73215(73215, "支付打通券能力已下线,请直接使用支付代金券API:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter1_1.shtml"),
 
     /**
      * 不合法的按钮名字,请从中选择一个:使用礼品卡/立即使用/去点外卖
@@ -5743,9 +5743,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_84006(84006, "name or id_card_number empty"),
 
     /**
-     * 微信号不存在或微信号设置为不可搜索  user not exist or user cannot be searched
+     * 野火号不存在或野火号设置为不可搜索  user not exist or user cannot be searched
      */
-    CODE_85001(85001, "微信号不存在或微信号设置为不可搜索"),
+    CODE_85001(85001, "野火号不存在或野火号设置为不可搜索"),
 
     /**
      * 小程序绑定的体验者数量达到上限  number of tester reach bind limit
@@ -5753,14 +5753,14 @@ public enum WxOpenErrorMsgEnum {
     CODE_85002(85002, "小程序绑定的体验者数量达到上限"),
 
     /**
-     * 微信号绑定的小程序体验者达到上限  user already bind too many weapps
+     * 野火号绑定的小程序体验者达到上限  user already bind too many weapps
      */
-    CODE_85003(85003, "微信号绑定的小程序体验者达到上限"),
+    CODE_85003(85003, "野火号绑定的小程序体验者达到上限"),
 
     /**
-     * 微信号已经绑定  user already bind
+     * 野火号已经绑定  user already bind
      */
-    CODE_85004(85004, "微信号已经绑定"),
+    CODE_85004(85004, "野火号已经绑定"),
 
     /**
      * appid not bind weapp
@@ -5873,9 +5873,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_85025(85025, "this phone reach bind limit"),
 
     /**
-     * this wechat account reach bind limit
+     * this  account reach bind limit
      */
-    CODE_85026(85026, "this wechat account reach bind limit"),
+    CODE_85026(85026, "this  account reach bind limit"),
 
     /**
      * this idcard reach bind limit
@@ -6238,14 +6238,14 @@ public enum WxOpenErrorMsgEnum {
     CODE_86003(86003, "component do not has category mall"),
 
     /**
-     * invalid wechat
+     * invalid 
      */
-    CODE_86004(86004, "invalid wechat"),
+    CODE_86004(86004, "invalid "),
 
     /**
-     * wechat limit frequency
+     *  limit frequency
      */
-    CODE_86005(86005, "wechat limit frequency"),
+    CODE_86005(86005, " limit frequency"),
 
     /**
      * has no quota to send group msg
@@ -6438,9 +6438,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_89001(89001, "not same contractor,Authorizer 与开放平台帐号主体不相同"),
 
     /**
-     * open not exists,该公众号/小程序未绑定微信开放平台帐号。  open not exists
+     * open not exists,该公众号/小程序未绑定开放平台帐号。  open not exists
      */
-    CODE_89002(89002, "open not exists,该公众号/小程序未绑定微信开放平台帐号。"),
+    CODE_89002(89002, "open not exists,该公众号/小程序未绑定开放平台帐号。"),
 
     /**
      * 该开放平台帐号并非通过 api 创建,不允许操作  open is not created by api
@@ -6878,9 +6878,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_91005(91005, "昵称 15 天主体保护"),
 
     /**
-     * 昵称命中微信号  nickname used by username
+     * 昵称命中野火号  nickname used by username
      */
-    CODE_91006(91006, "昵称命中微信号"),
+    CODE_91006(91006, "昵称命中野火号"),
 
     /**
      * 昵称已被占用  nickname used
@@ -7078,9 +7078,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_94001(94001, "missing cert_serialno"),
 
     /**
-     * use not register wechat pay
+     * use not register  pay
      */
-    CODE_94002(94002, "use not register wechat pay"),
+    CODE_94002(94002, "use not register  pay"),
 
     /**
      * invalid sign
@@ -7363,9 +7363,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_300029(300029, "主播昵称违规"),
 
     /**
-     * 主播微信号不合法
+     * 主播野火号不合法
      */
-    CODE_300030(300030, "主播微信号不合法"),
+    CODE_300030(300030, "主播野火号不合法"),
 
     /**
      * 直播间封面图不合规
@@ -7383,19 +7383,19 @@ public enum WxOpenErrorMsgEnum {
     CODE_300033(300033, "添加商品超过直播间上限"),
 
     /**
-     * 主播微信昵称长度不符合要求
+     * 主播昵称长度不符合要求
      */
-    CODE_300034(300034, "主播微信昵称长度不符合要求"),
+    CODE_300034(300034, "主播昵称长度不符合要求"),
 
     /**
-     * 主播微信号不存在
+     * 主播野火号不存在
      */
-    CODE_300035(300035, "主播微信号不存在"),
+    CODE_300035(300035, "主播野火号不存在"),
 
     /**
-     * 主播微信号未实名认证
+     * 主播野火号未实名认证
      */
-    CODE_300036(300036, "主播微信号未实名认证"),
+    CODE_300036(300036, "主播野火号未实名认证"),
 
     /**
      * invalid file name
@@ -8203,9 +8203,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_9207000(9207000, "boss error"),
 
     /**
-     * wechat pay error
+     *  pay error
      */
-    CODE_9207001(9207001, "wechat pay error"),
+    CODE_9207001(9207001, " pay error"),
 
     /**
      * boss param error
@@ -8763,9 +8763,9 @@ public enum WxOpenErrorMsgEnum {
     CODE_9300708(9300708, "wxpay overlimit"),
 
     /**
-     * 无效的微信
+     * 无效的野火
      */
-    CODE_9300801(9300801, "无效的微信号"),
+    CODE_9300801(9300801, "无效的野火号"),
 
     /**
      * 服务号未开通导购功能
@@ -8773,19 +8773,19 @@ public enum WxOpenErrorMsgEnum {
     CODE_9300802(9300802, "服务号未开通导购功能"),
 
     /**
-     * 微信号已经绑定为导购
+     * 野火号已经绑定为导购
      */
-    CODE_9300803(9300803, "微信号已经绑定为导购"),
+    CODE_9300803(9300803, "野火号已经绑定为导购"),
 
     /**
-     * 该微信号不是导购
+     * 该野火号不是导购
      */
-    CODE_9300804(9300804, "该微信号不是导购"),
+    CODE_9300804(9300804, "该野火号不是导购"),
 
     /**
-     * 微信号已经被其他账号绑定为导购
+     * 野火号已经被其他账号绑定为导购
      */
-    CODE_9300805(9300805, "微信号已经被其他账号绑定为导购"),
+    CODE_9300805(9300805, "野火号已经被其他账号绑定为导购"),
 
     /**
      * 粉丝和导购不存在绑定关系
@@ -9138,14 +9138,14 @@ public enum WxOpenErrorMsgEnum {
     CODE_9403002(9403002, "消息字段的内容违规!"),
 
     /**
-     * 发送的微信号太多!
+     * 发送的野火号太多!
      */
-    CODE_9403003(9403003, "发送的微信号太多!"),
+    CODE_9403003(9403003, "发送的野火号太多!"),
 
     /**
-     * 存在错误的微信号!
+     * 存在错误的野火号!
      */
-    CODE_9403004(9403004, "存在错误的微信号!"),
+    CODE_9403004(9403004, "存在错误的野火号!"),
 
     /**
      * 直播间列表为空  live room not exsits

+ 5 - 5
server/src/main/java/com/github/niefy/modules/wx/port/WxType.java

@@ -2,23 +2,23 @@ package com.github.niefy.modules.wx.port;
 
 public enum WxType {
     /**
-     * 企业微信.
+     * 企业.
      */
     CP,
     /**
-     * 微信公众号.
+     * 公众号.
      */
     MP,
     /**
-     * 微信小程序.
+     * 小程序.
      */
     MiniApp,
     /**
-     * 微信开放平台.
+     * 开放平台.
      */
     Open,
     /**
-     * 微信支付.
+     * 支付.
      */
     Pay;
 }

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/port/WxUserTag.java

@@ -11,7 +11,7 @@ public class WxUserTag implements Serializable {
     private static final long serialVersionUID = -7722428695667031252L;
 
     /**
-     * 标签id,由微信分配.
+     * 标签id,由分配.
      */
     private Long id;
 

+ 2 - 2
server/src/main/java/com/github/niefy/modules/wx/service/MsgReplyService.java

@@ -8,13 +8,13 @@ import org.slf4j.LoggerFactory;
 /**
  * 公众号消息处理
  * 官方文档:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html#7
- * WxJava客服消息文档:https://github.com/Wechat-Group/WxJava/wiki/MP_主动发送消息(客服消息)
+ * WxJava客服消息文档:https://github.com/-Group/WxJava/wiki/MP_主动发送消息(客服消息)
  */
 public interface MsgReplyService {
     Logger logger = LoggerFactory.getLogger(MsgReplyService.class);
 
     /**
-     * 根据规则配置通过微信客服消息接口自动回复消息
+     * 根据规则配置通过客服消息接口自动回复消息
      *
      *
      * @param appid

+ 0 - 41
server/src/main/java/com/github/niefy/modules/wx/service/MsgTemplateService.java

@@ -1,41 +0,0 @@
-package com.github.niefy.modules.wx.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.github.niefy.modules.wx.entity.MsgTemplate;
-
-import com.github.niefy.modules.wx.port.WxErrorException;
-
-import com.github.niefy.common.utils.PageUtils;
-
-import java.util.Map;
-
-/**
- * 消息模板
- *
- * @author niefy
- * @email niefy@qq.com
- * @date 2019-11-12 18:30:15
- */
-public interface MsgTemplateService extends IService<MsgTemplate> {
-    /**
-     * 分页查询用户数据
-     * @param params 查询参数
-     * @return PageUtils 分页结果
-     */
-    PageUtils queryPage(Map<String, Object> params);
-
-    /**
-     * 通过模板名称查询
-     *
-     * @param name
-     * @return
-     */
-    MsgTemplate selectByName(String name);
-
-    /**
-     * 同步公众号已添加的消息模板
-     * @throws WxErrorException
-     */
-    void syncWxTemplate(String appid) throws WxErrorException;
-}
-

+ 0 - 23
server/src/main/java/com/github/niefy/modules/wx/service/TemplateMsgLogService.java

@@ -1,23 +0,0 @@
-package com.github.niefy.modules.wx.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.modules.wx.entity.TemplateMsgLog;
-
-import java.util.Map;
-
-public interface TemplateMsgLogService extends IService<TemplateMsgLog> {
-    /**
-     * 分页查询用户数据
-     * @param params 查询参数
-     * @return PageUtils 分页结果
-     */
-    PageUtils queryPage(Map<String, Object> params);
-
-    /**
-     * 记录log,异步入库
-     *
-     * @param log
-     */
-    void addLog(TemplateMsgLog log);
-}

+ 0 - 18
server/src/main/java/com/github/niefy/modules/wx/service/TemplateMsgService.java

@@ -1,18 +0,0 @@
-package com.github.niefy.modules.wx.service;
-
-import com.github.niefy.modules.wx.form.TemplateMsgBatchForm;
-import com.github.niefy.modules.wx.port.WxMpTemplateMessage;
-
-public interface TemplateMsgService {
-    /**
-     * 发送微信模版消息
-     */
-    void sendTemplateMsg(WxMpTemplateMessage msg, String appid);
-
-    /**
-     * 批量消息发送
-     * @param form
-     * @param appid
-     */
-    void sendMsgBatch(TemplateMsgBatchForm form,String appid);
-}

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/service/WxMsgService.java

@@ -9,7 +9,7 @@ import com.github.niefy.modules.wx.entity.WxMsg;
 import java.util.Map;
 
 /**
- * 微信消息
+ * 消息
  *
  * @author niefy
  * @date 2020-05-14 17:28:34

+ 0 - 37
server/src/main/java/com/github/niefy/modules/wx/service/WxQrCodeService.java

@@ -1,37 +0,0 @@
-package com.github.niefy.modules.wx.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.modules.wx.entity.WxQrCode;
-import com.github.niefy.modules.wx.form.WxQrCodeForm;
-import com.github.niefy.modules.wx.port.WxErrorException;
-import com.github.niefy.modules.wx.port.WxMpQrCodeTicket;
-
-import java.util.Map;
-
-/**
- * 公众号带参二维码
- *
- * @author niefy
- * @email niefy@qq.com
- * @date 2020-01-02 11:11:55
- */
-public interface WxQrCodeService extends IService<WxQrCode> {
-    /**
-     * 分页查询用户数据
-     * @param params 查询参数
-     * @return PageUtils 分页结果
-     */
-    PageUtils queryPage(Map<String, Object> params);
-
-    /**
-     * 创建公众号带参二维码
-     *
-     *
-     * @param appid
-     * @param form
-     * @return
-     */
-    WxMpQrCodeTicket createQrCode(String appid, WxQrCodeForm form) throws WxErrorException;
-}
-

+ 3 - 3
server/src/main/java/com/github/niefy/modules/wx/service/impl/MsgReplyServiceImpl.java

@@ -27,9 +27,9 @@ import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 /**
- * 微信公众号消息处理
+ * 公众号消息处理
  * 官方文档:https://developers.weixin.qq.com/doc/offiaccount/Message_Ma nagement/Service_Center_messages.html#7
- * 参考WxJava客服消息文档:https://github.com/Wechat-Group/WxJava/wiki/MP_主动发送消息(客服消息)
+ * 参考WxJava客服消息文档:https://github.com/-Group/WxJava/wiki/MP_主动发送消息(客服消息)
  */
 @Service
 @RequiredArgsConstructor
@@ -47,7 +47,7 @@ public class MsgReplyServiceImpl implements MsgReplyService {
     private WxAccountService wxAccountService;
 
     /**
-     * 根据规则配置通过微信客服消息接口自动回复消息
+     * 根据规则配置通过客服消息接口自动回复消息
      *
      *
      * @param appid 公众号appid

+ 0 - 59
server/src/main/java/com/github/niefy/modules/wx/service/impl/MsgTemplateServiceImpl.java

@@ -1,59 +0,0 @@
-package com.github.niefy.modules.wx.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.niefy.modules.wx.dao.MsgTemplateMapper;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.common.utils.Query;
-import com.github.niefy.modules.wx.entity.MsgTemplate;
-import com.github.niefy.modules.wx.port.WxErrorException;
-import com.github.niefy.modules.wx.port.WxMpTemplate;
-import com.github.niefy.modules.wx.service.MsgTemplateService;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-
-@Service("msgTemplateService")
-public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTemplate> implements MsgTemplateService {
-
-    @Override
-    public PageUtils queryPage(Map<String, Object> params) {
-        String title = (String) params.get("title");
-        String name = (String) params.get("name");
-        String appid = (String) params.get("appid");
-        IPage<MsgTemplate> page = this.page(
-            new Query<MsgTemplate>().getPage(params),
-            new QueryWrapper<MsgTemplate>()
-                .eq(StringUtils.hasText(appid), "appid", appid)
-                .like(StringUtils.hasText(title), "title", title)
-                .like(StringUtils.hasText(name), "name", name)
-        );
-
-        return new PageUtils(page);
-    }
-
-    @Override
-    public MsgTemplate selectByName(String name) {
-        Assert.hasText(name, "模板名称不得为空");
-        return this.getOne(new QueryWrapper<MsgTemplate>()
-            .eq("name", name)
-            .eq("status", 1)
-            .last("LIMIT 1"));
-    }
-
-    @Override
-    public void syncWxTemplate(String appid) throws WxErrorException {
-//        List<WxMpTemplate> wxMpTemplateList= wxService.getTemplateMsgService().getAllPrivateTemplate();
-//        List<MsgTemplate> templates = wxMpTemplateList.stream().map(item->new MsgTemplate(item,appid)).collect(Collectors.toList());
-//        this.saveBatch(templates);
-    }
-
-}

+ 0 - 42
server/src/main/java/com/github/niefy/modules/wx/service/impl/TemplateMsgLogServiceImpl.java

@@ -1,42 +0,0 @@
-package com.github.niefy.modules.wx.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.common.utils.Query;
-import com.github.niefy.modules.wx.dao.TemplateMsgLogMapper;
-import com.github.niefy.modules.wx.entity.TemplateMsgLog;
-import com.github.niefy.modules.wx.service.TemplateMsgLogService;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import java.util.Map;
-
-@Service
-public class TemplateMsgLogServiceImpl extends ServiceImpl<TemplateMsgLogMapper, TemplateMsgLog> implements TemplateMsgLogService {
-
-    @Override
-    public PageUtils queryPage(Map<String, Object> params) {
-        String appid = (String) params.get("appid");
-        IPage<TemplateMsgLog> page = this.page(
-            new Query<TemplateMsgLog>().getPage(params),
-            new QueryWrapper<TemplateMsgLog>()
-                    .eq(StringUtils.hasText(appid), "appid", appid)
-        );
-
-        return new PageUtils(page);
-    }
-
-    /**
-     * 记录log,异步入库
-     *
-     * @param log
-     */
-    @Override
-    @Async
-    public void addLog(TemplateMsgLog log) {
-        this.baseMapper.insert(log);
-    }
-}

+ 0 - 93
server/src/main/java/com/github/niefy/modules/wx/service/impl/TemplateMsgServiceImpl.java

@@ -1,93 +0,0 @@
-package com.github.niefy.modules.wx.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.github.niefy.config.TaskExcutor;
-import com.github.niefy.modules.wx.entity.TemplateMsgLog;
-import com.github.niefy.modules.wx.entity.WxUser;
-import com.github.niefy.modules.wx.form.TemplateMsgBatchForm;
-import com.github.niefy.modules.wx.port.WxMpService;
-import com.github.niefy.modules.wx.port.WxMpTemplateMessage;
-import com.github.niefy.modules.wx.service.MsgTemplateService;
-import com.github.niefy.modules.wx.service.TemplateMsgLogService;
-import com.github.niefy.modules.wx.service.TemplateMsgService;
-import com.github.niefy.modules.wx.service.WxUserService;
-import lombok.RequiredArgsConstructor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Nifury
- * @date 2017-9-27
- */
-@Service
-@RequiredArgsConstructor
-public class TemplateMsgServiceImpl implements TemplateMsgService {
-    Logger logger = LoggerFactory.getLogger(this.getClass());
-    @Autowired
-    private TemplateMsgLogService templateMsgLogService;
-    private final WxMpService wxService;
-    @Autowired
-    MsgTemplateService msgTemplateService;
-    @Autowired
-	WxUserService wxUserService;
-
-    /**
-     * 发送微信模版消息,使用固定线程的线程池
-     */
-    @Override
-    @Async
-    public void sendTemplateMsg(WxMpTemplateMessage msg, String appid) {
-        TaskExcutor.submit(() -> {
-            String result = null;
-//            try {
-//                wxService.switchover(appid);
-//                result = wxService.getTemplateMsgService().sendTemplateMsg(msg);
-//            } catch (WxErrorException e) {
-//                result = e.getMessage();
-//            }
-
-            //保存发送日志
-            TemplateMsgLog log = new TemplateMsgLog(msg,appid, result);
-            templateMsgLogService.addLog(log);
-        });
-    }
-
-    @Override
-	@Async
-    public void sendMsgBatch(TemplateMsgBatchForm form, String appid) {
-		logger.info("批量发送模板消息任务开始,参数:{}",form.toString());
-//        wxService.switchover(appid);
-		WxMpTemplateMessage.WxMpTemplateMessageBuilder builder = WxMpTemplateMessage.builder()
-				.templateId(form.getTemplateId())
-				.url(form.getUrl())
-				.miniProgram(form.getMiniprogram())
-				.data(form.getData());
-		Map<String, Object> filterParams = form.getWxUserFilterParams();
-		if(filterParams==null) {
-            filterParams=new HashMap<>(8);
-        }
-		long currentPage=1L,totalPages=Long.MAX_VALUE;
-		filterParams.put("appid",appid);
-        filterParams.put("limit","500");
-		while (currentPage<=totalPages){
-			filterParams.put("page",String.valueOf(currentPage));
-            //按条件查询用户
-			IPage<WxUser> wxUsers = wxUserService.queryPage(filterParams);
-			logger.info("批量发送模板消息任务,使用查询条件,处理第{}页,总用户数:{}",currentPage,wxUsers.getTotal());
-			wxUsers.getRecords().forEach(user->{
-				WxMpTemplateMessage msg = builder.toUser(user.getOpenid()).build();
-				this.sendTemplateMsg(msg,appid);
-			});
-			currentPage=wxUsers.getCurrent()+1L;
-			totalPages=wxUsers.getPages();
-		}
-		logger.info("批量发送模板消息任务结束");
-    }
-
-}

+ 0 - 69
server/src/main/java/com/github/niefy/modules/wx/service/impl/WxQrCodeServiceImpl.java

@@ -1,69 +0,0 @@
-package com.github.niefy.modules.wx.service.impl;
-
-import com.github.niefy.modules.wx.dao.WxQrCodeMapper;
-import com.github.niefy.modules.wx.entity.WxQrCode;
-import com.github.niefy.modules.wx.form.WxQrCodeForm;
-import com.github.niefy.modules.wx.port.WxErrorException;
-import com.github.niefy.modules.wx.port.WxMpQrCodeTicket;
-import com.github.niefy.modules.wx.port.WxMpService;
-import com.github.niefy.modules.wx.service.WxQrCodeService;
-import lombok.RequiredArgsConstructor;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.Map;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.niefy.common.utils.PageUtils;
-import com.github.niefy.common.utils.Query;
-import org.springframework.util.StringUtils;
-
-
-@Service("wxQrCodeService")
-@RequiredArgsConstructor
-public class WxQrCodeServiceImpl extends ServiceImpl<WxQrCodeMapper, WxQrCode> implements WxQrCodeService {
-    private final WxMpService wxService;
-
-    @Override
-    public PageUtils queryPage(Map<String, Object> params) {
-        String sceneStr = (String) params.get("sceneStr");
-        String appid = (String) params.get("appid");
-        IPage<WxQrCode> page = this.page(
-            new Query<WxQrCode>().getPage(params),
-            new QueryWrapper<WxQrCode>()
-                    .eq(StringUtils.hasText(appid), "appid", appid)
-                    .like(StringUtils.hasText(sceneStr), "scene_str", sceneStr)
-        );
-
-        return new PageUtils(page);
-    }
-
-    /**
-     * 创建公众号带参二维码
-     *
-     *
-     * @param appid
-     * @param form
-     * @return
-     */
-    @Override
-    public WxMpQrCodeTicket createQrCode(String appid, WxQrCodeForm form) throws WxErrorException {
-        WxMpQrCodeTicket ticket = null;
-//        if (form.getIsTemp()) {//创建临时二维码
-//            ticket = wxService.getQrcodeService().qrCodeCreateTmpTicket(form.getSceneStr(), form.getExpireSeconds());
-//        } else {//创建永久二维码
-//            ticket = wxService.getQrcodeService().qrCodeCreateLastTicket(form.getSceneStr());
-//        }
-        WxQrCode wxQrCode = new WxQrCode(form,appid);
-        wxQrCode.setTicket(ticket.getTicket());
-        wxQrCode.setUrl(ticket.getUrl());
-        if (form.getIsTemp()) {
-            wxQrCode.setExpireTime(new Date(System.currentTimeMillis() + ticket.getExpireSeconds() * 1000L));
-        }
-        this.save(wxQrCode);
-        return ticket;
-    }
-
-}

+ 1 - 1
server/src/main/java/com/github/niefy/modules/wx/service/impl/WxUserServiceImpl.java

@@ -75,7 +75,7 @@ public class WxUserServiceImpl extends ServiceImpl<WxUserMapper, WxUser> impleme
     @Override
     public WxUser refreshUserInfo(String openid,String appid) {
         try {
-			// 获取微信用户基本信息
+			// 获取用户基本信息
 			logger.info("更新用户信息,openid={}",openid);
 			ChannelServiceApi api = wxAccountService.getApi(appid);
 			IMResult<InputOutputUserInfo>  imResult = api.getUserInfo(openid);

+ 0 - 5
server/src/main/resources/mapper/wx/MsgTemplateMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.github.niefy.modules.wx.dao.MsgTemplateMapper">
-    <cache-ref namespace="com.github.niefy.modules.wx.dao.MsgTemplateMapper"/>
-</mapper>

+ 0 - 6
server/src/main/resources/mapper/wx/TemplateMsgLogMapper.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.github.niefy.modules.wx.dao.TemplateMsgLogMapper">
-
-
-</mapper>

+ 0 - 7
server/src/main/resources/mapper/wx/WxQrCodeMapper.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.github.niefy.modules.wx.dao.WxQrCodeMapper">
-    <cache-ref namespace="com.github.niefy.modules.wx.dao.WxQrCodeMapper"/>
-
-</mapper>

+ 4 - 61
server/src/main/resources/sql/data.sql

@@ -120,21 +120,15 @@ INSERT INTO `sys_menu` VALUES (67, 66, '查看', NULL, 'wx:msgreplyrule:list,wx:
 INSERT INTO `sys_menu` VALUES (68, 66, '新增', NULL, 'wx:msgreplyrule:save', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (69, 66, '修改', NULL, 'wx:msgreplyrule:update', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (70, 66, '删除', NULL, 'wx:msgreplyrule:delete', 2, NULL, 6);
-INSERT INTO `sys_menu` VALUES (71, 6, '模板消息', 'wx/msg-template', NULL, 1, 'config', 6);
 INSERT INTO `sys_menu` VALUES (72, 71, '查看', NULL, 'wx:msgtemplate:list,wx:msgtemplate:info', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (73, 71, '新增', NULL, 'wx:msgtemplate:save', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (74, 71, '修改', NULL, 'wx:msgtemplate:update', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (75, 71, '删除', NULL, 'wx:msgtemplate:delete', 2, NULL, 6);
-INSERT INTO `sys_menu` VALUES (81, 9, '模版消息发送记录', 'wx/template-msg-log', NULL, 1, 'config', 6);
 INSERT INTO `sys_menu` VALUES (84, 81, '列表', NULL, 'wx:templatemsglog:list', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (85, 81, '删除', NULL, 'wx:templatemsglog:delete', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (99, 32, '更新公众号菜单', '', 'wx:menu:save', 2, '', 0);
 INSERT INTO `sys_menu` VALUES (100, 33, '查看', '', 'wx:wxassets:list', 2, '', 0);
 INSERT INTO `sys_menu` VALUES (101, 33, '新增修改', '', 'wx:wxassets:save', 2, '', 0);
-INSERT INTO `sys_menu` VALUES (103, 6, '带参二维码', 'wx/wx-qrcode', NULL, 1, 'config', 6);
-INSERT INTO `sys_menu` VALUES (104, 103, '查看', NULL, 'wx:wxqrcode:list,wx:wxqrcode:info', 2, NULL, 6);
-INSERT INTO `sys_menu` VALUES (105, 103, '新增', NULL, 'wx:wxqrcode:save', 2, NULL, 6);
-INSERT INTO `sys_menu` VALUES (107, 103, '删除', NULL, 'wx:wxqrcode:delete', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (108, 6, '粉丝管理', 'wx/wx-user', NULL, 1, 'config', 6);
 INSERT INTO `sys_menu` VALUES (109, 108, '查看', NULL, 'wx:wxuser:list,wx:wxuser:info', 2, NULL, 6);
 INSERT INTO `sys_menu` VALUES (110, 108, '删除', NULL, 'wx:wxuser:delete', 2, NULL, 6);
@@ -240,13 +234,13 @@ CREATE TABLE IF NOT EXISTS `wx_account`  (
 CREATE TABLE IF NOT EXISTS `wx_msg`  (
   `id` bigint(20) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键',
   `appid` char(36) NOT NULL COMMENT 'appid',
-  `openid` varchar(36) NOT NULL COMMENT '微信用户ID',
+  `openid` varchar(36) NOT NULL COMMENT '用户ID',
   `in_out` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '消息方向',
   `msg_type` char(25) NULL DEFAULT NULL COMMENT '消息类型',
   `detail` json NULL COMMENT '消息详情',
   `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
   INDEX `idx_appid`(`appid`)
-) ENGINE = InnoDB AUTO_INCREMENT = 9 DEFAULT CHARACTER SET = utf8mb4 COMMENT = '微信消息' ROW_FORMAT = Dynamic;
+) ENGINE = InnoDB AUTO_INCREMENT = 9 DEFAULT CHARACTER SET = utf8mb4 COMMENT = '消息' ROW_FORMAT = Dynamic;
 
 -- ----------------------------
 -- Table structure for wx_msg_reply_rule
@@ -273,65 +267,14 @@ CREATE TABLE IF NOT EXISTS `wx_msg_reply_rule`  (
 -- Records of wx_msg_reply_rule
 -- ----------------------------
 INSERT INTO `wx_msg_reply_rule` VALUES (1, '', '关注公众号', 'subscribe', 0, 'text', '你好,欢迎关注!', 1, '关注回复', '00:00:00', '23:59:59', 0, '2020-05-20 15:15:00');
-INSERT INTO `wx_msg_reply_rule` VALUES (2, '', '默认回复', 'default_reply', 1, 'text', '您好,感谢您对我们的关注和支持!如果您有问题,请仔细阅读我们的文档(http://docs.wildfirechat.cn),或者在github上给我们提Issue(https://github.com/wildfirechat),或者在论坛(http://docs.wildfirechat.cn)发帖提问。如果有商务问题,请加我们微信好友(微信ID:wildfirechat 或 wfchat)', 1, '没有匹配到回复时的默认回复', '00:00:00', '23:59:59', 0, '2020-05-20 15:15:00');
+INSERT INTO `wx_msg_reply_rule` VALUES (2, '', '默认回复', 'default_reply', 1, 'text', '您好,感谢您对我们的关注和支持!如果您有问题,请仔细阅读我们的文档(http://docs.wildfirechat.cn),或者在github上给我们提Issue(https://github.com/wildfirechat),或者在论坛(http://docs.wildfirechat.cn)发帖提问。如果有商务问题,请加我们好友(ID:wildfirechat 或 wfchat)', 1, '没有匹配到回复时的默认回复', '00:00:00', '23:59:59', 0, '2020-05-20 15:15:00');
 
--- ----------------------------
--- Table structure for wx_msg_template
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `wx_msg_template`  (
-  `id` bigint(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'id',
-  `appid` char(36) NOT NULL COMMENT 'appid',
-  `template_id` varchar(100) NOT NULL COMMENT '公众号模板ID',
-  `name` varchar(50) NULL DEFAULT NULL COMMENT '模版名称',
-  `title` varchar(20) NULL DEFAULT NULL COMMENT '标题',
-  `content` text NULL COMMENT '模板内容',
-  `data` json NULL COMMENT '消息内容',
-  `url` varchar(255) NULL DEFAULT NULL COMMENT '链接',
-  `miniprogram` json NULL COMMENT '小程序信息',
-  `status` tinyint(1) UNSIGNED NOT NULL COMMENT '是否有效',
-  `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
-  UNIQUE INDEX `idx_name`(`name`),
-  INDEX `idx_status`(`status`),
-  INDEX `idx_template_appid`(`appid`)
-) ENGINE = InnoDB AUTO_INCREMENT = 62 DEFAULT CHARACTER SET = utf8mb4 COMMENT = '消息模板' ROW_FORMAT = Dynamic;
-
-
--- ----------------------------
--- Table structure for wx_qr_code
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `wx_qr_code`  (
-  `id` bigint(20) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
-  `appid` char(36) NOT NULL COMMENT 'appid',
-  `is_temp` tinyint(1) NULL DEFAULT NULL COMMENT '是否为临时二维码',
-  `scene_str` varchar(64) NULL DEFAULT NULL COMMENT '场景值ID',
-  `ticket` varchar(255) NULL DEFAULT NULL COMMENT '二维码ticket',
-  `url` varchar(255) NULL DEFAULT NULL COMMENT '二维码图片解析后的地址',
-  `expire_time` datetime(0) NULL DEFAULT NULL COMMENT '该二维码失效时间',
-  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '该二维码创建时间',
-  INDEX `idx_qr_appid`(`appid`)
-) ENGINE = InnoDB AUTO_INCREMENT = 4 DEFAULT CHARACTER SET = utf8mb4 COMMENT = '公众号带参二维码' ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for wx_template_msg_log
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `wx_template_msg_log`  (
-  `log_id` bigint(11) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
-  `appid` char(36) NOT NULL COMMENT 'appid',
-  `touser` varchar(50) NULL DEFAULT NULL COMMENT '用户openid',
-  `template_id` varchar(50) NULL DEFAULT NULL COMMENT 'templateid',
-  `data` json NULL COMMENT '消息数据',
-  `url` varchar(255) NULL DEFAULT NULL COMMENT '消息链接',
-  `miniprogram` json NULL COMMENT '小程序信息',
-  `send_time` datetime(0) NULL DEFAULT NULL COMMENT '发送时间',
-  `send_result` varchar(255) NULL DEFAULT NULL COMMENT '发送结果',
-  INDEX `idx_template_log_appid`(`appid`)
-) ENGINE = InnoDB AUTO_INCREMENT = 116250 DEFAULT CHARACTER SET = utf8mb4 COMMENT = '微信模版消息发送记录' ROW_FORMAT = Dynamic;
 
 -- ----------------------------
 -- Table structure for wx_user
 -- ----------------------------
 CREATE TABLE IF NOT EXISTS `wx_user`  (
-  `openid` varchar(50) NOT NULL PRIMARY KEY COMMENT '微信openid',
+  `openid` varchar(50) NOT NULL PRIMARY KEY COMMENT 'openid',
   `appid` char(36) NOT NULL COMMENT 'appid',
   `phone` char(11) NULL DEFAULT NULL COMMENT '手机号',
   `nickname` varchar(50) NULL DEFAULT NULL COMMENT '昵称',