feat:完善项目管理,增加网站首页接口信息
This commit is contained in:
@ -1,21 +1,31 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
api2 "SciencesServer/app/api/enterprise/api"
|
||||
"SciencesServer/app/api/manage/api"
|
||||
api3 "SciencesServer/app/basic/api"
|
||||
api3 "SciencesServer/app/api/enterprise/api"
|
||||
api1 "SciencesServer/app/api/manage/api"
|
||||
api2 "SciencesServer/app/api/website/api"
|
||||
"SciencesServer/app/basic/api"
|
||||
"SciencesServer/app/session"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// registerAPI 注册API
|
||||
func registerAPI(app *gin.Engine) {
|
||||
apiPrefix := "/api"
|
||||
g := app.Group(apiPrefix)
|
||||
v1 := g.Group("/v1")
|
||||
|
||||
// Index 首页信息管理
|
||||
indexV1 := v1.Group("/index")
|
||||
{
|
||||
_api := new(api2.Index)
|
||||
indexV1.GET("", _api.Instance)
|
||||
}
|
||||
}
|
||||
|
||||
// registerManageAPI 注册API
|
||||
func registerManageAPI(app *gin.Engine) {
|
||||
apiPrefix := "/manage"
|
||||
// registerAdminAPI 注册API
|
||||
func registerAdminAPI(app *gin.Engine) {
|
||||
apiPrefix := "/admin"
|
||||
g := app.Group(apiPrefix)
|
||||
|
||||
// 登录验证
|
||||
@ -31,20 +41,20 @@ func registerManageAPI(app *gin.Engine) {
|
||||
// apiPrefix + "/account/logout",
|
||||
//}...)))
|
||||
// Captcha 验证码
|
||||
g.GET("/captcha", new(api.Captcha).Captcha)
|
||||
g.GET("/captcha", new(api1.Captcha).Captcha)
|
||||
// Upload 上传管理
|
||||
g.POST("/upload", new(api3.Upload).Upload)
|
||||
g.POST("/upload", new(api.Upload).Upload)
|
||||
// Account 账户管理
|
||||
account := g.Group("/account")
|
||||
{
|
||||
_api := new(api.Account)
|
||||
_api := new(api1.Account)
|
||||
account.POST("/login", _api.Login)
|
||||
account.POST("/logout", _api.Logout)
|
||||
}
|
||||
// User 用户管理
|
||||
user := g.Group("/user")
|
||||
{
|
||||
_api := new(api.User)
|
||||
_api := new(api1.User)
|
||||
user.GET("/info", _api.Info)
|
||||
user.GET("/menu", _api.Menu)
|
||||
user.POST("/list", _api.List)
|
||||
@ -59,7 +69,7 @@ func registerManageAPI(app *gin.Engine) {
|
||||
// Tenant 租户管理
|
||||
tenant := g.Group("/tenant")
|
||||
{
|
||||
_api := new(api.Tenant)
|
||||
_api := new(api1.Tenant)
|
||||
tenant.POST("/list", _api.List)
|
||||
tenant.POST("/add", _api.Add)
|
||||
tenant.POST("/edit", _api.Edit)
|
||||
@ -76,7 +86,7 @@ func registerManageAPI(app *gin.Engine) {
|
||||
// Menu 菜单管理
|
||||
menu := g.Group("/menu")
|
||||
{
|
||||
_api := new(api.Menu)
|
||||
_api := new(api1.Menu)
|
||||
menu.GET("/list", _api.List)
|
||||
menu.POST("/add", _api.Add)
|
||||
menu.POST("/edit", _api.Edit)
|
||||
@ -86,13 +96,13 @@ func registerManageAPI(app *gin.Engine) {
|
||||
// Auth 权限管理
|
||||
auth := g.Group("/auth")
|
||||
{
|
||||
_api := new(api.Auth)
|
||||
_api := new(api1.Auth)
|
||||
auth.POST("/list", _api.List)
|
||||
}
|
||||
// Department 部门管理
|
||||
department := g.Group("/department")
|
||||
{
|
||||
_api := new(api.Department)
|
||||
_api := new(api1.Department)
|
||||
department.GET("/list", _api.List)
|
||||
department.GET("/select", _api.Select)
|
||||
department.POST("/add", _api.Add)
|
||||
@ -102,7 +112,7 @@ func registerManageAPI(app *gin.Engine) {
|
||||
// Role 角色管理
|
||||
role := g.Group("/role")
|
||||
{
|
||||
_api := new(api.Role)
|
||||
_api := new(api1.Role)
|
||||
role.POST("/list", _api.List)
|
||||
role.POST("/select", _api.Select)
|
||||
role.POST("/add", _api.Add)
|
||||
@ -117,7 +127,7 @@ func registerManageAPI(app *gin.Engine) {
|
||||
// Logs 日志管理
|
||||
log := g.Group("/log")
|
||||
{
|
||||
_api := new(api.Log)
|
||||
_api := new(api1.Log)
|
||||
log.POST("/login", _api.Login)
|
||||
}
|
||||
}
|
||||
@ -136,11 +146,11 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
v1 := g.Group("/v1")
|
||||
|
||||
// Upload 上传管理
|
||||
v1.POST("/upload", new(api3.Upload).Upload)
|
||||
v1.POST("/upload", new(api.Upload).Upload)
|
||||
// Config 配置管理
|
||||
configV1 := v1.Group("/config")
|
||||
{
|
||||
_api := new(api2.Config)
|
||||
_api := new(api3.Config)
|
||||
configV1.GET("/area", _api.Area)
|
||||
configV1.GET("/identity", _api.Identity)
|
||||
configV1.GET("/industry", _api.Industry)
|
||||
@ -148,7 +158,7 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
// Account 账号管理
|
||||
accountV1 := v1.Group("/account")
|
||||
{
|
||||
_api := new(api2.Account)
|
||||
_api := new(api3.Account)
|
||||
accountV1.POST("/login", _api.Login)
|
||||
accountV1.POST("/register", _api.Register)
|
||||
accountV1.POST("/authorize", _api.Authorize)
|
||||
@ -157,26 +167,26 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
// User 用户管理
|
||||
userV1 := v1.Group("/user")
|
||||
{
|
||||
_api := new(api2.User)
|
||||
_api := new(api3.User)
|
||||
userV1.GET("/info", _api.Info)
|
||||
userV1.GET("/patent", _api.Patent)
|
||||
}
|
||||
// Home 首页管理
|
||||
homeV1 := v1.Group("/home")
|
||||
{
|
||||
_api := new(api2.Home)
|
||||
_api := new(api3.Home)
|
||||
homeV1.GET("", _api.Instance)
|
||||
}
|
||||
// Sys 配置管理
|
||||
sysV1 := v1.Group("/sys")
|
||||
{
|
||||
_api := new(api2.Sys)
|
||||
_api := new(api3.Sys)
|
||||
sysV1.POST("/patent", _api.Patent)
|
||||
}
|
||||
// Settled 入驻管理
|
||||
settledV1 := v1.Group("/settled")
|
||||
{
|
||||
_api := new(api2.Settled)
|
||||
_api := new(api3.Settled)
|
||||
settledV1.GET("", _api.Index)
|
||||
settledV1.POST("/company", _api.Company)
|
||||
settledV1.POST("/company/get", _api.CompanyGet)
|
||||
@ -188,7 +198,7 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
// Technology 技术管理
|
||||
technologyV1 := g.Group("/technology")
|
||||
{
|
||||
_api := new(api2.Technology)
|
||||
_api := new(api3.Technology)
|
||||
technologyV1.POST("/paper", _api.Paper)
|
||||
technologyV1.POST("/paper/add", _api.PaperAdd)
|
||||
technologyV1.POST("/paper/edit", _api.PaperEdit)
|
||||
@ -227,7 +237,7 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
// Service 服务信息
|
||||
serviceV1 := v1.Group("/service")
|
||||
{
|
||||
_api := new(api2.Service)
|
||||
_api := new(api3.Service)
|
||||
serviceV1.POST("/demand", _api.Demand)
|
||||
serviceV1.POST("/demand/detail", _api.DemandDetail)
|
||||
serviceV1.POST("/demand/add", _api.DemandAdd)
|
||||
@ -237,7 +247,7 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
// Manage 管理信息
|
||||
manageV1 := v1.Group("/manage")
|
||||
{
|
||||
_api := new(api2.Manage)
|
||||
_api := new(api3.Manage)
|
||||
manageV1.POST("/enterprise", _api.Enterprise)
|
||||
manageV1.POST("/enterprise/add", _api.EnterpriseAdd)
|
||||
manageV1.POST("/enterprise/edit", _api.EnterpriseEdit)
|
||||
@ -255,7 +265,7 @@ func registerEnterpriseAPI(app *gin.Engine) {
|
||||
// Activity 活动信息
|
||||
activityV1 := v1.Group("/activity")
|
||||
{
|
||||
_api := new(api2.Activity)
|
||||
_api := new(api3.Activity)
|
||||
activityV1.POST("/apply", _api.Applys)
|
||||
activityV1.POST("/apply/revoke", _api.ApplyRevoke)
|
||||
activityV1.POST("/apply/delete", _api.ApplyDelete)
|
||||
|
@ -57,7 +57,7 @@ func (this *Router) Init() *gin.Engine {
|
||||
app.StaticFS("/upload", http.Dir("./upload"))
|
||||
// 注册路由
|
||||
registerAPI(app)
|
||||
registerManageAPI(app)
|
||||
registerAdminAPI(app)
|
||||
registerEnterpriseAPI(app)
|
||||
|
||||
app.MaxMultipartMemory = 4 << 20
|
||||
|
Reference in New Issue
Block a user