微信公众号的后台搭建源码分享

项目背景

随着微信小程序的正式上线,我却又做了个公众号的开发。算起来这是我第三个微信公众号的web项目开发,但是每一次项目的架构都有挺大的变化。这一次,我也自己独立封装了一些微信公众号必要的工具包,使得自己开发效率更高。另外,这次项目是与微信硬件有关系的(个人感觉都是业务上的关系),所以也拓展了一些边缘学科的知识。不过..我可不想再玩这个了,有时间想做个小程序玩玩呢。

项目介绍

前台采用的是react框架的单页模式,后台使用spring boot,后台全部以restful接口的形式开发给前台或者微信服务器调用,另外这些接口由另一个网关服务统一做权限开放和负载均衡,采用简单的spring cloud模块化组件。关于微服务的一些部署和相关介绍我会在接下来的博客中做介绍。

项目地址

我把微信部分留存下来了,业务逻辑处理等模块去除。供大家参考讨论。
spring-boot-wechat

项目README

Introduce

the project is based on spring boot,contain with wechat utils。

Structure

.
├── log
├── src
│   ├── main
│   │   ├── java
│   │   │   ├── com
│   │   │   │   └── senthink
│   │   │   │       └── www
│   │   │   │           ├── async       # async task
│   │   │   │           ├── common      # common utils
│   │   │   │           ├── config      # packaging config from bootstrap.yml
│   │   │   │           ├── convert     # [mapstruct](http://mapstruct.org/)
│   │   │   │           ├── dao         # IMapper
│   │   │   │           ├── domain
│   │   │   │           │   ├── dto     # Data Transfer Object(return to front)
│   │   │   │           │   ├── po      # persistant object(entity corresponding to sql)
│   │   │   │           │   │   └── wechat  # wechat entity like Article
│   │   │   │           │   └── vo      # view object (receive param from front)
│   │   │   │           ├── enums       # enums class
│   │   │   │           ├── exception   # global exception catcher
│   │   │   │           ├── filter      # filter to solve cross-domain access
│   │   │   │           ├── response    # return class packaging
│   │   │   │           ├── service     # Service
│   │   │   │           ├── util        # the same as common package
│   │   │   │           └── web         # Controller
│   │   │   │               └── notify  # receive message from wechat server
│   │   │   └── gatling                 # test utils
│   │   └── resources
│   │       ├── gatling
│   │       │   └── data
│   │       └── mapper                  # mybatis plus mapper
│   └── test
│       ├── java
│       │   └── com
│       │       └── senthink
│       │           └── www
│       └── scala
│           └── gatling
└── target

Reminder

If some error or warning happens when projects starting,it might be you missed dependency.Such as redis,mongo,etc.Please delete config about that or install the necessary software.

How to use

Start the project with RUN class DemoApplication.To test your interface on http://127.0.0.1:8010/wechatdemo/...

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,798评论 19 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,116评论 6 342
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,888评论 25 709
  • 看着封面上的老虎站在一只椅子上,我顿时感到十分害怕,不知这是为何?读完后我终于明白了。 这本书主要...
    龙卷风暴阅读 4,806评论 0 0
  • 风荷初露(外一首)—— 『我的思念』之东湖诗影印象五月,立夏降至,东湖的荷,此刻正迎风初长,只是,湖水却几近乾涸,...
    简书_红豆阅读 5,323评论 8 37