Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+83
View File
@@ -0,0 +1,83 @@
package laosijictrl
import (
"91porn-server/common"
"91porn-server/common/laosiji"
"91porn-server/common/stderr"
"91porn-server/web/service/laosijiser"
"github.com/gin-gonic/gin"
)
// @Tags 老司机
// @Summary 查询漫画列表
// @Description 查询漫画列表
// @Accept json
// @Produce json
// @Param param body laosiji.ComicsSearchListReq true "参数列表"
// @Success 200 {object} laosiji.ComicsSearchListResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/comics/search [POST]
func ComicsSearch(ctx *gin.Context) {
param := laosiji.ComicsSearchListReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.ComicsSearch(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 查询漫画详情
// @Description 查询漫画详情
// @Accept json
// @Produce json
// @Param param body laosiji.ComicsDetailReq true "参数列表"
// @Success 200 {object} laosiji.ComicsDetailResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/comics/detail [POST]
func ComicsDetail(ctx *gin.Context) {
param := laosiji.ComicsDetailReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.ComicsDetail(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrInterServerError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 添加漫画到本地
// @Description 添加漫画到本地
// @Accept json
// @Produce json
// @Param param body laosiji.ComicsSyncReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/comics/add [POST]
func ComicsAdd(ctx *gin.Context) {
manager, err := common.GetAdminAct(ctx)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
param := laosiji.ComicsSyncReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
hits, err := laosijiser.ComicsAddList(ctx, param, manager)
if err != nil {
common.ServeJSON(ctx, stderr.ErrInterServerError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, buildAddResp(hits))
}
+97
View File
@@ -0,0 +1,97 @@
package laosijictrl
import (
"91porn-server/common"
"91porn-server/common/laosiji"
"91porn-server/common/stderr"
"91porn-server/web/service/laosijiser"
"91porn-server/web/service/vidser"
"github.com/gin-gonic/gin"
)
// @Tags 老司机
// @Summary 查询影片列表
// @Description 查询影片列表
// @Accept json
// @Produce json
// @Param param body laosiji.MovieSearchReq true "参数列表"
// @Success 200 {object} laosiji.MovieSearchResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/movie/search [POST]
func MovieSearch(ctx *gin.Context) {
param := laosiji.MovieSearchReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.MovieSearch(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 查询影片详情
// @Description 查询影片详情
// @Accept json
// @Produce json
// @Param param body laosiji.MovieDetailReq true "参数列表"
// @Success 200 {object} laosiji.MovieDetailResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/movie/detail [POST]
func MovieDetail(ctx *gin.Context) {
param := laosiji.MovieDetailReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.MovieDetail(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 添加影片到本地
// @Description 添加影片到本地
// @Accept json
// @Produce json
// @Param param body laosiji.MovieAddListReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/movie/add [POST]
func MovieAdd(ctx *gin.Context) {
param := laosiji.MovieAddListReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
manager, err := common.GetAdminAct(ctx)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
hits, err := laosijiser.MovieAddList(ctx, param, manager)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, buildAddResp(hits))
}
// buildAddResp 老司机 *Add 接口统一应答结构:data 中带 sensitiveHits 与提示文案
// hits 为空时也返回,便于前端固定字段读取
func buildAddResp(hits []vidser.SensitiveHit) gin.H {
resp := gin.H{
"sensitiveHits": hits,
}
if len(hits) > 0 {
resp["sensitiveTip"] = vidser.SensitiveForcedOfflineTip
}
return resp
}
+83
View File
@@ -0,0 +1,83 @@
package laosijictrl
import (
"91porn-server/common"
"91porn-server/common/laosiji"
"91porn-server/common/stderr"
"91porn-server/web/service/laosijiser"
"github.com/gin-gonic/gin"
)
// @Tags 老司机
// @Summary 查询小说列表
// @Description 查询小说列表
// @Accept json
// @Produce json
// @Param param body laosiji.NovelSearchListReq true "参数列表"
// @Success 200 {object} laosiji.NovelSearchListResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/novel/search [POST]
func NovelSearch(ctx *gin.Context) {
param := laosiji.NovelSearchListReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.NovelSearch(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 查询小说详情
// @Description 查询小说详情
// @Accept json
// @Produce json
// @Param param body laosiji.NovelDetailReq true "参数列表"
// @Success 200 {object} laosiji.NovelDetailResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/novel/detail [POST]
func NovelDetail(ctx *gin.Context) {
param := laosiji.NovelDetailReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.NovelDetail(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 添加小说到本地
// @Description 添加小说到本地
// @Accept json
// @Produce json
// @Param param body laosiji.NovelAddListReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/novel/add [POST]
func NovelAdd(ctx *gin.Context) {
param := laosiji.NovelAddListReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
manager, err := common.GetAdminAct(ctx)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
err = laosijiser.NovelAddList(ctx, param, manager)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, nil)
}
+83
View File
@@ -0,0 +1,83 @@
package laosijictrl
import (
"91porn-server/common"
"91porn-server/common/laosiji"
"91porn-server/common/stderr"
"91porn-server/web/service/laosijiser"
"github.com/gin-gonic/gin"
)
// @Tags 老司机
// @Summary 查询帖子列表
// @Description 查询帖子列表
// @Accept json
// @Produce json
// @Param param body laosiji.PostSearchListReq true "参数列表"
// @Success 200 {object} laosiji.PostSearchListResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/post/search [POST]
func PostSearch(ctx *gin.Context) {
param := laosiji.PostSearchListReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.PostSearch(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrInterServerError, "")
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 查询帖子详情
// @Description 查询帖子详情
// @Accept json
// @Produce json
// @Param param body laosiji.PostDetailReq true "参数列表"
// @Success 200 {object} laosiji.PostDetailResp "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/post/detail [POST]
func PostDetail(ctx *gin.Context) {
param := laosiji.PostDetailReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
resp, err := laosijiser.PostDetail(ctx, param)
if err != nil {
common.ServeJSON(ctx, stderr.ErrInterServerError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}
// @Tags 老司机
// @Summary 添加帖子到本地
// @Description 添加帖子到本地
// @Accept json
// @Produce json
// @Param param body laosiji.PostAddListReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Router /api/web/admin/laosiji/post/add [POST]
func PostAdd(ctx *gin.Context) {
param := laosiji.PostAddListReq{}
if err := ctx.ShouldBind(&param); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
manager, err := common.GetAdminAct(ctx)
if err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
hits, err := laosijiser.PostAddList(ctx, param, manager)
if err != nil {
common.ServeJSON(ctx, stderr.ErrInterServerError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, buildAddResp(hits))
}