TP-55555|db additions adjustments in service,handler

This commit is contained in:
podili-varshitha_navi
2024-07-30 17:25:49 +05:30
23 changed files with 458 additions and 207 deletions

View File

@@ -1,7 +1,6 @@
package handler
import (
"cybertron/models/db"
"cybertron/service"
"net/http"
@@ -24,16 +23,5 @@ func (h *SourceMapHandler) GetSourceMap(c *gin.Context) {
}
func (h *SourceMapHandler) StoreSourceMap(c *gin.Context) {
var sourceMap db.SourceMap
if err := c.ShouldBindJSON(&sourceMap); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if err := h.sourceMapService.StoreSourceMap(sourceMap); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to store source map"})
return
}
c.JSON(http.StatusOK, gin.H{"status": "Source map stored successfully"})
h.sourceMapService.StoreSourceMap(c)
}