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