access role documentation

This commit is contained in:
renaldybrada
2026-02-25 09:10:25 +07:00
parent 14f5850629
commit 6ac3798ea8
4 changed files with 250 additions and 0 deletions
+89
View File
@@ -15,6 +15,70 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/access/eligible-menu": {
"get": {
"tags": [
"Access Role"
],
"summary": "Get Pages By Keycloak Id",
"parameters": [
{
"type": "string",
"description": "Keycloak ID",
"name": "keycloak_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/shared.BaseResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/shared.BaseErrorResponse"
}
}
}
}
},
"/access/sync-keycloak-role": {
"post": {
"tags": [
"Access Role"
],
"summary": "Sync Keycloak Role",
"parameters": [
{
"description": "Sync Keycloak Role",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/access.SyncKeycloakRoleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/shared.BaseResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/shared.BaseErrorResponse"
}
}
}
}
},
"/antrian-operasi/": {
"get": {
"tags": [
@@ -790,6 +854,31 @@ const docTemplate = `{
}
},
"definitions": {
"access.SyncKeycloakRoleRequest": {
"type": "object",
"required": [
"email",
"keycloak_id",
"name"
],
"properties": {
"client_role": {
"type": "array",
"items": {
"type": "string"
}
},
"email": {
"type": "string"
},
"keycloak_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"antrianoperasi.CreatePasienOperasiRequest": {
"type": "object",
"required": [
+89
View File
@@ -9,6 +9,70 @@
"host": "localhost:8080",
"basePath": "/api",
"paths": {
"/access/eligible-menu": {
"get": {
"tags": [
"Access Role"
],
"summary": "Get Pages By Keycloak Id",
"parameters": [
{
"type": "string",
"description": "Keycloak ID",
"name": "keycloak_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/shared.BaseResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/shared.BaseErrorResponse"
}
}
}
}
},
"/access/sync-keycloak-role": {
"post": {
"tags": [
"Access Role"
],
"summary": "Sync Keycloak Role",
"parameters": [
{
"description": "Sync Keycloak Role",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/access.SyncKeycloakRoleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/shared.BaseResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/shared.BaseErrorResponse"
}
}
}
}
},
"/antrian-operasi/": {
"get": {
"tags": [
@@ -784,6 +848,31 @@
}
},
"definitions": {
"access.SyncKeycloakRoleRequest": {
"type": "object",
"required": [
"email",
"keycloak_id",
"name"
],
"properties": {
"client_role": {
"type": "array",
"items": {
"type": "string"
}
},
"email": {
"type": "string"
},
"keycloak_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"antrianoperasi.CreatePasienOperasiRequest": {
"type": "object",
"required": [
+58
View File
@@ -1,5 +1,22 @@
basePath: /api
definitions:
access.SyncKeycloakRoleRequest:
properties:
client_role:
items:
type: string
type: array
email:
type: string
keycloak_id:
type: string
name:
type: string
required:
- email
- keycloak_id
- name
type: object
antrianoperasi.CreatePasienOperasiRequest:
properties:
diagnosisItems:
@@ -432,6 +449,47 @@ info:
title: Antrian Operasi API
version: "1.0"
paths:
/access/eligible-menu:
get:
parameters:
- description: Keycloak ID
in: query
name: keycloak_id
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/shared.BaseResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/shared.BaseErrorResponse'
summary: Get Pages By Keycloak Id
tags:
- Access Role
/access/sync-keycloak-role:
post:
parameters:
- description: Sync Keycloak Role
in: body
name: body
required: true
schema:
$ref: '#/definitions/access.SyncKeycloakRoleRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/shared.BaseResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/shared.BaseErrorResponse'
summary: Sync Keycloak Role
tags:
- Access Role
/antrian-operasi/:
get:
parameters:
+14
View File
@@ -14,6 +14,13 @@ func NewAccessHandler(repo IAccessRepository) AccessHandler {
return AccessHandler{repo}
}
// SyncKeycloakRole godoc
// @Summary Sync Keycloak Role
// @Tags Access Role
// @Param body body SyncKeycloakRoleRequest true "Sync Keycloak Role"
// @Success 200 {object} shared.BaseResponse
// @Failure 500 {object} shared.BaseErrorResponse
// @Router /access/sync-keycloak-role [post]
func (h AccessHandler) SyncKeycloakRole(c *gin.Context) {
var req SyncKeycloakRoleRequest
@@ -68,6 +75,13 @@ func (h AccessHandler) SyncKeycloakRole(c *gin.Context) {
})
}
// GetPageByKeycloakId godoc
// @Summary Get Pages By Keycloak Id
// @Tags Access Role
// @Param keycloak_id query string true "Keycloak ID"
// @Success 200 {object} shared.BaseResponse
// @Failure 500 {object} shared.BaseErrorResponse
// @Router /access/eligible-menu [get]
func (h AccessHandler) GetPageByKeycloakId(c *gin.Context) {
keycloakId := c.Query("keycloak_id")