fix: fix push setting page (#68)
* fix: unknown channel on message page * feat: add get all chanels short api * style: temporaryly change label color * fix: update query for new api * fix: fix PushSetting page * fix: fix PushSetting page --------- Co-authored-by: JustSong <quanpengsong@gmail.com>
This commit is contained in:
@@ -11,6 +11,10 @@ import (
|
||||
)
|
||||
|
||||
func GetAllChannels(c *gin.Context) {
|
||||
if c.Query("brief") != "" {
|
||||
GetBriefChannels(c)
|
||||
return
|
||||
}
|
||||
userId := c.GetInt("id")
|
||||
p, _ := strconv.Atoi(c.Query("p"))
|
||||
if p < 0 {
|
||||
@@ -32,6 +36,24 @@ func GetAllChannels(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
func GetBriefChannels(c *gin.Context) {
|
||||
userId := c.GetInt("id")
|
||||
channels, err := model.GetBriefChannelsByUserId(userId)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": false,
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": true,
|
||||
"message": "",
|
||||
"data": channels,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func SearchChannels(c *gin.Context) {
|
||||
userId := c.GetInt("id")
|
||||
keyword := c.Query("keyword")
|
||||
|
||||
Reference in New Issue
Block a user