update
This commit is contained in:
8
main.go
8
main.go
@@ -2,10 +2,8 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/dgrijalva/jwt-go"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
swaggerFiles "github.com/swaggo/files"
|
swaggerFiles "github.com/swaggo/files"
|
||||||
ginSwagger "github.com/swaggo/gin-swagger"
|
ginSwagger "github.com/swaggo/gin-swagger"
|
||||||
@@ -15,7 +13,7 @@ import (
|
|||||||
|
|
||||||
// @title DurpAPI
|
// @title DurpAPI
|
||||||
// @version 1.0
|
// @version 1.0
|
||||||
// @description This is a sample server celler server.
|
// @description API for Durp's needs
|
||||||
// @termsOfService http://swagger.io/terms/
|
// @termsOfService http://swagger.io/terms/
|
||||||
|
|
||||||
// @contact.name API Support
|
// @contact.name API Support
|
||||||
@@ -45,13 +43,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
openai := v1.Group("/openai")
|
openai := v1.Group("/openai")
|
||||||
{
|
{
|
||||||
openai.Use(authMiddleware("test"))
|
|
||||||
openai.GET("general", c.GeneralOpenAI)
|
openai.GET("general", c.GeneralOpenAI)
|
||||||
openai.GET("travelagent", c.TravelAgentOpenAI)
|
openai.GET("travelagent", c.TravelAgentOpenAI)
|
||||||
}
|
}
|
||||||
unraid := v1.Group("/unraid")
|
unraid := v1.Group("/unraid")
|
||||||
{
|
{
|
||||||
unraid.Use(authMiddleware("grafana"))
|
groups := []string{"grafana"}
|
||||||
|
unraid.Use(authMiddleware(groups))
|
||||||
unraid.GET("powerusage", c.UnraidPowerUsage)
|
unraid.GET("powerusage", c.UnraidPowerUsage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user