changed param logic & add more routes

This commit is contained in:
2026-09-04 18:08:20 +08:00
parent 86cde9bb97
commit a28c1dec9b
14 changed files with 269 additions and 12 deletions

View File

@@ -0,0 +1,38 @@
package validation
import (
"bdgrp_go/pbutil"
"bdgrp_go/routes"
"bdgrp_go/utils"
"fmt"
"github.com/gofiber/fiber/v2"
)
func init() {
path := routes.PathOf()
routes.Register(func(app *fiber.App) {
app.Post(path, ngword)
fmt.Println("Loaded:", path)
})
}
func ngword(c *fiber.Ctx) error {
data := map[string]any{
"isBadWord": false,
}
encoded, err := pbutil.Encode("NgWordResponse", data)
if err != nil {
fmt.Println(err)
return c.Status(500).SendString("")
}
encrypted, err := utils.Encrypt(encoded)
if err != nil {
fmt.Println(err)
}
return c.Send(encrypted)
}