mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-11 01:22:48 +00:00
play sounds from web ui - store uploaded sounds in database
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mgerb/go-discord-bot/server/config"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const discordAPI = "https://discordapp.com/api/v6"
|
||||
@@ -64,3 +66,43 @@ func Oauth(code string) (OauthResp, error) {
|
||||
|
||||
return oauth, nil
|
||||
}
|
||||
|
||||
// GetUserInfo - get user info
|
||||
func GetUserInfo(accessToken string) (model.User, error) {
|
||||
req, err := http.NewRequest("GET", discordAPI+"/users/@me", nil)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return model.User{}, err
|
||||
}
|
||||
|
||||
req.Header.Add("Authorization", "Bearer "+accessToken)
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return model.User{}, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return model.User{}, err
|
||||
}
|
||||
|
||||
var userInfo model.User
|
||||
|
||||
err = json.Unmarshal(data, &userInfo)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return model.User{}, err
|
||||
}
|
||||
|
||||
// filter guild based on id
|
||||
return userInfo, nil
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package discord
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// User -
|
||||
type User struct {
|
||||
Username string `json:"username"`
|
||||
Verified bool `json:"verified"`
|
||||
MFAEnabled bool `json:"mfa_enabled"`
|
||||
ID string `json:"id"`
|
||||
Avatar string `json:"avatar"`
|
||||
Discriminator string `json:"discriminator"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
// GetUserInfo - get user info
|
||||
func GetUserInfo(accessToken string) (User, error) {
|
||||
req, err := http.NewRequest("GET", discordAPI+"/users/@me", nil)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return User{}, err
|
||||
}
|
||||
|
||||
req.Header.Add("Authorization", "Bearer "+accessToken)
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return User{}, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return User{}, err
|
||||
}
|
||||
|
||||
var userInfo User
|
||||
|
||||
err = json.Unmarshal(data, &userInfo)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return User{}, err
|
||||
}
|
||||
|
||||
// filter guild based on id
|
||||
return userInfo, nil
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mgerb/go-discord-bot/server/config"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/discord"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/dgrijalva/jwt-go.v3"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ type CustomClaims struct {
|
||||
}
|
||||
|
||||
// GetJWT - get json web token
|
||||
func GetJWT(user discord.User) (string, error) {
|
||||
func GetJWT(user model.User) (string, error) {
|
||||
|
||||
permissions := PermUser
|
||||
|
||||
|
||||
12
server/webserver/model/attachment.go
Normal file
12
server/webserver/model/attachment.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package model
|
||||
|
||||
// Attachment - discord message attachment
|
||||
type Attachment struct {
|
||||
MessageID string `gorm:"primary_key" json:"id"`
|
||||
URL string `json:"url"`
|
||||
ProxyURL string `json:"proxy_url"`
|
||||
Filename string `json:"filename"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
9
server/webserver/model/index.go
Normal file
9
server/webserver/model/index.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
var Migrations []interface{} = []interface{}{
|
||||
&Message{},
|
||||
&Attachment{},
|
||||
&User{},
|
||||
&VideoArchive{},
|
||||
&Sound{},
|
||||
}
|
||||
96
server/webserver/model/message.go
Normal file
96
server/webserver/model/message.go
Normal file
@@ -0,0 +1,96 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
// Message - discord message
|
||||
type Message struct {
|
||||
ID string `gorm:"primary_key" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt *time.Time `json:"deleted_at"`
|
||||
ChannelID string `json:"channel_id"`
|
||||
Content string `json:"content"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
EditedTimestamp time.Time `json:"edited_timestamp"`
|
||||
MentionRoles string `json:"mention_roles"`
|
||||
Tts bool `json:"tts"`
|
||||
MentionEveryone bool `json:"mention_everyone"`
|
||||
User User `json:"user"`
|
||||
UserID string `json:"user_id"`
|
||||
Attachments []Attachment `json:"attachments"`
|
||||
}
|
||||
|
||||
// MessageSave -
|
||||
func MessageSave(conn *gorm.DB, m *Message) error {
|
||||
return conn.Save(m).Error
|
||||
}
|
||||
|
||||
const urlRegexp = `https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)`
|
||||
|
||||
var linkedPostsCacheTimeout time.Time
|
||||
var linkedPostsCache map[string]int
|
||||
|
||||
// MessageGet - returns all messages - must use paging
|
||||
func MessageGet(conn *gorm.DB, page int) ([]Message, error) {
|
||||
messages := []Message{}
|
||||
err := conn.Offset(page*100).Limit(100).Order("timestamp desc", true).Preload("User").Find(&messages).Error
|
||||
return messages, err
|
||||
}
|
||||
|
||||
// MessageGetLinked - get count of discord comments that contain URL's - per user
|
||||
// cached for 10 minutes because there is a lot of data filtering
|
||||
func MessageGetLinked(conn *gorm.DB) (map[string]int, error) {
|
||||
|
||||
if linkedPostsCacheTimeout.After(time.Now().Add(-10 * time.Minute)) {
|
||||
return linkedPostsCache, nil
|
||||
}
|
||||
|
||||
result := []map[string]interface{}{}
|
||||
rows, err := conn.Table("messages").
|
||||
Select("users.username, messages.content").
|
||||
Joins("join users on messages.user_id = users.id").
|
||||
Rows()
|
||||
|
||||
if err != nil {
|
||||
return map[string]int{}, err
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
var username, content string
|
||||
rows.Scan(&username, &content)
|
||||
result = append(result, map[string]interface{}{
|
||||
"username": username,
|
||||
"content": content,
|
||||
})
|
||||
}
|
||||
|
||||
linkedPostsCacheTimeout = time.Now()
|
||||
linkedPostsCache = groupPosts(result)
|
||||
|
||||
return linkedPostsCache, nil
|
||||
}
|
||||
|
||||
// group posts by user and count
|
||||
func groupPosts(posts []map[string]interface{}) map[string]int {
|
||||
|
||||
result := map[string]int{}
|
||||
|
||||
for _, p := range posts {
|
||||
match, _ := regexp.MatchString(urlRegexp, p["content"].(string))
|
||||
|
||||
if match {
|
||||
if _, ok := result[p["username"].(string)]; ok {
|
||||
result[p["username"].(string)]++
|
||||
} else {
|
||||
result[p["username"].(string)] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
28
server/webserver/model/sound.go
Normal file
28
server/webserver/model/sound.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
type Sound struct {
|
||||
ID uint `gorm:"primary_key" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt *time.Time `json:"deleted_at"`
|
||||
Name string `gorm:"unique" json:"name"`
|
||||
Extension string `json:"extension"`
|
||||
UserID string `json:"user_id"`
|
||||
User User `json:"user"`
|
||||
}
|
||||
|
||||
func SoundCreate(conn *gorm.DB, sound *Sound) error {
|
||||
return conn.Create(sound).Error
|
||||
}
|
||||
|
||||
func SoundList(conn *gorm.DB) ([]Sound, error) {
|
||||
sound := []Sound{}
|
||||
err := conn.Set("gorm:auto_preload", true).Find(&sound).Error
|
||||
return sound, err
|
||||
}
|
||||
28
server/webserver/model/user.go
Normal file
28
server/webserver/model/user.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
// User -
|
||||
type User struct {
|
||||
ID string `gorm:"primary_key" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt *time.Time `json:"deleted_at"`
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
Discriminator string `json:"discriminator"`
|
||||
Token string `gorm:"-" json:"token"`
|
||||
Verified bool `json:"verified"`
|
||||
MFAEnabled bool `json:"mfa_enabled"`
|
||||
Bot bool `json:"bot"`
|
||||
}
|
||||
|
||||
// UserSave -
|
||||
func UserSave(conn *gorm.DB, u *User) error {
|
||||
return conn.Save(u).Error
|
||||
}
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
|
||||
// AddConfigRoutes -
|
||||
func AddConfigRoutes(group *gin.RouterGroup) {
|
||||
group.GET("/config/client_id", getClientIDHandler)
|
||||
group.GET("/config/client_id", getConfigHandler)
|
||||
}
|
||||
|
||||
func getClientIDHandler(c *gin.Context) {
|
||||
func getConfigHandler(c *gin.Context) {
|
||||
c.JSON(200, map[string]string{"id": config.Config.ClientID})
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ import (
|
||||
|
||||
// AddDownloaderRoutes -
|
||||
func AddDownloaderRoutes(group *gin.RouterGroup) {
|
||||
group.GET("/ytdownloader", downloaderHandler)
|
||||
group.GET("/ytdownloader", getDownloaderHandler)
|
||||
}
|
||||
|
||||
func downloaderHandler(c *gin.Context) {
|
||||
func getDownloaderHandler(c *gin.Context) {
|
||||
url := c.Query("url")
|
||||
fileType := c.Query("fileType")
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mgerb/go-discord-bot/server/logger"
|
||||
"github.com/mgerb/go-discord-bot/server/db"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/model"
|
||||
)
|
||||
|
||||
// AddLoggerRoutes -
|
||||
@@ -20,7 +21,7 @@ func getMessagesHandler(c *gin.Context) {
|
||||
page = 0
|
||||
}
|
||||
|
||||
messages, err := logger.GetMessages(page)
|
||||
messages, err := model.MessageGet(db.GetConn(), page)
|
||||
|
||||
if err != nil {
|
||||
c.JSON(500, err)
|
||||
@@ -31,7 +32,7 @@ func getMessagesHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
func getLinkedMessagesHandler(c *gin.Context) {
|
||||
posts, err := logger.GetLinkedMessages()
|
||||
posts, err := model.MessageGetLinked(db.GetConn())
|
||||
|
||||
if err != nil {
|
||||
c.JSON(500, err.Error())
|
||||
|
||||
@@ -2,8 +2,10 @@ package routes
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mgerb/go-discord-bot/server/db"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/discord"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -57,5 +59,12 @@ func oauthHandler(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// save/update user in database
|
||||
err = model.UserSave(db.GetConn(), &user)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
c.JSON(200, token)
|
||||
}
|
||||
|
||||
110
server/webserver/routes/sound.go
Normal file
110
server/webserver/routes/sound.go
Normal file
@@ -0,0 +1,110 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mgerb/go-discord-bot/server/bothandlers"
|
||||
"github.com/mgerb/go-discord-bot/server/config"
|
||||
"github.com/mgerb/go-discord-bot/server/db"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/model"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/response"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// AddSoundRoutes -
|
||||
func AddSoundRoutes(group *gin.RouterGroup) {
|
||||
group.GET("/sound", listSoundHandler)
|
||||
group.POST("/sound", middleware.AuthorizedJWT(), postSoundHandler)
|
||||
group.POST("/sound/play", middleware.AuthorizedJWT(), middleware.AuthPermissions(middleware.PermMod), postSoundPlayHandler)
|
||||
}
|
||||
|
||||
func listSoundHandler(c *gin.Context) {
|
||||
archives, err := model.SoundList(db.GetConn())
|
||||
|
||||
if err != nil {
|
||||
response.InternalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
response.Success(c, archives)
|
||||
}
|
||||
|
||||
func postSoundPlayHandler(c *gin.Context) {
|
||||
connections := bothandlers.ActiveConnections
|
||||
|
||||
params := struct {
|
||||
Name string `json:"name"`
|
||||
}{}
|
||||
c.BindJSON(¶ms)
|
||||
|
||||
// loop through all connections and play audio
|
||||
// currently only used with one server
|
||||
// will need selector on UI if used for multiple servers
|
||||
if len(connections) == 1 && params.Name != "" {
|
||||
for _, con := range connections {
|
||||
con.PlayAudio(params.Name, nil)
|
||||
}
|
||||
}
|
||||
|
||||
response.Success(c, "test")
|
||||
}
|
||||
|
||||
func postSoundHandler(c *gin.Context) {
|
||||
|
||||
oc, _ := c.Get("claims")
|
||||
claims, _ := oc.(*middleware.CustomClaims)
|
||||
|
||||
// TODO: verify user for upload
|
||||
|
||||
file, err := c.FormFile("file")
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
c.JSON(http.StatusInternalServerError, "Error reading file.")
|
||||
return
|
||||
}
|
||||
|
||||
// create uploads folder if it does not exist
|
||||
if _, err := os.Stat(config.Config.SoundsPath); os.IsNotExist(err) {
|
||||
os.Mkdir(config.Config.SoundsPath, os.ModePerm)
|
||||
}
|
||||
|
||||
// convert file name to lower case and trim spaces
|
||||
file.Filename = strings.Replace(strings.ToLower(file.Filename), " ", "", -1)
|
||||
|
||||
// check if file already exists
|
||||
if _, err := os.Stat(config.Config.SoundsPath + "/" + file.Filename); err == nil {
|
||||
c.JSON(http.StatusInternalServerError, "File already exists.")
|
||||
return
|
||||
}
|
||||
|
||||
err = c.SaveUploadedFile(file, config.Config.SoundsPath+"/"+file.Filename)
|
||||
log.Info(claims.Username, "uploaded", config.Config.SoundsPath+"/"+file.Filename)
|
||||
|
||||
// save who uploaded the clip into the database
|
||||
uploadSaveDB(claims.ID, file.Filename)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
c.JSON(http.StatusInternalServerError, "Error creating file.")
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, "Success")
|
||||
}
|
||||
|
||||
// save new sound to database
|
||||
func uploadSaveDB(userID, filename string) {
|
||||
splitFilename := strings.Split(filename, ".")
|
||||
extension := splitFilename[len(splitFilename)-1]
|
||||
name := strings.Join(splitFilename[:len(splitFilename)-1], ".")
|
||||
|
||||
model.SoundCreate(db.GetConn(), &model.Sound{
|
||||
UserID: userID,
|
||||
Name: name,
|
||||
Extension: extension,
|
||||
})
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mgerb/go-discord-bot/server/config"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// AddUploadRoutes - add file upload routes
|
||||
func AddUploadRoutes(group *gin.RouterGroup) {
|
||||
group.POST("/upload", middleware.AuthorizedJWT(), fileUploadHandler)
|
||||
}
|
||||
|
||||
func fileUploadHandler(c *gin.Context) {
|
||||
|
||||
// originalClaims, _ := c.Get("claims")
|
||||
// claims, _ := originalClaims.(*middleware.CustomClaims)
|
||||
// TODO: verify user for upload
|
||||
|
||||
file, err := c.FormFile("file")
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
c.JSON(http.StatusInternalServerError, "Error reading file.")
|
||||
return
|
||||
}
|
||||
|
||||
// create uploads folder if it does not exist
|
||||
if _, err := os.Stat(config.Config.SoundsPath); os.IsNotExist(err) {
|
||||
os.Mkdir(config.Config.SoundsPath, os.ModePerm)
|
||||
}
|
||||
|
||||
// convert file name to lower case and trim spaces
|
||||
file.Filename = strings.ToLower(file.Filename)
|
||||
file.Filename = strings.Replace(file.Filename, " ", "", -1)
|
||||
|
||||
// check if file already exists
|
||||
if _, err := os.Stat(config.Config.SoundsPath + "/" + file.Filename); err == nil {
|
||||
c.JSON(http.StatusInternalServerError, "File already exists.")
|
||||
return
|
||||
}
|
||||
|
||||
err = c.SaveUploadedFile(file, config.Config.SoundsPath+"/"+file.Filename)
|
||||
log.Debug("Saving file", config.Config.SoundsPath+"/"+file.Filename)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
c.JSON(http.StatusInternalServerError, "Error creating file.")
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, "Success")
|
||||
}
|
||||
@@ -14,14 +14,14 @@ import (
|
||||
|
||||
// AddVideoArchiveRoutes -
|
||||
func AddVideoArchiveRoutes(group *gin.RouterGroup) {
|
||||
group.GET("/video-archive", listVideoArchivesHandler)
|
||||
group.GET("/video-archive", listVideoArchiveHandler)
|
||||
|
||||
authGroup := group.Group("", middleware.AuthorizedJWT())
|
||||
authGroup.POST("/video-archive", middleware.AuthPermissions(middleware.PermMod), postVideoArchivesHandler)
|
||||
authGroup.DELETE("/video-archive/:id", middleware.AuthPermissions(middleware.PermAdmin), deleteVideoArchivesHandler)
|
||||
authGroup.POST("/video-archive", middleware.AuthPermissions(middleware.PermMod), postVideoArchiveHandler)
|
||||
authGroup.DELETE("/video-archive/:id", middleware.AuthPermissions(middleware.PermAdmin), deleteVideoArchiveHandler)
|
||||
}
|
||||
|
||||
func listVideoArchivesHandler(c *gin.Context) {
|
||||
func listVideoArchiveHandler(c *gin.Context) {
|
||||
archives, err := model.VideoArchiveList(db.GetConn())
|
||||
|
||||
if err != nil {
|
||||
@@ -32,7 +32,7 @@ func listVideoArchivesHandler(c *gin.Context) {
|
||||
response.Success(c, archives)
|
||||
}
|
||||
|
||||
func deleteVideoArchivesHandler(c *gin.Context) {
|
||||
func deleteVideoArchiveHandler(c *gin.Context) {
|
||||
id := c.Param("id")
|
||||
|
||||
if id == "" {
|
||||
@@ -50,7 +50,7 @@ func deleteVideoArchivesHandler(c *gin.Context) {
|
||||
response.Success(c, "deleted")
|
||||
}
|
||||
|
||||
func postVideoArchivesHandler(c *gin.Context) {
|
||||
func postVideoArchiveHandler(c *gin.Context) {
|
||||
params := struct {
|
||||
URL string `json:"url"`
|
||||
}{}
|
||||
|
||||
@@ -29,7 +29,7 @@ func getRouter() *gin.Engine {
|
||||
routes.AddLoggerRoutes(api)
|
||||
routes.AddDownloaderRoutes(api)
|
||||
routes.AddConfigRoutes(api)
|
||||
routes.AddUploadRoutes(api)
|
||||
routes.AddSoundRoutes(api)
|
||||
routes.AddVideoArchiveRoutes(api)
|
||||
|
||||
router.NoRoute(func(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user