add more routes
This commit is contained in:
40
routes/api/user/param_userid/present.go
Normal file
40
routes/api/user/param_userid/present.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package param_userid
|
||||
|
||||
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.Get(path, present)
|
||||
fmt.Println("Loaded:", path)
|
||||
})
|
||||
}
|
||||
|
||||
func present(c *fiber.Ctx) error {
|
||||
data := map[string]any{
|
||||
"pagination": map[string]any{
|
||||
"start": 9223372036854775807,
|
||||
"limit": c.Query("limit"),
|
||||
"record": 0,
|
||||
},
|
||||
}
|
||||
|
||||
encoded, err := pbutil.Encode("UserPresentLimit", data)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
encrypted, err := utils.Encrypt(encoded)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
return c.Send(encrypted)
|
||||
}
|
||||
Reference in New Issue
Block a user