|
@@ -5,6 +5,7 @@ import (
|
|
|
|
|
|
agi "imuslab.com/arozos/mod/agi"
|
|
|
"imuslab.com/arozos/mod/common"
|
|
|
+ prout "imuslab.com/arozos/mod/prouter"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -74,10 +75,18 @@ func AGIInit() {
|
|
|
|
|
|
http.HandleFunc("/api/ajgi/exec", gw.HandleAgiExecutionRequestWithToken)
|
|
|
|
|
|
- // external AGI related functions
|
|
|
- http.HandleFunc("/api/ajgi/listExt", gw.ListExternalEndpoint)
|
|
|
- http.HandleFunc("/api/ajgi/addExt", gw.AddExternalEndPoint)
|
|
|
- http.HandleFunc("/api/ajgi/rmExt", gw.RemoveExternalEndPoint)
|
|
|
+ // external AGI related function
|
|
|
+ externalAGIRouter := prout.NewModuleRouter(prout.RouterOption{
|
|
|
+ ModuleName: "External AGI",
|
|
|
+ AdminOnly: false,
|
|
|
+ UserHandler: userHandler,
|
|
|
+ DeniedHandler: func(w http.ResponseWriter, r *http.Request) {
|
|
|
+ errorHandlePermissionDenied(w, r)
|
|
|
+ },
|
|
|
+ })
|
|
|
+ externalAGIRouter.HandleFunc("/api/ajgi/listExt", gw.ListExternalEndpoint)
|
|
|
+ externalAGIRouter.HandleFunc("/api/ajgi/addExt", gw.AddExternalEndPoint)
|
|
|
+ externalAGIRouter.HandleFunc("/api/ajgi/rmExt", gw.RemoveExternalEndPoint)
|
|
|
|
|
|
AGIGateway = gw
|
|
|
}
|