initiate swagger docs

This commit is contained in:
renaldybrada
2026-02-02 08:42:18 +07:00
parent 16bfe4a1e5
commit 919085ba3a
8 changed files with 321 additions and 1 deletions
+104
View File
@@ -0,0 +1,104 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/dokter/": {
"get": {
"tags": [
"dokter"
],
"summary": "Get List Dokter",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dokter.DokterResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/shared.BaseErrorResponse"
}
}
}
}
}
},
"definitions": {
"dokter.DokterResponse": {
"type": "object",
"properties": {
"hfis_code": {
"type": "string"
},
"id": {
"type": "string"
},
"nama_ksm": {
"type": "string"
},
"nama_lengkap": {
"type": "string"
},
"nip": {
"type": "string"
}
}
},
"shared.BaseErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"errors": {
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:8080",
BasePath: "/api",
Schemes: []string{},
Title: "Antrian Operasi API",
Description: "Dokumentasi API Antrian Operasi",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
+80
View File
@@ -0,0 +1,80 @@
{
"swagger": "2.0",
"info": {
"description": "Dokumentasi API Antrian Operasi",
"title": "Antrian Operasi API",
"contact": {},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/api",
"paths": {
"/dokter/": {
"get": {
"tags": [
"dokter"
],
"summary": "Get List Dokter",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dokter.DokterResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/shared.BaseErrorResponse"
}
}
}
}
}
},
"definitions": {
"dokter.DokterResponse": {
"type": "object",
"properties": {
"hfis_code": {
"type": "string"
},
"id": {
"type": "string"
},
"nama_ksm": {
"type": "string"
},
"nama_lengkap": {
"type": "string"
},
"nip": {
"type": "string"
}
}
},
"shared.BaseErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"errors": {
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
}
}
}
+52
View File
@@ -0,0 +1,52 @@
basePath: /api
definitions:
dokter.DokterResponse:
properties:
hfis_code:
type: string
id:
type: string
nama_ksm:
type: string
nama_lengkap:
type: string
nip:
type: string
type: object
shared.BaseErrorResponse:
properties:
code:
type: integer
errors:
items:
type: string
type: array
message:
type: string
success:
type: boolean
type: object
host: localhost:8080
info:
contact: {}
description: Dokumentasi API Antrian Operasi
title: Antrian Operasi API
version: "1.0"
paths:
/dokter/:
get:
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/dokter.DokterResponse'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/shared.BaseErrorResponse'
summary: Get List Dokter
tags:
- dokter
swagger: "2.0"