feat(listing): 极品专区改为无门槛可见
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"hfb_sys/backend/internal/middleware"
|
||||
filemodule "hfb_sys/backend/internal/modules/file"
|
||||
"hfb_sys/backend/internal/sitecode"
|
||||
"hfb_sys/backend/pkg/response"
|
||||
@@ -14,7 +13,6 @@ import (
|
||||
|
||||
func (h *Handler) ListPublic(c *gin.Context) {
|
||||
query := parsePublicListQuery(c)
|
||||
query.ViewerUserID = optionalCurrentUserID(c)
|
||||
items, err := h.service.ListPublic(c.Request.Context(), query)
|
||||
if err != nil {
|
||||
writeListingError(c, err)
|
||||
@@ -29,7 +27,7 @@ func (h *Handler) FindPublic(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
siteCode := sitecode.FromRequest(c)
|
||||
item, err := h.service.FindPublic(c.Request.Context(), id, siteCode, optionalCurrentUserID(c))
|
||||
item, err := h.service.FindPublic(c.Request.Context(), id, siteCode)
|
||||
if err != nil {
|
||||
writeListingError(c, err)
|
||||
return
|
||||
@@ -37,15 +35,6 @@ func (h *Handler) FindPublic(c *gin.Context) {
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
func optionalCurrentUserID(c *gin.Context) uint64 {
|
||||
value, ok := c.Get(middleware.ContextUserID)
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
userID, _ := value.(uint64)
|
||||
return userID
|
||||
}
|
||||
|
||||
func (h *Handler) Cover(c *gin.Context) {
|
||||
id, ok := parseID(c)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user