項目背景
隨著微信小程序的正式上線柄瑰,我卻又做了個公眾號的開發(fā)换吧。算起來這是我第三個微信公眾號的web項目開發(fā)务嫡,但是每一次項目的架構(gòu)都有挺大的變化甲抖。這一次,我也自己獨立封裝了一些微信公眾號必要的工具包心铃,使得自己開發(fā)效率更高准谚。另外,這次項目是與微信硬件有關(guān)系的(個人感覺都是業(yè)務(wù)上的關(guān)系)去扣,所以也拓展了一些邊緣學(xué)科的知識柱衔。不過..我可不想再玩這個了樊破,有時間想做個小程序玩玩呢。
項目介紹
前臺采用的是react
框架的單頁模式唆铐,后臺使用spring boot
哲戚,后臺全部以restful
接口的形式開發(fā)給前臺或者微信服務(wù)器調(diào)用,另外這些接口由另一個網(wǎng)關(guān)服務(wù)統(tǒng)一做權(quán)限開放和負載均衡艾岂,采用簡單的spring cloud
模塊化組件顺少。關(guān)于微服務(wù)的一些部署和相關(guān)介紹我會在接下來的博客中做介紹。
項目地址
我把微信部分留存下來了王浴,業(yè)務(wù)邏輯處理等模塊去除脆炎。供大家參考討論。
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/...