2020-04-28 11:11:49 +00:00
|
|
|
package apiv1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
2021-04-06 12:23:23 +00:00
|
|
|
"github.com/vx3r/wg-gen-web/api/v1/auth"
|
|
|
|
"github.com/vx3r/wg-gen-web/api/v1/client"
|
|
|
|
"github.com/vx3r/wg-gen-web/api/v1/server"
|
|
|
|
"github.com/vx3r/wg-gen-web/api/v1/status"
|
2020-04-28 11:11:49 +00:00
|
|
|
)
|
|
|
|
|
2020-06-10 07:52:44 +00:00
|
|
|
// ApplyRoutes apply routes to gin router
|
2020-04-28 11:11:49 +00:00
|
|
|
func ApplyRoutes(r *gin.RouterGroup, private bool) {
|
|
|
|
v1 := r.Group("/v1.0")
|
|
|
|
{
|
|
|
|
if private {
|
|
|
|
client.ApplyRoutes(v1)
|
|
|
|
server.ApplyRoutes(v1)
|
2020-10-06 16:14:34 +00:00
|
|
|
status.ApplyRoutes(v1)
|
2020-04-28 11:11:49 +00:00
|
|
|
} else {
|
|
|
|
auth.ApplyRoutes(v1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|