Changed the data types to be able to hold a companys NIF

This commit is contained in:
2025-09-20 23:47:44 +01:00
parent b578976dad
commit 3821c3fffc
8 changed files with 24672 additions and 9 deletions
+12 -1
View File
@@ -2,9 +2,9 @@
package api
// TODO: configure the logging
import (
"net/http"
// _ "net/http/pprof"
"strconv"
sw "github.com/ESilva15/PTInvCertSWDB/sw"
@@ -44,13 +44,24 @@ func get(c *gin.Context) {
c.JSON(http.StatusOK, sw)
}
func count(c *gin.Context) {
count := sw.Count()
c.JSON(http.StatusOK, gin.H{"count": count})
}
func RunServer() error {
// go func() {
// http.ListenAndServe("localhost:6060", nil)
// }()
gin.SetMode(ginMode)
router := gin.Default()
authGroup := router.Group("/")
// authGroup.Use(APIAuthMiddleWare())
authGroup.GET("/sw/:id", get)
authGroup.GET("/count", count)
// Star the SW service
err := sw.StartSWService(sw.FILEDB)