initiate repo
This commit is contained in:
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package spesialis
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type SpesialisHandler struct {
|
||||
repo ISpesialisRepository
|
||||
}
|
||||
|
||||
func NewSpesialisHandler(repo ISpesialisRepository) SpesialisHandler {
|
||||
return SpesialisHandler{repo}
|
||||
}
|
||||
|
||||
func (h SpesialisHandler) ListSpesialis(c *gin.Context) {
|
||||
list, err := h.repo.SearchableListSpesialis(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, list)
|
||||
}
|
||||
|
||||
func (h SpesialisHandler) ListSubSpesialis(c *gin.Context) {
|
||||
list, err := h.repo.SearchableListSubSpesialis(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, list)
|
||||
}
|
||||
Reference in New Issue
Block a user