generated from VLADIMIR/template
add permissions route
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"evening_detective_server/internal/modules/processor_jwt"
|
||||
"evening_detective_server/internal/repos/refresh_tokens_repo"
|
||||
"evening_detective_server/internal/repos/users_repo"
|
||||
"evening_detective_server/internal/services/ui_service"
|
||||
"evening_detective_server/internal/services/users_service"
|
||||
proto "evening_detective_server/proto"
|
||||
"log"
|
||||
@@ -54,6 +55,7 @@ func main() {
|
||||
processorJWT := processor_jwt.NewProcessor(os.Getenv("SECRET"))
|
||||
refreshTokensRepo := refresh_tokens_repo.NewRefreshTokensRepo(dbpool)
|
||||
usersService := users_service.NewUsersService(usersRepo, passwordGenerator, emailSender, processorJWT, refreshTokensRepo)
|
||||
uiService := ui_service.NewUiService()
|
||||
|
||||
// Create a listener on TCP port
|
||||
lis, err := net.Listen("tcp", ":8080")
|
||||
@@ -82,6 +84,7 @@ func main() {
|
||||
s,
|
||||
app.NewServer(
|
||||
usersService,
|
||||
uiService,
|
||||
),
|
||||
)
|
||||
// Serve gRPC server
|
||||
|
||||
@@ -226,6 +226,28 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/ui/permissions": {
|
||||
"get": {
|
||||
"operationId": "EveningDetectiveServer_GetPermissions",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/evening_detective_serverGetPermissionsRsp"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"EveningDetectiveServer"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/users": {
|
||||
"get": {
|
||||
"operationId": "EveningDetectiveServer_GetUsers",
|
||||
@@ -432,6 +454,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"evening_detective_serverGetPermissionsRsp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"evening_detective_serverGetUserByIdRsp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user