api dokter reference
This commit is contained in:
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package dokter
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type DokterHandler struct {
|
||||
repo IDokterRepository
|
||||
}
|
||||
|
||||
func NewDokterHandler(repo IDokterRepository) DokterHandler {
|
||||
return DokterHandler{repo}
|
||||
}
|
||||
|
||||
func (h DokterHandler) ListDokter(c *gin.Context) {
|
||||
var list ListDokterModel
|
||||
|
||||
list, err := h.repo.SearchableListDokter(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, list.ToResponseList())
|
||||
}
|
||||
Reference in New Issue
Block a user