28 lines
572 B
Go
28 lines
572 B
Go
package handler
|
|
|
|
import (
|
|
"cybertron/service"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type SourceMapHandler struct {
|
|
sourceMapService *service.SourceMapService
|
|
}
|
|
|
|
func NewSourceMapHandler(sourceMapService *service.SourceMapService) *SourceMapHandler {
|
|
return &SourceMapHandler{
|
|
sourceMapService: sourceMapService,
|
|
}
|
|
}
|
|
|
|
func (h *SourceMapHandler) GetSourceMap(c *gin.Context) {
|
|
sourceMap := h.sourceMapService.GetSourceMap()
|
|
c.JSON(http.StatusOK, sourceMap)
|
|
}
|
|
|
|
func (h *SourceMapHandler) StoreSourceMap(c *gin.Context) {
|
|
h.sourceMapService.StoreSourceMap(c)
|
|
}
|