Serve /public static files and grant bank_admin table access.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 14:28:00 +05:00
parent 231e1dbae9
commit a3c87d231b
4 changed files with 278 additions and 2 deletions

View File

@@ -68,6 +68,7 @@ func start(router *gin.Engine, cfg *config.Config) {
ginSwagger.WrapHandler(swaggerFiles.Handler,
ginSwagger.DefaultModelsExpandDepth(-1))
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
router.Static("/public", cfg.PublicFilePath)
router.GET("/images/:id", auth.GetObject)
router.Run(`:` + cfg.Listen.Port)

File diff suppressed because one or more lines are too long

View File

@@ -79,6 +79,7 @@ func (h *handler) login(c *gin.Context) {
res, err := h.repository.Login(context.TODO(), loginReq)
if err != nil {
fmt.Println("err in repository.Login", err)
c.JSON(http.StatusBadRequest, appresult.ErrInternalServer)
return
}
@@ -94,6 +95,7 @@ func (h *handler) login(c *gin.Context) {
newTokenPair, err := utils.GenerateTokenPair(res.Id)
if err != nil {
fmt.Println("err in GenerateTokenPair", err)
c.JSON(http.StatusBadRequest, appresult.ErrNotAcceptable)
return
}

Binary file not shown.