@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/active2023ctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 2023春节抽奖活动
|
||||
func active2023Router(router *gin.RouterGroup) {
|
||||
group := router.Group("/active2023")
|
||||
{
|
||||
group.GET("/user_info", active2023ctrl.UserInfo) // 获取抽奖用户信息
|
||||
group.POST("/lottery", active2023ctrl.Lottery) // 抽奖
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/activityctrl"
|
||||
"91porn-server/app/middleware/activityauth"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// activityCallbackRouter 活动服回调路由(独立鉴权,不走主auth)
|
||||
func activityCallbackRouter(router *gin.Engine) {
|
||||
group := router.Group("/activity", activityauth.HmacAuth)
|
||||
{
|
||||
group.POST("/currency/list", activityctrl.CurrencyList)
|
||||
group.POST("/vip/list", activityctrl.ProductList)
|
||||
group.POST("/recharge/order", activityctrl.RechargeOrder)
|
||||
group.POST("/coin/buy", activityctrl.BuyCoinProduct)
|
||||
group.POST("/user/balance", activityctrl.UserBalance)
|
||||
group.POST("/app/info", activityctrl.AppInfo)
|
||||
group.POST("/reward", activityctrl.Reward)
|
||||
group.POST("/reward/batch", activityctrl.BatchReward)
|
||||
group.POST("/deduct", activityctrl.Deduct)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/actvctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 活动专页
|
||||
func actvRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/actv")
|
||||
{
|
||||
group.GET("/list", actvctrl.GetActivities)
|
||||
group.GET("/getById", actvctrl.GetActiveByID)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/adsctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func adsRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ads")
|
||||
{
|
||||
group.POST("/click", adsctrl.AdsClick)
|
||||
group.GET("/list", adsctrl.List)
|
||||
group.POST("/click/stat", adsctrl.AdsClickStat)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/advance_config_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func advanceConfigRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/advance_config")
|
||||
{
|
||||
group.GET("/list", advance_config_ctrl.GetAdvanceConfig)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_changeface_ctrl"
|
||||
"91porn-server/app/api/ai_undress_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func aiChangeFaceRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai/changeface")
|
||||
{
|
||||
group.GET("/list", ai_changeface_ctrl.List) // ai换脸订单列表
|
||||
group.POST("/generate", ai_changeface_ctrl.Generate)
|
||||
group.POST("/hide", ai_changeface_ctrl.Hide)
|
||||
}
|
||||
|
||||
imgGroup := router.Group("/ai/img")
|
||||
{
|
||||
imgGroup.GET("/list", ai_undress_ctrl.AiImgList)
|
||||
imgGroup.POST("/generate", ai_undress_ctrl.AiImgGenerate)
|
||||
imgGroup.POST("/hide", ai_undress_ctrl.AiChangeFaceImgHide)
|
||||
}
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_image_to_video_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// aiImageToVideo 移动端接口
|
||||
func aiImageToVideoRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai/imagetovideo")
|
||||
{
|
||||
group.GET("/list", ai_image_to_video_ctrl.List)
|
||||
group.POST("/generate", ai_image_to_video_ctrl.Generate)
|
||||
group.POST("/hide", ai_image_to_video_ctrl.Hide)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_mate_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func aiMateRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/aimate")
|
||||
group.GET("/currencys", ai_mate_ctrl.GetCurrencys)
|
||||
group.POST("/exchange", ai_mate_ctrl.Exchange)
|
||||
group.POST("/sync", ai_mate_ctrl.SyncInfo)
|
||||
group.GET("/login", ai_mate_ctrl.Login)
|
||||
group.GET("/getBalance", ai_mate_ctrl.GetBalance)
|
||||
group.GET("/gianBalance", ai_mate_ctrl.GianBalance)
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestAiMateH5CompatibilityRoutes(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
engine := gin.New()
|
||||
aiMateRouter(engine.Group("/api/app"))
|
||||
|
||||
routes := make(map[string]struct{})
|
||||
for _, route := range engine.Routes() {
|
||||
routes[route.Method+" "+route.Path] = struct{}{}
|
||||
}
|
||||
expected := []string{
|
||||
"GET /api/app/aimate/login",
|
||||
"GET /api/app/aimate/getBalance",
|
||||
"GET /api/app/aimate/gianBalance",
|
||||
"GET /api/app/aimate/currencys",
|
||||
"POST /api/app/aimate/exchange",
|
||||
}
|
||||
for _, route := range expected {
|
||||
if _, ok := routes[route]; !ok {
|
||||
t.Errorf("route %q is not registered", route)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAiMateV2Route(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
engine := gin.New()
|
||||
aiMateV2Router(engine.Group("/api/app"))
|
||||
|
||||
for _, route := range engine.Routes() {
|
||||
if route.Method == "POST" && route.Path == "/api/app/aimatev2/url" {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatal("POST /api/app/aimatev2/url is not registered")
|
||||
}
|
||||
|
||||
func TestContentUpdateMarkerRoute(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
engine := gin.New()
|
||||
contentMarkerRouter(engine.Group("/api/app"))
|
||||
|
||||
for _, route := range engine.Routes() {
|
||||
if route.Method == "GET" && route.Path == "/api/app/content/update-markers" {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatal("GET /api/app/content/update-markers is not registered")
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_mate_v2_ctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func aiMateV2Router(router *gin.RouterGroup) {
|
||||
group := router.Group("/aimatev2")
|
||||
group.POST("/url", ai_mate_v2_ctrl.URL)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_changeface_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func aiModRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai/mod")
|
||||
{
|
||||
group.GET("/list", ai_changeface_ctrl.ModList) // ai换脸视频模版列表
|
||||
group.GET("/v2/list", ai_changeface_ctrl.ModListV2) // ai换脸视频模版列表
|
||||
group.GET("/info", ai_changeface_ctrl.ModInfo) // ai模版详情
|
||||
}
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_text_to_image_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// aiTextToImage 移动端接口
|
||||
func aiTextToImageRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai/text_to_image")
|
||||
{
|
||||
group.GET("/list", ai_text_to_image_ctrl.List)
|
||||
group.POST("/generate", ai_text_to_image_ctrl.Generate)
|
||||
group.POST("/hide", ai_text_to_image_ctrl.Hide)
|
||||
}
|
||||
}
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_text_to_novel_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// aiTextToNovel 移动端接口
|
||||
func aiTextToNovelRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai_text_to_novel")
|
||||
{
|
||||
group.GET("/list", ai_text_to_novel_ctrl.List)
|
||||
group.POST("/generate", ai_text_to_novel_ctrl.Generate)
|
||||
group.POST("/hide", ai_text_to_novel_ctrl.Hide)
|
||||
group.GET("/info", ai_text_to_novel_ctrl.Info)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/ai_undress_ctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func aiUndressRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai/undress")
|
||||
{
|
||||
group.GET("/list", ai_undress_ctrl.List)
|
||||
group.POST("/generate", ai_undress_ctrl.Generate)
|
||||
group.POST("/hide", ai_undress_ctrl.AiUndressHide)
|
||||
}
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/aiplazactrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// aiPlaza 移动端接口
|
||||
func aiPlazaRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/aiplaza")
|
||||
{
|
||||
group.GET("/list", aiplazactrl.List)
|
||||
group.GET("/info", aiplazactrl.Info)
|
||||
group.POST("/share", aiplazactrl.Share)
|
||||
}
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/aitemplatemodulectrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// aiTemplateModule 移动端接口
|
||||
func aiTemplateModuleRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ai_template_module")
|
||||
{
|
||||
group.GET("/list", aitemplatemodulectrl.List)
|
||||
group.GET("/info", aitemplatemodulectrl.Info)
|
||||
group.GET("/all", aitemplatemodulectrl.AllList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/analyticsctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func analyticsRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/analytics")
|
||||
{
|
||||
group.POST("/events", analyticsctrl.Events)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestVIPCardAnalyticsRoute(t *testing.T) {
|
||||
engine := gin.New()
|
||||
analyticsRouter(engine.Group("/api/app"))
|
||||
for _, route := range engine.Routes() {
|
||||
if route.Method == "POST" && route.Path == "/api/app/analytics/events" {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatal("POST /api/app/analytics/events is not registered")
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/annouctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func annouRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/annou")
|
||||
{
|
||||
group.GET("/list", annouctrl.GetAnnou)
|
||||
group.GET("/msg/list", annouctrl.GetAnnous)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/backpackctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func backpackRouter(router *gin.RouterGroup) {
|
||||
backpack := router.Group("/backpack")
|
||||
{
|
||||
backpack.GET("", backpackctrl.GetCouponList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/sharectrl"
|
||||
"91porn-server/app/api/updownctrl"
|
||||
"91porn-server/app/appg"
|
||||
"91porn-server/app/middleware/authuser"
|
||||
"91porn-server/app/middleware/datacenter"
|
||||
"91porn-server/app/middleware/ip"
|
||||
"91porn-server/app/middleware/requestEncrypt"
|
||||
"91porn-server/app/middleware/verfyparam"
|
||||
"91porn-server/app/middleware/visitlog"
|
||||
"91porn-server/common"
|
||||
"91porn-server/common/constant"
|
||||
"91porn-server/common/stderr"
|
||||
"91porn-server/common/tg"
|
||||
"91porn-server/middleware/cors"
|
||||
"91porn-server/middleware/ginzap"
|
||||
"91porn-server/middleware/requestid"
|
||||
"91porn-server/middleware/ua"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"runtime/debug"
|
||||
"time"
|
||||
|
||||
"github.com/didip/tollbooth"
|
||||
"github.com/didip/tollbooth/limiter"
|
||||
"github.com/gin-contrib/pprof"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var Lmt, RechargeLmt, GlobalLmt *limiter.Limiter
|
||||
|
||||
// SetupGin 初始化gin router
|
||||
func SetupGin() *gin.Engine {
|
||||
if appg.Conf.Base.Env == constant.ProdEnv {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
} else {
|
||||
gin.SetMode(gin.DebugMode)
|
||||
}
|
||||
router := gin.New()
|
||||
router.ForwardedByClientIP = true
|
||||
if appg.Conf.Base.PProf {
|
||||
pprof.Register(router) // 性能分析工具
|
||||
}
|
||||
router.Use(
|
||||
ginzap.Logger([]string{constant.CtxUserID, constant.CtxIP}),
|
||||
ginzap.Recovery(true, func(err interface{}) {
|
||||
var stack string
|
||||
if !stderr.IsContain(err, stderr.WriteBrokenError) {
|
||||
stack = string(debug.Stack())
|
||||
}
|
||||
common.Go(func() {
|
||||
_ = appg.Bot.Send(tg.Msg{ChatId: tg.ChatIdServerTeam, Text: fmt.Sprintf("[App-Server] panic:%+v, stack:%s", err, stack)})
|
||||
})
|
||||
}))
|
||||
router.Use(cors.Cors(&cors.Options{
|
||||
Origin: nil,
|
||||
Methods: []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodHead, http.MethodDelete},
|
||||
AllowedHeaders: []string{"Content-Length", "Content-Type", "Authorization", "X-User-Agent", "User-Agent", "X-Authorization", "X-Request-ID", "temp", "log-type"},
|
||||
ExposedHeaders: []string{"Content-Disposition", "Refresh-Authorization", "Cur-Ver", "X-Request-ID"},
|
||||
OptionsSuccessStatus: http.StatusOK,
|
||||
}))
|
||||
router.Use(ua.UAer, ip.RealIP, requestid.New())
|
||||
router.HandleMethodNotAllowed = true
|
||||
router.NoMethod(func(c *gin.Context) {
|
||||
c.JSON(http.StatusMethodNotAllowed, gin.H{"result": false, "error": "Method Not Allowed"})
|
||||
})
|
||||
router.NoRoute(func(c *gin.Context) {
|
||||
c.JSON(http.StatusNotFound, gin.H{"result": false, "error": "Endpoint Not Found"})
|
||||
})
|
||||
Init()
|
||||
registerRouter(router)
|
||||
return router
|
||||
}
|
||||
|
||||
func registerRouter(router *gin.Engine) {
|
||||
//root Router 根组
|
||||
rootRouter := router.Group("/api/app",
|
||||
verfyparam.CheckReplayAttackRequest(),
|
||||
verfyparam.VerifyReplayAttackRequest(appg.Conf.Base.ReplayAttack),
|
||||
requestEncrypt.ReqDecode,
|
||||
authuser.Auth,
|
||||
visitlog.Log,
|
||||
datacenter.OnlineStat,
|
||||
//ipblock.IPBlock(constant.GlobalBlock),
|
||||
//limitHandler.LimitHandler(GlobalLmt),
|
||||
)
|
||||
{
|
||||
updownloadRouter(rootRouter)
|
||||
walletRouter(rootRouter)
|
||||
shareRouter(rootRouter)
|
||||
vidRouter(rootRouter)
|
||||
recommendRouter(rootRouter)
|
||||
userRouter(rootRouter)
|
||||
tagRouter(rootRouter)
|
||||
searchRouter(rootRouter)
|
||||
mineRouter(rootRouter)
|
||||
notificationRoute(rootRouter)
|
||||
rankRouter(rootRouter)
|
||||
toneRouter(rootRouter)
|
||||
wonderRouter(rootRouter)
|
||||
vipRouter(rootRouter)
|
||||
productRouter(rootRouter)
|
||||
paymentGuideRouter(rootRouter)
|
||||
sceneBannerRouter(rootRouter)
|
||||
analyticsRouter(rootRouter)
|
||||
imdRouter(rootRouter)
|
||||
rchgRouter(rootRouter)
|
||||
versionRouter(rootRouter)
|
||||
pingRouter(rootRouter)
|
||||
withdrawRouter(rootRouter)
|
||||
annouRouter(rootRouter)
|
||||
staticRouter(rootRouter)
|
||||
txnactRouter(rootRouter)
|
||||
adsRouter(rootRouter)
|
||||
infmtRouter(rootRouter)
|
||||
hotspotRouter(rootRouter)
|
||||
exchangeRouter(rootRouter)
|
||||
newActivityRoute(rootRouter)
|
||||
userInviteRouter(rootRouter)
|
||||
taskRouter(rootRouter)
|
||||
backpackRouter(rootRouter)
|
||||
moduleRouter(rootRouter)
|
||||
contentMarkerRouter(rootRouter)
|
||||
smsRoute(rootRouter)
|
||||
publishRouter(rootRouter)
|
||||
videoActivityRouter(rootRouter)
|
||||
aiUndressRouter(rootRouter)
|
||||
thumbsRouter(rootRouter)
|
||||
officialRouter(rootRouter)
|
||||
commentRouter(rootRouter)
|
||||
followRouter(rootRouter)
|
||||
proxyRouter(rootRouter)
|
||||
aiChangeFaceRouter(rootRouter)
|
||||
messageRouter(rootRouter)
|
||||
aiModRouter(rootRouter)
|
||||
videoGoldCoinRouter(rootRouter)
|
||||
recreationRouter(rootRouter)
|
||||
advanceConfigRouter(rootRouter)
|
||||
couponRouter(rootRouter)
|
||||
integralRouter(rootRouter)
|
||||
signRecordRouter(rootRouter)
|
||||
aiMateRouter(rootRouter)
|
||||
aiMateV2Router(rootRouter)
|
||||
storeWalletRouter(rootRouter)
|
||||
mediaRouter(rootRouter)
|
||||
dramaRouter(rootRouter)
|
||||
mediaBookshelfRouter(rootRouter)
|
||||
mediaContentRouter(rootRouter)
|
||||
mediaTagRouter(rootRouter)
|
||||
imGroupRouter(rootRouter)
|
||||
imMessageRouter(rootRouter)
|
||||
nakedChatRouter(rootRouter)
|
||||
nakedChatOrderRouter(rootRouter)
|
||||
aiTextToImageRouter(rootRouter)
|
||||
aiImageToVideoRouter(rootRouter)
|
||||
aiTemplateModuleRouter(rootRouter)
|
||||
aiPlazaRouter(rootRouter)
|
||||
aiTextToNovelRouter(rootRouter)
|
||||
checkinRouter(rootRouter)
|
||||
customerApiRouter(rootRouter)
|
||||
healthCheckRouter(rootRouter)
|
||||
}
|
||||
thirdRouter := router.Group("/3rd")
|
||||
{
|
||||
defrayRouter(thirdRouter)
|
||||
}
|
||||
{
|
||||
shareRouter := router.Group("/share")
|
||||
shareRouter.POST("/info", sharectrl.Info)
|
||||
shareRouter.GET("/m3u8/*source", updownctrl.DownloadM3u8H5)
|
||||
}
|
||||
// 客服系统回调相关
|
||||
customerRouter(router)
|
||||
// 活动服回调相关
|
||||
activityCallbackRouter(router)
|
||||
|
||||
// 品牌站相关接口
|
||||
newOfficialWebsiteRoute(router)
|
||||
}
|
||||
|
||||
func Init() {
|
||||
GlobalLmt = tollbooth.NewLimiter(float64(appg.Conf.Limit.GlobalLimit), &limiter.ExpirableOptions{DefaultExpirationTTL: time.Second})
|
||||
Lmt = tollbooth.NewLimiter(float64(appg.Conf.Limit.CommentLimit), &limiter.ExpirableOptions{DefaultExpirationTTL: time.Second})
|
||||
RechargeLmt = tollbooth.NewLimiter(float64(appg.Conf.Limit.RechargeLimit), &limiter.ExpirableOptions{DefaultExpirationTTL: time.Minute})
|
||||
Lmt.SetIPLookups([]string{"RemoteAddr", "X-Forwarded-For", "X-Real-IP"})
|
||||
Lmt.SetMethods([]string{"GET", "POST"})
|
||||
Lmt.SetMessageContentType("application/json; charset=utf-8")
|
||||
Lmt.SetStatusCode(http.StatusNoContent)
|
||||
GlobalLmt.SetIPLookups([]string{"RemoteAddr", "X-Forwarded-For", "X-Real-IP"})
|
||||
GlobalLmt.SetMethods([]string{"GET", "POST"})
|
||||
GlobalLmt.SetMessageContentType("application/json; charset=utf-8")
|
||||
GlobalLmt.SetStatusCode(http.StatusNoContent)
|
||||
RechargeLmt.SetIPLookups([]string{"RemoteAddr", "X-Forwarded-For", "X-Real-IP"})
|
||||
RechargeLmt.SetMethods([]string{"POST"})
|
||||
RechargeLmt.SetMessageContentType("application/json; charset=utf-8")
|
||||
RechargeLmt.SetStatusCode(http.StatusNoContent)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/checkinctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func checkinRouter(router *gin.RouterGroup) {
|
||||
checkin := router.Group("/checkin")
|
||||
{
|
||||
checkin.POST("/click", checkinctrl.UserCheckin) // 签到
|
||||
checkin.POST("/prize", checkinctrl.GetCheckinPrize) // 获取签到奖品
|
||||
checkin.POST("/claim_vip", checkinctrl.ClaimVipCheckinPrize) // 补领VIP签到奖励
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/commentctrl"
|
||||
"91porn-server/app/middleware/ipblock"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
"91porn-server/common/constant"
|
||||
|
||||
"github.com/didip/tollbooth_gin"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func commentRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/comment")
|
||||
{
|
||||
group.GET("/list", commentctrl.List)
|
||||
group.GET("/info", commentctrl.Info)
|
||||
group.POST("/send", ipblock.IPBlock(constant.BlockComment), limitHandler.FilterByIP(tollbooth_gin.LimitHandler(Lmt)), commentctrl.Send)
|
||||
//非帖子内容评论,目前有愿望工单
|
||||
group.POST("/sendV2", ipblock.IPBlock(constant.BlockComment), limitHandler.FilterByIP(tollbooth_gin.LimitHandler(Lmt)), commentctrl.NoVidSend)
|
||||
group.GET("/reply/list", commentctrl.ReplyList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/contentmarkerctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func contentMarkerRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/content")
|
||||
group.GET("/update-markers", contentmarkerctrl.Get)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/couponctl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func couponRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/coupon")
|
||||
{
|
||||
group.GET("/list", couponctl.List)
|
||||
group.POST("/upload", couponctl.Upload)
|
||||
group.DELETE("", couponctl.Delete)
|
||||
}
|
||||
luckGroup := router.Group("/luckyDraw")
|
||||
{
|
||||
luckGroup.GET("/gain", couponctl.Gain)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/customerCtrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func customerApiRouter(router *gin.RouterGroup) {
|
||||
router.GET("/customer/url", customerCtrl.Url)
|
||||
}
|
||||
|
||||
func customerRouter(router *gin.Engine) {
|
||||
customer := router.Group("/customer")
|
||||
user := customer.Group("/user")
|
||||
{
|
||||
user.GET("/backpack", customerCtrl.Backpack)
|
||||
user.GET("/recharge", customerCtrl.Recharge)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/rechargectrl"
|
||||
"91porn-server/app/api/withdrawctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// defrayRouter 支付回调
|
||||
func defrayRouter(router *gin.RouterGroup) {
|
||||
groupDefray := router.Group("/defray/callback")
|
||||
{
|
||||
//大白鲨充值回调
|
||||
groupDefray.POST("/dabaisha", rechargectrl.DaBaiShaCallBack)
|
||||
groupDefray.POST("/pay_center", rechargectrl.PayCenterCallBack)
|
||||
groupDefray.POST("/refund", rechargectrl.RefundCallBack)
|
||||
//充值回调函数
|
||||
rchg := groupDefray.Group("/rchg")
|
||||
{
|
||||
rchg.POST("/:name", rechargectrl.CallBack)
|
||||
rchg.GET("/:name", rechargectrl.CallBack)
|
||||
}
|
||||
echg := groupDefray.Group("/echg")
|
||||
{
|
||||
echg.POST("/:name", withdrawctrl.YinseCallBack)
|
||||
}
|
||||
//groupDefray.POST("/echg/goldfish", withdrawctrl.GoldFishCallBack)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/dramactrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func dramaRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/media/drama")
|
||||
{
|
||||
group.GET("/channel/config", dramactrl.ChannelConfig)
|
||||
group.GET("/feed", dramactrl.Feed)
|
||||
group.GET("/list", dramactrl.List)
|
||||
group.GET("/topics", dramactrl.Topics)
|
||||
group.GET("/topic/works", dramactrl.TopicWorks)
|
||||
group.POST("/download/authorize", dramactrl.DownloadAuthorize)
|
||||
group.POST("/events", dramactrl.SaveEvents)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestDramaRoutesExcludeServerProgress(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
engine := gin.New()
|
||||
dramaRouter(engine.Group("/api/app"))
|
||||
|
||||
routes := make(map[string]struct{})
|
||||
for _, route := range engine.Routes() {
|
||||
routes[route.Method+" "+route.Path] = struct{}{}
|
||||
}
|
||||
if _, ok := routes["POST /api/app/media/drama/progress"]; ok {
|
||||
t.Fatal("server-side drama progress route must not be registered")
|
||||
}
|
||||
if _, ok := routes["POST /api/app/media/drama/events"]; !ok {
|
||||
t.Fatal("drama analytics route must remain registered")
|
||||
}
|
||||
if _, ok := routes["GET /api/app/media/drama/card/products"]; ok {
|
||||
t.Fatal("standalone drama card product route must not be registered")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/exchcodectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func exchangeRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/code")
|
||||
{
|
||||
group.POST("/exchange", exchcodectrl.CodeExchange)
|
||||
group.POST("/webexchange", exchcodectrl.WebCodeExchange)
|
||||
group.GET("/userRecord", exchcodectrl.UserRecord)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/followctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func followRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/follow")
|
||||
{
|
||||
group.GET("/list", followctrl.GetFollowList)
|
||||
group.GET("/fans/list", followctrl.GetFansList)
|
||||
group.GET("/dynamics/list", followctrl.DynamicsList)
|
||||
group.GET("/list/short", followctrl.GetFollowUpUsersWithShort)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/goldextractrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func goldExtraRouter(router *gin.RouterGroup) {
|
||||
ge := router.Group("/goldExtra")
|
||||
{
|
||||
ge.GET("/userList", goldextractrl.UserGoldExtra)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/health_check_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func healthCheckRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/health")
|
||||
{
|
||||
group.POST("/ping", health_check_ctrl.Ping)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/hotspotctr"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func hotspotRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/hotspot")
|
||||
{
|
||||
group.GET("/htag", hotspotctr.HotTag) //热门话题
|
||||
group.GET("/hotvid/list", hotspotctr.HotVidList) //今日最热视屏
|
||||
group.GET("/rank", hotspotctr.Rank) //排行榜
|
||||
group.GET("/area", hotspotctr.Area) //专区
|
||||
group.GET("/wonder/list", hotspotctr.WonderTagList) //发现精彩
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/imctrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func imdRouter(router *gin.RouterGroup) {
|
||||
im := router.Group("/im")
|
||||
{
|
||||
im.GET("/sign", imctrl.GetImSign)
|
||||
im.GET("/whiteSign", imctrl.GetWhiteImSign)
|
||||
im.GET("/newSign", imctrl.ImSign)
|
||||
im.POST("/token", imctrl.Token)
|
||||
im.POST("/user-id", imctrl.UserID)
|
||||
im.POST("/friend/ensure", imctrl.EnsureFriend)
|
||||
// im skd获取
|
||||
//im.POST("/friend/list", imctrl.FriendList)
|
||||
//im.POST("/message/history", imctrl.MessageHistory)
|
||||
im.POST("/message/send", limitHandler.FilterRequestLimit, imctrl.SendMessage)
|
||||
im.POST("/ad", imctrl.GetIMAd)
|
||||
}
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/imgroupctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// imGroup 移动端接口
|
||||
func imGroupRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/imgroup")
|
||||
{
|
||||
group.GET("/list", imgroupctrl.List)
|
||||
group.GET("/info", imgroupctrl.Info)
|
||||
group.GET("/hasjoin", imgroupctrl.HasJoin)
|
||||
}
|
||||
}
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/imgroupmemberctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// imGroupMember 移动端接口
|
||||
func imGroupMemberRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/imgroupmember")
|
||||
{
|
||||
group.GET("/list", imgroupmemberctrl.List)
|
||||
}
|
||||
}
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/immessagectrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// imMessage 移动端接口 todo: 在 app/router/base.go 中新增路由
|
||||
func imMessageRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/immessage")
|
||||
{
|
||||
group.GET("/list", immessagectrl.List)
|
||||
group.POST("/send", immessagectrl.Send)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/infmtctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func infmtRouter(router *gin.RouterGroup) {
|
||||
inform := router.Group("/inform")
|
||||
{
|
||||
inform.GET("/preview", infmtctrl.Preview)
|
||||
//通知类
|
||||
notice := inform.Group("/notice")
|
||||
{
|
||||
notice.GET("/list", infmtctrl.NoticeList)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/integeralctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func integralRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/integral")
|
||||
{
|
||||
group.GET("/list", integeralctrl.GetList)
|
||||
group.GET("/record/list", integeralctrl.GetRecordList)
|
||||
group.POST("/exchangeIntegral", integeralctrl.ExchangeIntegral)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestIterationAppRoutes(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
engine := gin.New()
|
||||
group := engine.Group("/api/app")
|
||||
vidRouter(group)
|
||||
paymentGuideRouter(group)
|
||||
sceneBannerRouter(group)
|
||||
|
||||
routes := make(map[string]struct{})
|
||||
for _, route := range engine.Routes() {
|
||||
routes[route.Method+" "+route.Path] = struct{}{}
|
||||
}
|
||||
expected := []string{
|
||||
"GET /api/app/vid/module/:subModuleID/refresh",
|
||||
"GET /api/app/payment/guide",
|
||||
"POST /api/app/payment/guide/impression",
|
||||
"GET /api/app/banner/list",
|
||||
}
|
||||
for _, route := range expected {
|
||||
if _, ok := routes[route]; !ok {
|
||||
t.Errorf("route %q is not registered", route)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/likectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func thumbsRouter(router *gin.RouterGroup) {
|
||||
{
|
||||
router.POST("/thumbsUp", likectrl.ThumbsUp)
|
||||
router.POST("/thumbsDown", likectrl.ThumbsDown)
|
||||
router.GET("/like/record/list", likectrl.RecordList)
|
||||
}
|
||||
}
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/mediactrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// mediaRouter 移动端接口
|
||||
func mediaRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/media")
|
||||
{
|
||||
group.GET("/list", mediactrl.List)
|
||||
group.GET("/info", mediactrl.Info)
|
||||
group.GET("/topic", mediactrl.GetTopicList)
|
||||
group.GET("/library", mediactrl.Library)
|
||||
group.POST("/library/search", mediactrl.LibrarySearch)
|
||||
group.GET("/search", mediactrl.Search)
|
||||
// 搜索推荐标签
|
||||
group.GET("/recommend", mediactrl.Recommend)
|
||||
group.GET("/ranking", mediactrl.Ranking)
|
||||
group.GET("/hot", mediactrl.Hot)
|
||||
group.GET("/my_buy", mediactrl.MyBuy)
|
||||
}
|
||||
}
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/mediabookshelfctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// mediaBookshelf 移动端接口
|
||||
func mediaBookshelfRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/media_bookshelf")
|
||||
{
|
||||
group.GET("/list", mediabookshelfctrl.List)
|
||||
group.POST("/add", mediabookshelfctrl.Add)
|
||||
group.POST("/del/batch", mediabookshelfctrl.DelBatch)
|
||||
group.POST("/del", mediabookshelfctrl.Del)
|
||||
}
|
||||
}
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/mediacontentctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// mediaContent 移动端接口
|
||||
func mediaContentRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/media_content")
|
||||
{
|
||||
group.GET("/list", mediacontentctrl.List)
|
||||
group.GET("/info", mediacontentctrl.Info)
|
||||
}
|
||||
}
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/mediatagctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// mediaTag 移动端接口
|
||||
func mediaTagRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/media_tag")
|
||||
{
|
||||
group.GET("/list", mediatagctrl.List)
|
||||
group.GET("/info", mediatagctrl.Info)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/messagectrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func messageRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/msg")
|
||||
{
|
||||
group.GET("/dynamic/noRedNum", messagectrl.NoRedNum)
|
||||
group.GET("/dynamic/list", messagectrl.List)
|
||||
group.GET("/session/list", messagectrl.SessionList)
|
||||
group.POST("/session/del", messagectrl.DelSession)
|
||||
group.GET("/session/get", messagectrl.GetSessionId)
|
||||
group.GET("/message/list", messagectrl.MessageList)
|
||||
group.POST("/priLetter/add", limitHandler.FilterRequestLimit, messagectrl.PrivateLetter)
|
||||
group.POST("/read", messagectrl.Read)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/minectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func mineRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/mine")
|
||||
{
|
||||
group.POST("/report", minectrl.Report)
|
||||
group.GET("/report/types/list", minectrl.ReportTypesList)
|
||||
group.POST("/feedback", minectrl.FeedBack)
|
||||
group.GET("/feedback/list", minectrl.FeedBackList)
|
||||
group.POST("/follow", minectrl.Follow)
|
||||
group.POST("/collect", minectrl.Collect) //用户收藏信息
|
||||
group.POST("/collect/batch/cancel", minectrl.BatchCancelCollect) //批量取消收藏
|
||||
group.GET("/collect/infoList", minectrl.InfoList)
|
||||
group.GET("/userresource/list", minectrl.UserResourceList)
|
||||
group.POST("/download/use", minectrl.UserDownload)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/modulectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func moduleRouter(r *gin.RouterGroup) {
|
||||
module := r.Group("/modules")
|
||||
{
|
||||
module.GET("/list", modulectrl.List)
|
||||
module.GET("/announce", modulectrl.Announcements)
|
||||
}
|
||||
}
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/nakedchatctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// nakedChat 移动端接口
|
||||
func nakedChatRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/nakedchat")
|
||||
{
|
||||
group.GET("/list", nakedchatctrl.List)
|
||||
group.GET("/info", nakedchatctrl.Info)
|
||||
}
|
||||
}
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/nakedchatorderctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// nakedChatOrder 移动端接口
|
||||
func nakedChatOrderRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/nakedchatorder")
|
||||
{
|
||||
group.GET("/list", nakedchatorderctrl.List)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/newactivityctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func newActivityRoute(router *gin.RouterGroup) {
|
||||
g := router.Group("/newactivity")
|
||||
{
|
||||
g.POST("userBanlance", newactivityctrl.UserBalance)
|
||||
g.POST("modelList", newactivityctrl.ModelList)
|
||||
g.POST("findOneModel", newactivityctrl.FindOneModel)
|
||||
g.POST("buyGiftsSchedule", newactivityctrl.BuyGiftsSchedule)
|
||||
g.POST("buyGifts", newactivityctrl.BuyGifts)
|
||||
g.POST("winRecords", newactivityctrl.WinRecords)
|
||||
//问卷调查
|
||||
questionnaire := g.Group("/questionnaire")
|
||||
{
|
||||
questionnaire.POST("/submit", newactivityctrl.Submit)
|
||||
questionnaire.GET("getQuestionnaireByUser", newactivityctrl.GetQuestionnaireByUsers)
|
||||
}
|
||||
}
|
||||
game := router.Group("/game")
|
||||
{
|
||||
game.GET("userInfo", newactivityctrl.UserInfo)
|
||||
game.GET("deduct", newactivityctrl.Deduct2Coins)
|
||||
game.GET("code", newactivityctrl.RecordRewardCode)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/notictrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func notificationRoute(router *gin.RouterGroup) {
|
||||
group := router.Group("/notification")
|
||||
{
|
||||
group.POST("/captcha", limitHandler.FilterSMSCaptchaByIP, limitHandler.FilterSMSCaptchaByUID, notictrl.SendCaptcha)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/officialctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func officialRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/official")
|
||||
{
|
||||
group.GET("/list", officialctrl.List)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/officialWebsitectrl"
|
||||
"91porn-server/app/api/updownctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func newOfficialWebsiteRoute(router *gin.Engine) {
|
||||
g := router.Group("/officialWebsite")
|
||||
g.GET("", officialWebsitectrl.GetBasicData) // 品牌站基础数据接口,包含基础静态数据和CMS动态数据
|
||||
|
||||
hero := g.Group("/hero")
|
||||
{
|
||||
hero.GET("/list", officialWebsitectrl.HeroList)
|
||||
hero.GET("/:id", officialWebsitectrl.HeroDetail)
|
||||
}
|
||||
|
||||
album := g.Group("/album")
|
||||
{
|
||||
album.GET("/list", officialWebsitectrl.AlbumList)
|
||||
album.GET("/:id", officialWebsitectrl.AlbumDetail)
|
||||
}
|
||||
|
||||
video := g.Group("/video")
|
||||
{
|
||||
video.GET("/list", officialWebsitectrl.VideoList)
|
||||
video.GET("/:id", officialWebsitectrl.VideoDetail)
|
||||
video.GET("/:id/m3u8/*source", officialWebsitectrl.VideoCheck, updownctrl.DownloadM3u8H5)
|
||||
}
|
||||
|
||||
tag := g.Group("/tag")
|
||||
{
|
||||
tag.GET("/list", officialWebsitectrl.TagList)
|
||||
}
|
||||
|
||||
recruitForm := g.Group("/recruitForm")
|
||||
{
|
||||
recruitForm.POST("/", officialWebsitectrl.RecruitForm)
|
||||
}
|
||||
|
||||
partner := g.Group("/partner")
|
||||
{
|
||||
partner.GET("/list", officialWebsitectrl.PartnerList)
|
||||
}
|
||||
|
||||
jobList := g.Group("/jobList")
|
||||
{
|
||||
jobList.GET("/list", officialWebsitectrl.JobList)
|
||||
}
|
||||
|
||||
business := g.Group("/business")
|
||||
{
|
||||
business.GET("/list", officialWebsitectrl.BusinessList)
|
||||
}
|
||||
news := g.Group("/news")
|
||||
{
|
||||
news.GET("/list", officialWebsitectrl.NewsList)
|
||||
news.GET("/:id", officialWebsitectrl.NewsDetail)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/paymentguidectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func paymentGuideRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/payment")
|
||||
{
|
||||
group.GET("/guide", paymentguidectrl.Get)
|
||||
group.POST("/guide/impression", paymentguidectrl.Impression)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/pingctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func pingRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/ping")
|
||||
{
|
||||
group.GET("/domain", pingctrl.DomainList)
|
||||
group.GET("/check", pingctrl.Ping)
|
||||
group.GET("/pass/:buildId/:ver", pingctrl.Pass)
|
||||
group.GET("/sysDate", pingctrl.GetSysDate)
|
||||
group.GET("/v", pingctrl.M)
|
||||
group.GET("/domain/h5", pingctrl.Domain)
|
||||
group.GET("/domain/refresh", pingctrl.DomainRefresh)
|
||||
// 检查消息小红点
|
||||
group.GET("/checkMessageTip", pingctrl.CheckMessageTip)
|
||||
group.GET("/store_url", pingctrl.StoreUrl)
|
||||
group.GET("/banner/:id", pingctrl.GetBannerJump)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/productctrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func productRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/product")
|
||||
{
|
||||
group.GET("/coupon", productctrl.GetCouponDetail)
|
||||
group.POST("/buy", limitHandler.FilterRequestLimit, productctrl.BuyProduct)
|
||||
group.POST("/delBrought", productctrl.DelBroughtProductHistory)
|
||||
group.GET("/getCoin", productctrl.GetCoinMonthCoin)
|
||||
group.POST("/exchangeIntegral", productctrl.ExchangeIntegral)
|
||||
group.GET("/getAwVip", productctrl.GetAwVip)
|
||||
group.GET("/advanceStatus", productctrl.AdvanceStatus)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/userctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func proxyRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/proxy")
|
||||
{
|
||||
group.POST("/bind", userctrl.Invite)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/publishctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func publishRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/publish")
|
||||
{
|
||||
group.GET("/details", publishctrl.Details)
|
||||
group.GET("/leaderboard", publishctrl.WeekLeaderboard)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/rankctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func rankRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/rank")
|
||||
{
|
||||
group.GET("/hotsearch/list", rankctrl.HotSearchList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/rechargectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func rchgRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/mine")
|
||||
{
|
||||
// 获取充值类型
|
||||
group.GET("/rechargeTypeList", rechargectrl.GetRechargeType)
|
||||
// 获取充值类型
|
||||
group.GET("/rchgTypeList", rechargectrl.GetRechargeType)
|
||||
//获取充值记录列表
|
||||
group.GET("/rchg/order", rechargectrl.GetRecHistory)
|
||||
//获取货币列表
|
||||
group.GET("/currencys", rechargectrl.CurrencyList)
|
||||
// 充值
|
||||
group.POST("/topay", rechargectrl.NewRecharge)
|
||||
// 获取用户的交易记录
|
||||
group.POST("/transaction", rechargectrl.GetUserTransactions)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/recommctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func recommendRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/recommend")
|
||||
{
|
||||
group.GET("/user/list", recommctrl.GetUserList)
|
||||
group.GET("/light/vids", recommctrl.GetLightVidList)
|
||||
group.GET("/vid/ad", recommctrl.GetVidAd)
|
||||
group.GET("/vid/list", recommctrl.GetVidList)
|
||||
group.GET("/vid/list/discover", recommctrl.GetShortDiscoverList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/recreationctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func recreationRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/recreation")
|
||||
group.GET("/list", recreationctrl.List)
|
||||
group.POST("/click", recreationctrl.Click)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/scenebannerctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func sceneBannerRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/banner")
|
||||
{
|
||||
group.GET("/list", scenebannerctrl.List)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/searchctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func searchRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/search")
|
||||
{
|
||||
group.GET("/index", searchctrl.IndexList)
|
||||
group.POST("/list", searchctrl.List)
|
||||
group.GET("/wonder/list", searchctrl.WonderTagList)
|
||||
group.GET("/hotTag", searchctrl.HotTagSearch)
|
||||
group.GET("/hotVid/list", searchctrl.HotVid)
|
||||
group.GET("/hotPublisher/list", searchctrl.HotPublisher)
|
||||
group.GET("/publisher/list", searchctrl.PublisherList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/sharectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func shareRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/share")
|
||||
{
|
||||
group.POST("/output", sharectrl.GeneratorQrCode)
|
||||
group.GET("/count", sharectrl.GetShareCnt)
|
||||
}
|
||||
}
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/signrecordctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// signRecord 移动端接口
|
||||
func signRecordRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/sign_record")
|
||||
{
|
||||
group.POST("/resign", signrecordctrl.AgainSign)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/smsctrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func smsRoute(router *gin.RouterGroup) {
|
||||
group := router.Group("/sms")
|
||||
{
|
||||
group.POST("/captcha", limitHandler.FilterSMSCaptchaByIP, smsctrl.SendCaptcha)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/staticctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func staticRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("static")
|
||||
group.GET("/faq/html/index", staticctrl.HtmlFaqPage)
|
||||
group.GET("/faq/tmpl/index", staticctrl.TmplFaqPage)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/walletctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func storeWalletRouter(router *gin.RouterGroup) {
|
||||
wallet := router.Group("/store_wallet")
|
||||
{
|
||||
// 获取余额
|
||||
wallet.GET("/balance", walletctrl.WalletBalance)
|
||||
// 扣款
|
||||
wallet.POST("/deduct", walletctrl.WalletDeduct)
|
||||
// 退款
|
||||
wallet.POST("/refund", walletctrl.WalletRefund)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/tagctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func tagRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/tag")
|
||||
{
|
||||
group.GET("/list", tagctrl.TagList) //获取专题所有标签列表
|
||||
group.GET("/v2/list", tagctrl.V2TagList) //上传常用的标签列表 2020-10-20 后新版本使用
|
||||
group.GET("/user/list", tagctrl.UserTagList) //查询用户标签列表
|
||||
group.GET("/vid/list", tagctrl.VidList) //根据标签列表查询视频列表(第二次请求查询同一标签下的第二波视频)
|
||||
group.GET("/media/list", tagctrl.MediaList)
|
||||
group.GET("/related/list", tagctrl.RelatedTagList) //根据标签名字模糊查询标签信息
|
||||
group.GET("/group", tagctrl.Group) //查询所有的标签,显示标签列表及下面视频(初始化查询,查询6个标签,和每个标签下面的三个视频)
|
||||
group.GET("/info", tagctrl.GetTagInfo) //获取标签详情
|
||||
// group.GET("/list/most-played", tagctrl.TagListMostPlayed)
|
||||
group.GET("/conf/list", tagctrl.TagConfList) //获取后台配置的所有标签
|
||||
group.POST("/add", tagctrl.AddUserTag) //根据标签搜索结果 添加标签到用户标签列表中
|
||||
group.POST("/add/new", tagctrl.AddNewTag) //新增标签,添加到标签库
|
||||
group.DELETE("/deleteUserTag", tagctrl.DeleteUserTag) //删除用户标签
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/taskctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func taskRouter(router *gin.RouterGroup) {
|
||||
task := router.Group("/task")
|
||||
{
|
||||
// 本项目暂未用到
|
||||
//task.GET("", taskctrl.GetTaskList) // 获取普通任务(不包括一次性任务和每日任务)
|
||||
//task.POST("/boon", taskctrl.GetBoon) // 用户领取普通任务奖励(不包括一次性任务和每日任务)
|
||||
//task.GET("/detail", taskctrl.GetTaskDetails) // 获取普通任务详情
|
||||
|
||||
task.GET("/sign", taskctrl.GetSignDetails) // 获取签到信息
|
||||
task.POST("/sign", taskctrl.Sign) // 用户签到
|
||||
task.POST("/resign", taskctrl.ReSign) // 用户补签
|
||||
task.GET("/sign-extra-prizes", taskctrl.SignExtraPrizes) // 签到额外信息
|
||||
task.GET("/list", taskctrl.GetNewTask) // 获取每日任务列表
|
||||
task.POST("/receive", taskctrl.Receive)
|
||||
task.POST("/do", taskctrl.Do)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/tonectrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func toneRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/tone")
|
||||
{
|
||||
group.POST("/vid/list", tonectrl.VidList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/txnactctr"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func txnactRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/mine")
|
||||
{
|
||||
txnactGroup := group.Group("/txnact")
|
||||
txnactGroup.DELETE("/del", txnactctr.DelTxAccount)
|
||||
{
|
||||
bank := txnactGroup.Group("/bank")
|
||||
{
|
||||
//银行卡绑定
|
||||
bank.GET("/get", txnactctr.GetBanks)
|
||||
bank.POST("/add", txnactctr.AddBank)
|
||||
bank.POST("/update", txnactctr.EditTransactionAct)
|
||||
}
|
||||
alipay := txnactGroup.Group("/alipay")
|
||||
{
|
||||
//支付宝
|
||||
alipay.GET("/get", txnactctr.GetAlipays)
|
||||
alipay.POST("/add", txnactctr.AddAliPay)
|
||||
alipay.POST("/update", txnactctr.EditTransactionAct)
|
||||
}
|
||||
zfb := txnactGroup.Group("/zfb")
|
||||
{
|
||||
//支付宝
|
||||
zfb.GET("/get", txnactctr.GetAlipays)
|
||||
zfb.POST("/add", txnactctr.AddAliPay)
|
||||
zfb.POST("/update", txnactctr.EditTransactionAct)
|
||||
|
||||
}
|
||||
yh := txnactGroup.Group("/yh")
|
||||
{
|
||||
//银行卡绑定
|
||||
yh.GET("/get", txnactctr.GetBanks)
|
||||
yh.POST("/add", txnactctr.AddBank)
|
||||
yh.POST("/update", txnactctr.EditTransactionAct)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/updownctrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func updownloadRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/vid")
|
||||
{
|
||||
group.POST("/upload", updownctrl.Upload)
|
||||
group.POST("/uploadStatic", updownctrl.UploadStatic)
|
||||
group.POST("/uploadStatic/batch", updownctrl.UploadStaticBatch)
|
||||
group.POST("/uploadDotStream", updownctrl.UploadDotStream)
|
||||
group.POST("/uploadDotJson", updownctrl.UploadDotJson)
|
||||
group.GET("/m3u8/*source", limitHandler.M3u8HourlyLimit, updownctrl.DownloadM3u8)
|
||||
group.StaticFile("/sec", "config/enc.key")
|
||||
group.StaticFile("/new/sec", "config/enc.key")
|
||||
group.StaticFile("/pms/sec", "config/enc_pms.key")
|
||||
group.StaticFile("/pms/mt_sec", "config/enkeymt.key")
|
||||
group.StaticFile("/lsjsec", "config/lsjm3u8.key")
|
||||
group.StaticFile("/m3u8sec", "config/m3u8.key")
|
||||
group.GET("/h5/m3u8/*source", updownctrl.RequireM3u8Ticket, limitHandler.Limit, limitHandler.M3u8HourlyLimit, updownctrl.DownloadM3u8H5)
|
||||
group.GET("/h5/light/m3u8/*source", updownctrl.RequireM3u8Ticket, updownctrl.DownloadM3u8H5)
|
||||
group.GET("/transcode/m3u8/*source", updownctrl.DownloadTranscodeM3u8)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/userctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func userRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/mine")
|
||||
{
|
||||
group.POST("/mobileLoginOnly", userctrl.MobileLogin)
|
||||
group.POST("/mobileBind", userctrl.MobileBind)
|
||||
group.POST("/login", userctrl.LoginWithDevice)
|
||||
group.POST("/info", userctrl.Modify)
|
||||
group.GET("/info", userctrl.Info)
|
||||
group.GET("/rights", userctrl.MyRights)
|
||||
group.GET("/setting", userctrl.ISetting)
|
||||
group.POST("/setting", userctrl.ModifySetting)
|
||||
group.GET("comment", userctrl.Comment)
|
||||
group.GET("/like",
|
||||
// TODO: 前端请求太过频繁时会造成页码重复、丢失,临时加上频率限制
|
||||
// limitHandler.FilterRequestByUserAndTerminal(redisconst.GetUserLikeRateLimitKey(),
|
||||
// redisconst.GetUserLikeRateLimitExpire(), stderr.GetLikesBusy),
|
||||
userctrl.Like)
|
||||
group.GET("/collection", userctrl.Collection)
|
||||
group.GET("/publish", userctrl.PublishList)
|
||||
group.GET("/publish/num", userctrl.PublishNum)
|
||||
group.POST("/publish/delete", userctrl.PublishWorkDelete)
|
||||
group.GET("/buyVid",
|
||||
// limitHandler.FilterRequestByUserAndTerminal(redisconst.GetUserBuyVidRateLimitKey(),
|
||||
// redisconst.GetUserLikeRateLimitExpire(), stderr.GetLikesBusy),
|
||||
userctrl.BuyVidList)
|
||||
group.GET("/faq/list", userctrl.FaqList)
|
||||
group.GET("/faq/cate/list", userctrl.FaqCateList)
|
||||
group.GET("/certificate/qr", userctrl.QrCode)
|
||||
group.GET("/autoLocate", userctrl.AutoLocate)
|
||||
group.POST("/inviteBind", userctrl.Invite)
|
||||
group.POST("/inviter", userctrl.Inviter)
|
||||
group.GET("/announce", userctrl.Announce)
|
||||
group.GET("/announce/list", userctrl.AnnounceList)
|
||||
group.POST("/login/h5",
|
||||
userctrl.LoginWithH5)
|
||||
group.POST("/login/h5/qr", userctrl.LoginByQRCode)
|
||||
group.POST("/privilege/consume", userctrl.ConsumePrivilege)
|
||||
|
||||
}
|
||||
group.POST("/resetpassword", userctrl.ResetPassWord)
|
||||
group.POST("/resetpassword/mobileverify", userctrl.MobileVerify)
|
||||
group.POST("/register", userctrl.Register)
|
||||
group.POST("/qrcode/extract", userctrl.ExtractQRCode)
|
||||
group.GET("/watch_record/list", userctrl.WatchRecord)
|
||||
group.GET("/portrait", userctrl.Portrait)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/statcenterctl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// userInviteRouter 全名代理
|
||||
func userInviteRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/userinvite")
|
||||
{
|
||||
group.POST("/callback/recharge", statcenterctl.StatcenterRechargeCallBack) // 充值成功回掉
|
||||
group.POST("/userlist", statcenterctl.UserInviteList)
|
||||
group.POST("/incomelist", statcenterctl.UserInviteIncomeList)
|
||||
group.POST("/info", statcenterctl.UserInviteInfo)
|
||||
group.POST("/videolist", statcenterctl.UserVideoList)
|
||||
}
|
||||
statgroup := router.Group("/statcenter")
|
||||
{
|
||||
statgroup.POST("/sync", statcenterctl.StatcenterSyncList)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/versionctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func versionRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/mine")
|
||||
{
|
||||
group.GET("/ver", versionctrl.GetVersion)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/vidctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func vidRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/vid")
|
||||
{
|
||||
group.GET("/location/list", vidctrl.GetLocationList)
|
||||
group.GET("/location/hot", vidctrl.GetLocationHot)
|
||||
group.GET("/info", vidctrl.GetVidInfo)
|
||||
group.POST("/submit", vidctrl.Submit)
|
||||
group.POST("/play", vidctrl.PlayRecord)
|
||||
group.POST("/play/consume", vidctrl.ConsumeWatchCount)
|
||||
group.GET("/hot/list", vidctrl.HotList)
|
||||
group.GET("/hotkw/list", vidctrl.HotKWList)
|
||||
group.GET("/location/info", vidctrl.GetLocation)
|
||||
group.GET("/user/count", vidctrl.GetWatchCount)
|
||||
group.POST("/remove", vidctrl.RemoveMyVideos)
|
||||
group.GET("/news/list", vidctrl.GetNewsList)
|
||||
group.POST("/news/unlike", vidctrl.DoUnlike)
|
||||
group.GET("/community/recommend", vidctrl.CommunityRecommend)
|
||||
group.GET("/module/:subModuleID/refresh", vidctrl.RefreshModuleVideos)
|
||||
group.GET("/module/:subModuleID", vidctrl.ModuleVideoList)
|
||||
group.GET("/section/:sectionID", vidctrl.SectionVideoList)
|
||||
group.GET("/section/changeVideo/:sectionID", vidctrl.ChangeSectionVideoList)
|
||||
group.GET("/section/changeMedia/:sectionID", vidctrl.ChangeSectionMediaList)
|
||||
group.GET("/section/list", vidctrl.SectionList)
|
||||
group.GET("/moduleVideo", vidctrl.AllVideosOfModule)
|
||||
group.GET("/list", vidctrl.List)
|
||||
group.GET("/ranking", vidctrl.Ranking)
|
||||
group.GET("/sections", vidctrl.Sections)
|
||||
group.GET("/module/short/all", vidctrl.RecommendShortVideos)
|
||||
group.GET("/recommend/list", vidctrl.RecommendList)
|
||||
group.POST("/recommand/vidPlay", vidctrl.VidPlayRecommand) // 视频播放页的推荐视频列表
|
||||
group.GET("/recommand/search", vidctrl.SearchRecommand) // 搜索页面的视频播放列表
|
||||
group.GET("/library", vidctrl.Library) // 片库首页
|
||||
group.POST("/library/search", vidctrl.LibrarySearch) // 片库搜索
|
||||
// 折扣专区相关
|
||||
group.GET("/discount/list", vidctrl.DiscountVidList)
|
||||
group.GET("/discount/area", vidctrl.DiscountArea)
|
||||
group.GET("/module/all/:subModuleID", vidctrl.SubModuleAllVideoList) // 首页视频猜你喜欢
|
||||
group.GET("/home/new/list", vidctrl.HomeMostNewModuleVideoList) // 91pron 主页最新
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestVideoPlayConsumeRoute(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
engine := gin.New()
|
||||
vidRouter(engine.Group("/api/app"))
|
||||
|
||||
foundConsume := false
|
||||
foundLegacyCount := false
|
||||
for _, route := range engine.Routes() {
|
||||
if route.Method == "POST" && route.Path == "/api/app/vid/play/consume" {
|
||||
foundConsume = true
|
||||
}
|
||||
if route.Method == "GET" && route.Path == "/api/app/vid/user/count" {
|
||||
foundLegacyCount = true
|
||||
}
|
||||
}
|
||||
if !foundConsume {
|
||||
t.Error("POST /api/app/vid/play/consume is not registered")
|
||||
}
|
||||
if !foundLegacyCount {
|
||||
t.Error("legacy GET /api/app/vid/user/count is not registered")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/video_gold_coin_ctrl"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func videoGoldCoinRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/video_gold_coin")
|
||||
{
|
||||
group.GET("/list", video_gold_coin_ctrl.GetVideoGoldCoin)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/videoactivityctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func videoActivityRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/video_activity")
|
||||
{
|
||||
group.GET("/list", videoactivityctrl.List)
|
||||
group.GET("/history_record", videoactivityctrl.HistoryRecord)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/vipctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func vipRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/vip")
|
||||
{
|
||||
group.GET("/product", vipctrl.Product)
|
||||
group.GET("/history", vipctrl.PurchaseHistory)
|
||||
group.GET("/tiroCountdown", vipctrl.CountdownTiroCard)
|
||||
group.GET("/Announ", vipctrl.VIPUpAnnouns) //升级公告
|
||||
group.GET("/upInfo", vipctrl.VIPUpInfo) //升级信息
|
||||
group.POST("/up", vipctrl.VIPUp) //升级信息
|
||||
//group.GET("/recommend", vipctrl.VipRecommend)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/walletctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func walletRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/mine")
|
||||
{
|
||||
//获取钱包数量
|
||||
group.GET("/wallet", walletctrl.GetWalletAmount)
|
||||
//获取钱包数量
|
||||
group.GET("/qianbao", walletctrl.GetWalletAmount)
|
||||
//我的收益入支出(玩家与玩家之间)
|
||||
group.GET("/income/works", walletctrl.GetWorksIncome)
|
||||
group.GET("/bills", walletctrl.GetBill)
|
||||
// group.GET("/zhangdan", walletctrl.GetBill)
|
||||
group.GET("/iIncomes", walletctrl.GetIncome)
|
||||
group.GET("/getAllIncome", walletctrl.GetAllIncome)
|
||||
group.GET("/zhangdan", walletctrl.GetNewBill)
|
||||
group.GET("/fruitCoin/bill", walletctrl.FruitCoinBill)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/withdrawctrl"
|
||||
"91porn-server/app/middleware/limitHandler"
|
||||
"91porn-server/common/constant/redisconst"
|
||||
"91porn-server/common/stderr"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func withdrawRouter(router *gin.RouterGroup) {
|
||||
{
|
||||
//提现
|
||||
router.POST("/withdraw",
|
||||
limitHandler.FilterRequestByUser(redisconst.WithdrawLimtKey(), redisconst.WithdrawLimtKeyExpire(),
|
||||
stderr.WithdrawBusy),
|
||||
withdrawctrl.Withdraw,
|
||||
)
|
||||
//提现类型
|
||||
router.GET("/withdraw/type", withdrawctrl.GetType)
|
||||
//获取提现订单列表
|
||||
router.GET("/withdraw/order", withdrawctrl.WithdrawOrder)
|
||||
//获取提现配置列表
|
||||
router.GET("/withdraw/cfg", withdrawctrl.GetWithdrawCfg)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"91porn-server/app/api/wonderctrl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func wonderRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/wonder")
|
||||
{
|
||||
group.POST("/vid/list", wonderctrl.VidList)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user