dokumentasi antrian operasi
This commit is contained in:
No files matched your search
@@ -19,8 +19,9 @@ func NewDokterHandler(repo IDokterRepository) DokterHandler {
|
||||
|
||||
// GetListDokter godoc
|
||||
// @Summary Get List Dokter
|
||||
// @Tags dokter
|
||||
// @Success 200 {shared.BaseResponse} []DokterResponse
|
||||
// @Tags Dokter
|
||||
// @Param search query string false "Search keyword"
|
||||
// @Success 200 {object} []DokterResponse
|
||||
// @Failure 500 {object} shared.BaseErrorResponse
|
||||
// @Router /dokter/ [get]
|
||||
func (h DokterHandler) ListDokter(c *gin.Context) {
|
||||
@@ -34,6 +35,7 @@ func (h DokterHandler) ListDokter(c *gin.Context) {
|
||||
Message: err.Error(),
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, errorResponse)
|
||||
return
|
||||
}
|
||||
|
||||
response := baseResponse.ToBaseResponse(
|
||||
|
||||
@@ -16,10 +16,23 @@ func NewKategoriHandler(repo IKategoriRepository) KategoriHandler {
|
||||
return KategoriHandler{repo}
|
||||
}
|
||||
|
||||
// ListKategoriOperasi godoc
|
||||
// @Summary Get List Kategori Operasi
|
||||
// @Tags Kategori Operasi
|
||||
// @Param search query string false "Search keyword"
|
||||
// @Success 200 {object} []KategoriOperasiModel
|
||||
// @Failure 500 {object} shared.BaseErrorResponse
|
||||
// @Router /kategori/ [get]
|
||||
func (h KategoriHandler) ListKategoriOperasi(c *gin.Context) {
|
||||
list, err := h.repo.SearchableListKategori(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
errorResponse := baseResponse.BaseErrorResponse{
|
||||
Success: false,
|
||||
Code: 500,
|
||||
Message: err.Error(),
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, errorResponse)
|
||||
return
|
||||
}
|
||||
|
||||
response := baseResponse.ToBaseResponse(list, true, 200, "success get kategori operasi")
|
||||
|
||||
@@ -10,5 +10,5 @@ type KategoriOperasiModel struct {
|
||||
Status string `json:"status" db:"status" validate:"oneof=draft published"`
|
||||
Kategori string `json:"kategori" db:"kategori"`
|
||||
DateCreated time.Time `json:"date_created" db:"date_created"`
|
||||
DateUpdated sql.NullTime `json:"date_updated" db:"date_updated"`
|
||||
DateUpdated sql.NullTime `json:"date_updated" db:"date_updated" swaggertype:"string"`
|
||||
}
|
||||
@@ -16,10 +16,23 @@ func NewSpesialisHandler(repo ISpesialisRepository) SpesialisHandler {
|
||||
return SpesialisHandler{repo}
|
||||
}
|
||||
|
||||
// ListSpesialis godoc
|
||||
// @Summary Get List Spesialis
|
||||
// @Tags Spesialis
|
||||
// @Param search query string false "Search keyword"
|
||||
// @Success 200 {object} []SpesialisModel
|
||||
// @Failure 500 {object} shared.BaseErrorResponse
|
||||
// @Router /spesialis/ [get]
|
||||
func (h SpesialisHandler) ListSpesialis(c *gin.Context) {
|
||||
list, err := h.repo.SearchableListSpesialis(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
errorResponse := baseResponse.BaseErrorResponse{
|
||||
Success: false,
|
||||
Code: 500,
|
||||
Message: err.Error(),
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, errorResponse)
|
||||
return
|
||||
}
|
||||
|
||||
response := baseResponse.ToBaseResponse(list, true, 200, "success get list spesialis")
|
||||
@@ -27,10 +40,24 @@ func (h SpesialisHandler) ListSpesialis(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
// ListSubSpesialis godoc
|
||||
// @Summary Get List Sub Spesialis
|
||||
// @Tags Spesialis
|
||||
// @Param search query string false "Search keyword"
|
||||
// @Param id_spesialis query int false "Filter by Id Spesialis"
|
||||
// @Success 200 {object} []SubSpesialisModel
|
||||
// @Failure 500 {object} shared.BaseErrorResponse
|
||||
// @Router /sub-spesialis/ [get]
|
||||
func (h SpesialisHandler) ListSubSpesialis(c *gin.Context) {
|
||||
list, err := h.repo.SearchableListSubSpesialis(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
errorResponse := baseResponse.BaseErrorResponse{
|
||||
Success: false,
|
||||
Code: 500,
|
||||
Message: err.Error(),
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, errorResponse)
|
||||
return
|
||||
}
|
||||
|
||||
response := baseResponse.ToBaseResponse(list, true, 200, "success get list spesialis")
|
||||
|
||||
@@ -124,6 +124,8 @@ func (r spesialisRepo) SearchableListSubSpesialis(c *gin.Context) ([]SubSpesiali
|
||||
searchFilters := []queryUtils.DynamicFilter{
|
||||
{Column: "dss.Kode", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
|
||||
{Column: "dss.Subspesialis", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
|
||||
{Column: "ds.Kode", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
|
||||
{Column: "ds.Spesialis", Operator: queryUtils.OpILike, Value: "%" + search + "%"},
|
||||
}
|
||||
query.Filters = append(query.Filters, queryUtils.FilterGroup{Filters: searchFilters, LogicOp: "OR"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user