fixed lots of bugs

This commit is contained in:
2026-09-07 20:44:56 +08:00
parent 66235cf663
commit d0f0120271
30 changed files with 2442 additions and 212 deletions

View File

@@ -0,0 +1,51 @@
package genericanimation
import (
"bdgrp_go/master"
"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, animation)
fmt.Println("Loaded:", path)
})
}
func animation(c *fiber.Ctx) error {
userid := c.Params("userid")
m := master.GetMaster()
entries := map[string]any{}
if gam, ok := m["masterGenericAnimationMap"].(map[string]any); ok {
for id := range gam["entries"].(map[string]any) {
entries[id] = map[string]any{
"userId": userid,
"genericAnimationId": id,
"status": "already_read",
}
}
}
data := map[string]any{
"userGenericAnimationMap": map[string]any{"entries": entries},
}
encoded, err := pbutil.Encode("SuiteUserGetResponse", data)
if err != nil {
return c.Status(500).SendString(err.Error())
}
encrypted, err := utils.Encrypt(encoded)
if err != nil {
return c.Status(500).SendString(err.Error())
}
return c.Send(encrypted)
}