manager.go handler + some pieces of order.go service

This commit is contained in:
2026-04-12 21:02:14 +05:00
parent bd117d3a56
commit 2d96a1a135
3 changed files with 190 additions and 8 deletions

View File

@@ -9,7 +9,19 @@ import (
openapi_types "github.com/oapi-codegen/runtime/types"
)
func (s *Server) ListOrders(w http.ResponseWriter, r *http.Request, params api.ListOrdersParams) {}
func (s *Server) ListOrders(w http.ResponseWriter, r *http.Request, params api.ListOrdersParams) {
ctx := r.Context()
claims, ok := ctx.Value("user").(*Claims)
if !ok {
slog.ErrorContext(ctx, "Error while casting claims")
s.JSON(w, r, http.StatusInternalServerError, MsgInternalError, RespError)
return
}
switch claims.Role {
case "client":
break
}
}
func (s *Server) CreateOrder(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()