Files
web_hgcg_server/web/api/web_seopush/seopush.go
T
rootandClaude Opus 4.7 f8ae5e13dd 代码优化
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-10-27 17:11:58 +08:00

34 lines
995 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package web_seopush
import (
"strconv"
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"videoweb/web/service/srv_seopush"
"github.com/gin-gonic/gin"
)
// @Tags SEO推送
// @Summary IndexNow 批量提交(主页 + 专题)
// @Description 组装主页和前 N 个专题(按 Rank 降序)地址,提交到 IndexNow(Bing / Yandex 等)。
// @Produce json
// @Param limit query int false "URL 总数,含主页,默认 10"
// @Param host query string false "覆盖 sys_cfg.webAddr 的目标域名(支持带或不带 scheme)"
// @Success 200 {object} srv_seopush.BulkIndexNowResult
// @Router /api/web/seopush/indexnow/bulk [POST]
func SubmitHomeAndThemes(ctx *gin.Context) {
limit, _ := strconv.Atoi(ctx.Query("limit"))
if limit <= 0 {
limit = 10
}
host := ctx.Query("host")
resp, serr := srv_seopush.SubmitHomeAndThemes(ctx, limit, host)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Msg)
return
}
common.ServerJSON(ctx, srvdef.Success, resp)
}