- 移动本地接口定义到 interfaces.go 和 admin/interfaces.go - favorite_controller.go → favorite_item_controller.go - space_controller.go → space_loaders.go - settings_controller.go → settings_api_audit.go - admin_energy_controller.go → admin_energy_api_controller.go - admin_post_controller.go → admin_post_action_controller.go - comment_repo.go → comment_mention_repo.go - post_repo.go → post_stats_repo.go
29 lines
584 B
Go
29 lines
584 B
Go
package controller
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"metazone.cc/metalab/internal/common"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// AuditStatus 查询当前用户的待审核类型(需登录)
|
|
func (sc *SettingsController) AuditStatus(c *gin.Context) {
|
|
uid, exists := c.Get("uid")
|
|
if !exists {
|
|
common.Error(c, http.StatusUnauthorized, "请先登录")
|
|
return
|
|
}
|
|
|
|
types, err := sc.auditService.GetPendingTypes(uid.(uint))
|
|
if err != nil {
|
|
common.Ok(c, gin.H{"pending_types": []string{}})
|
|
return
|
|
}
|
|
if types == nil {
|
|
types = []string{}
|
|
}
|
|
common.Ok(c, gin.H{"pending_types": types})
|
|
}
|