Perbaikan generate

This commit is contained in:
2025-10-20 09:46:08 +07:00
parent 21cc6aacdb
commit f253e65736
2 changed files with 617 additions and 266 deletions
+305 -128
View File
@@ -15,141 +15,141 @@ services:
retry_count: 3
endpoints:
# retribusi:
# description: "Retribusi tariff management"
# handler_folder: "retribusi"
# handler_file: "retribusi.go"
# handler_name: "Retribusi"
# table_name: "data_retribusi"
# functions:
# list:
# methods: ["GET"]
# path: "/"
# get_routes: "/"
# get_path: "/"
# model: "Retribusi"
# response_model: "RetribusiGetResponse"
# description: "Get retribusi list with pagination and filters"
# summary: "Get Retribusi List"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: true
# enable_database: true
# cache_ttl: 300
# has_pagination: true
# has_filter: true
# has_search: true
# has_stats: true
retribusi:
description: "Retribusi tariff management"
handler_folder: "retribusi"
handler_file: "retribusi.go"
handler_name: "Retribusi"
table_name: "data_retribusi"
functions:
list:
methods: ["GET"]
path: "/"
get_routes: "/"
get_path: "/"
model: "Retribusi"
response_model: "RetribusiGetResponse"
description: "Get retribusi list with pagination and filters"
summary: "Get Retribusi List"
tags: ["Retribusi"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
has_pagination: true
has_filter: true
has_search: true
has_stats: true
# get:
# methods: ["GET"]
# path: "/:id"
# get_routes: "/:id"
# get_path: "/:id"
# model: "Retribusi"
# response_model: "RetribusiGetByIDResponse"
# description: "Get retribusi by ID"
# summary: "Get Retribusi by ID"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: true
# enable_database: true
# cache_ttl: 300
get:
methods: ["GET"]
path: "/:id"
get_routes: "/:id"
get_path: "/:id"
model: "Retribusi"
response_model: "RetribusiGetByIDResponse"
description: "Get retribusi by ID"
summary: "Get Retribusi by ID"
tags: ["Retribusi"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
# dynamic:
# methods: ["GET"]
# path: "/dynamic"
# get_routes: "/dynamic"
# get_path: "/dynamic"
# model: "Retribusi"
# response_model: "RetribusiGetResponse"
# description: "Get retribusi with dynamic filtering"
# summary: "Get Retribusi Dynamic"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: true
# enable_database: true
# cache_ttl: 300
# has_dynamic: true
dynamic:
methods: ["GET"]
path: "/dynamic"
get_routes: "/dynamic"
get_path: "/dynamic"
model: "Retribusi"
response_model: "RetribusiGetResponse"
description: "Get retribusi with dynamic filtering"
summary: "Get Retribusi Dynamic"
tags: ["Retribusi"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
has_dynamic: true
# search:
# methods: ["GET"]
# path: "/search"
# get_routes: "/search"
# get_path: "/search"
# model: "Retribusi"
# response_model: "RetribusiGetResponse"
# description: "Search retribusi"
# summary: "Search Retribusi"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: true
# enable_database: true
# cache_ttl: 300
# has_search: true
search:
methods: ["GET"]
path: "/search"
get_routes: "/search"
get_path: "/search"
model: "Retribusi"
response_model: "RetribusiGetResponse"
description: "Search retribusi"
summary: "Search Retribusi"
tags: ["Retribusi"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
has_search: true
# create:
# methods: ["POST"]
# path: "/"
# post_routes: "/"
# post_path: "/"
# model: "RetribusiCreateRequest"
# response_model: "RetribusiCreateResponse"
# request_model: "RetribusiCreateRequest"
# description: "Create new retribusi"
# summary: "Create Retribusi"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: false
# enable_database: true
# cache_ttl: 0
create:
methods: ["POST"]
path: "/"
post_routes: "/"
post_path: "/"
model: "RetribusiCreateRequest"
response_model: "RetribusiCreateResponse"
request_model: "RetribusiCreateRequest"
description: "Create new retribusi"
summary: "Create Retribusi"
tags: ["Retribusi"]
require_auth: true
cache_enabled: false
enable_database: true
cache_ttl: 0
# update:
# methods: ["PUT"]
# path: "/:id"
# put_routes: "/:id"
# put_path: "/:id"
# model: "RetribusiUpdateRequest"
# response_model: "RetribusiUpdateResponse"
# request_model: "RetribusiUpdateRequest"
# description: "Update retribusi"
# summary: "Update Retribusi"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: false
# enable_database: true
# cache_ttl: 0
update:
methods: ["PUT"]
path: "/:id"
put_routes: "/:id"
put_path: "/:id"
model: "RetribusiUpdateRequest"
response_model: "RetribusiUpdateResponse"
request_model: "RetribusiUpdateRequest"
description: "Update retribusi"
summary: "Update Retribusi"
tags: ["Retribusi"]
require_auth: true
cache_enabled: false
enable_database: true
cache_ttl: 0
# delete:
# methods: ["DELETE"]
# path: "/:id"
# delete_routes: "/:id"
# delete_path: "/:id"
# model: "Retribusi"
# response_model: "RetribusiDeleteResponse"
# description: "Delete retribusi"
# summary: "Delete Retribusi"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: false
# enable_database: true
# cache_ttl: 0
delete:
methods: ["DELETE"]
path: "/:id"
delete_routes: "/:id"
delete_path: "/:id"
model: "Retribusi"
response_model: "RetribusiDeleteResponse"
description: "Delete retribusi"
summary: "Delete Retribusi"
tags: ["Retribusi"]
require_auth: true
cache_enabled: false
enable_database: true
cache_ttl: 0
# stats:
# methods: ["GET"]
# path: "/stats"
# get_routes: "/stats"
# get_path: "/stats"
# model: "AggregateData"
# response_model: "AggregateData"
# description: "Get retribusi statistics"
# summary: "Get Retribusi Stats"
# tags: ["Retribusi"]
# require_auth: true
# cache_enabled: true
# enable_database: true
# cache_ttl: 180
# has_stats: true
stats:
methods: ["GET"]
path: "/stats"
get_routes: "/stats"
get_path: "/stats"
model: "AggregateData"
response_model: "AggregateData"
description: "Get retribusi statistics"
summary: "Get Retribusi Stats"
tags: ["Retribusi"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 180
has_stats: true
# Example of another service
user:
@@ -248,3 +248,180 @@ services:
cache_enabled: false
enable_database: true
cache_ttl: 0
search:
methods: ["GET"]
path: "/search"
get_routes: "/search"
get_path: "/search"
model: "User"
response_model: "UserGetResponse"
description: "Search user"
summary: "Search User"
tags: ["User"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
has_search: true
schedule:
name: "Jadwal Dokter"
category: "schedule"
package: "schedule"
description: "Jadwal Dokter management"
base_url: ""
timeout: 30
retry_count: 3
endpoints:
schedule:
description: "Jadwal dokter management"
handler_folder: "master"
handler_file: "schedule.go"
handler_name: "schedule"
table_name: "daftar_jadwal_dokter"
# Definisikan skema tabel di sini
# =
schema:
columns:
- name: "id"
type: "serial4"
primary_key: true
go_type: "string" # Override tipe Go, UUID biasanya string
- name: "Hari"
type: "int4"
nullable: true
- name: "Nama_hari"
type: "varchar"
nullable: true
- name: "Waktu"
type: "varchar"
nullable: true
- name: "Dokter"
type: "uuid"
nullable: true
go_type: "string" # Override tipe Go
- name: "Spesialis"
type: "int4"
nullable: true
- name: "Sub_spesialis"
type: "int4"
nullable: true
- name: "Status"
type: "int4"
nullable: true
# ======================================================================
functions:
list:
methods: ["GET"]
path: "/"
get_routes: "/"
get_path: "/"
model: "Schedule"
response_model: "ScheduleGetResponse"
description: "Get schedule list with pagination and filters"
summary: "Get Schedule List"
tags: ["Schedule"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
has_pagination: true
has_filter: true
has_search: true
has_stats: true
get:
methods: ["GET"]
path: "/:id"
get_routes: "/:id"
get_path: "/:id"
model: "Schedule"
response_model: "ScheduleGetByIDResponse"
description: "Get schedule by ID"
summary: "Get schedule by ID"
tags: ["Schedule"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
search:
methods: ["GET"]
path: "/search"
get_routes: "/search"
get_path: "/search"
model: "Schedule"
response_model: "ScheduleGetResponse"
description: "Search schedule"
summary: "Search Schedule"
tags: ["Schedule"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 300
has_search: true
create:
methods: ["POST"]
path: "/"
post_routes: "/"
post_path: "/"
model: "Schedule"
response_model: "ScheduleCreateResponse"
request_model: "ScheduleCreateRequest"
description: "Create new schedule"
summary: "Create Schedule"
tags: ["Schedule"]
require_auth: true
cache_enabled: false
enable_database: true
cache_ttl: 0
update:
methods: ["PUT"]
path: "/:id"
put_routes: "/:id"
put_path: "/:id"
model: "Schedule"
response_model: "ScheduleUpdateResponse"
request_model: "ScheduleUpdateRequest"
description: "Update schedule"
summary: "Update Schedule"
tags: ["Schedule"]
require_auth: true
cache_enabled: false
enable_database: true
cache_ttl: 0
delete:
methods: ["DELETE"]
path: "/:id"
delete_routes: "/:id"
delete_path: "/:id"
model: "Schedule"
response_model: "ScheduleDeleteResponse"
description: "Delete schedule"
summary: "Delete Schedule"
tags: ["Schedule"]
require_auth: true
cache_enabled: false
enable_database: true
cache_ttl: 0
stats:
methods: ["GET"]
path: "/stats"
get_routes: "/stats"
get_path: "/stats"
model: "AggregateData"
response_model: "AggregateData"
description: "Get retribusi statistics"
summary: "Get Retribusi Stats"
tags: ["Retribusi"]
require_auth: true
cache_enabled: true
enable_database: true
cache_ttl: 180
has_stats: true