feat(#22): gamificação RPG — XP, quests, conquistas, cosméticos e personagem SVG pixel art
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
@@ -14,11 +14,12 @@ import (
|
||||
)
|
||||
|
||||
type TransactionHandler struct {
|
||||
svc *service.TransactionService
|
||||
svc *service.TransactionService
|
||||
gameSvc *service.GameService
|
||||
}
|
||||
|
||||
func NewTransactionHandler(svc *service.TransactionService) *TransactionHandler {
|
||||
return &TransactionHandler{svc: svc}
|
||||
func NewTransactionHandler(svc *service.TransactionService, gameSvc *service.GameService) *TransactionHandler {
|
||||
return &TransactionHandler{svc: svc, gameSvc: gameSvc}
|
||||
}
|
||||
|
||||
func (h *TransactionHandler) List(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -42,6 +43,7 @@ func (h *TransactionHandler) Create(w http.ResponseWriter, r *http.Request) {
|
||||
respondError(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
h.gameSvc.NotifyAction(r.Context(), "transaction_created", map[string]any{"category_id": out.CategoryID})
|
||||
respondJSON(w, http.StatusCreated, out)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user