forked from mtusi2026/mtusi2026lab4
feat(app) implemented lab 4
This commit is contained in:
@@ -9,11 +9,12 @@ import (
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
store *store.Store
|
||||
store *store.Store
|
||||
jsonBodyLimit int64
|
||||
}
|
||||
|
||||
func NewHandler(st *store.Store) *Handler {
|
||||
return &Handler{store: st}
|
||||
func NewHandler(st *store.Store, jsonBodyLimit int64) *Handler {
|
||||
return &Handler{store: st, jsonBodyLimit: jsonBodyLimit}
|
||||
}
|
||||
|
||||
type CreateChatRequest struct {
|
||||
@@ -25,7 +26,7 @@ func (h *Handler) CreateChat(c fiber.Ctx) error {
|
||||
userID := common.MustUserID(c)
|
||||
|
||||
var req CreateChatRequest
|
||||
if err := common.BindJSON(c, &req); err != nil {
|
||||
if err := common.BindJSON(c, &req, h.jsonBodyLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user