feat:完善项目

This commit is contained in:
henry
2021-11-02 16:22:07 +08:00
parent 690cd96bed
commit 20d81825e1
81 changed files with 5394 additions and 3700 deletions

View File

@ -1,9 +1,9 @@
package router
import (
"Edu/app/api"
"Edu/config"
"Edu/router/rate"
"ArmedPolice/app/api"
"ArmedPolice/config"
"ArmedPolice/router/rate"
"io"
"net/http"
"os"
@ -37,8 +37,8 @@ func (this *Router) registerAPI() {
g.Use()
// 登录验证
g.Use(NeedLogin(AddSkipperURL([]string{
apiPrefix + "/v1/account/authorize",
apiPrefix + "/v1/account/tourist",
apiPrefix + "/v1/account/login",
apiPrefix + "/v1/account/logout",
apiPrefix + "/v1/index",
apiPrefix + "/v1/grade",
apiPrefix + "/v1/book/list",
@ -53,39 +53,13 @@ func (this *Router) registerAPI() {
account := v1.Group("/account")
{
_api := new(api.Account)
account.POST("/authorize", _api.Authorize)
account.POST("/login", _api.Login)
account.POST("/logout", _api.Logout)
if config.IsDebug() {
account.GET("/tourist", _api.Tourist)
//account.GET("/tourist", _api.Tourist)
}
}
// Banner 接口管理
v1.GET("/index", new(api.Index).Index)
v1.GET("/grade", new(api.Index).Grade)
v1.GET("/banner", new(api.Banner).List)
v1.GET("/book/list", new(api.Book).List)
// User 接口管理
user := v1.Group("/user")
{
_api := new(api.User)
user.GET("/info", _api.Info)
}
// Book 接口管理
book := v1.Group("/book")
{
_api := new(api.Book)
book.GET("/home", _api.Home)
//book.GET("/list", _api.List)
book.GET("/detail", _api.Detail)
book.POST("/play", _api.Play)
}
// Pay 支付管理
pay := v1.Group("/pay")
{
_api := new(api.Pay)
pay.POST("/launch", _api.Launch)
pay.POST("/notice", _api.Notify)
}
}
func (this *Router) Init() *gin.Engine {