dokumentasi antrian operasi
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user