init
This commit is contained in:
25
network/http/handlers/channel.go
Normal file
25
network/http/handlers/channel.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"go_oxspeak_server/models"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ChannelHandler struct {
|
||||
*Handler
|
||||
}
|
||||
|
||||
func AddChannelRoutes(rg *gin.RouterGroup, h *Handler) {
|
||||
channel := rg.Group("/channel")
|
||||
|
||||
handler := &ChannelHandler{h}
|
||||
channel.GET("/:id", handler.getChannels)
|
||||
|
||||
}
|
||||
|
||||
func (h *Handler) getChannels(c *gin.Context) {
|
||||
var users []models.User
|
||||
h.DB.Find(&users)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user