Add APIs for message broadcast (#9031)

* 🎨 Add API for broadcast

* 🎨 Add API `/api/broadcast/getListenerCount`

* 🎨 Add API GET `/api/broadcast/channels`

* 🎨 Add API POST `/api/broadcast/getChannelInfo`

* Update broadcast.go

* Update broadcast.go
This commit is contained in:
Yingyi / 颖逸 2023-08-23 17:31:59 +08:00 committed by GitHub
parent f1e875698a
commit 2f75010785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 231 additions and 0 deletions

View file

@ -372,4 +372,9 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/petal/setPetalEnabled", model.CheckAuth, model.CheckReadonly, setPetalEnabled)
ginServer.Handle("POST", "/api/network/forwardProxy", model.CheckAuth, model.CheckReadonly, forwardProxy)
ginServer.Handle("GET", "/ws/broadcast", model.CheckAuth, broadcast)
ginServer.Handle("GET", "/api/broadcast/channels", model.CheckAuth, getChannels)
ginServer.Handle("POST", "/api/broadcast/postMessage", model.CheckAuth, postMessage)
ginServer.Handle("POST", "/api/broadcast/getChannelInfo", model.CheckAuth, getChannelInfo)
}