微信公眾號(hào)的后臺(tái)搭建源碼分享

項(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/...

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,506評(píng)論 19 139
  • Spring Boot 參考指南 介紹 轉(zhuǎn)載自:https://www.gitbook.com/book/qbgb...
    毛宇鵬閱讀 47,256評(píng)論 6 342
  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 178,816評(píng)論 25 709
  • 看著封面上的老虎站在一只椅子上,我頓時(shí)感到十分害怕,不知這是為何?讀完后我終于明白了。 這本書(shū)主要...
    龍卷風(fēng)暴閱讀 1,205評(píng)論 0 0
  • 風(fēng)荷初露(外一首)—— 『我的思念』之東湖詩(shī)影印象五月,立夏降至,東湖的荷,此刻正迎風(fēng)初長(zhǎng),只是,湖水卻幾近乾涸,...
    簡(jiǎn)書(shū)_紅豆閱讀 1,518評(píng)論 8 37

友情鏈接更多精彩內(nèi)容