feat: rabbitMQ is now calling from seatchtitles

This commit is contained in:
Iron_Felix 2025-11-30 02:57:11 +03:00
parent c6cebb0ed2
commit 77a63a1c74
7 changed files with 237 additions and 124 deletions

View file

@ -4,16 +4,29 @@ import (
"encoding/json"
"fmt"
oapi "nyanimedb/api"
"nyanimedb/modules/backend/rmq"
sqlc "nyanimedb/sql"
"strconv"
)
type Server struct {
db *sqlc.Queries
type Handler struct {
publisher *rmq.Publisher
}
func NewServer(db *sqlc.Queries) Server {
return Server{db: db}
func New(publisher *rmq.Publisher) *Handler {
return &Handler{publisher: publisher}
}
type Server struct {
db *sqlc.Queries
publisher *rmq.Publisher // ← добавьте это поле
}
func NewServer(db *sqlc.Queries, publisher *rmq.Publisher) *Server {
return &Server{
db: db,
publisher: publisher,
}
}
func sql2StorageType(s *sqlc.StorageTypeT) (*oapi.StorageType, error) {