-
Notifications
You must be signed in to change notification settings - Fork 1
/
room_query_handler.go
30 lines (25 loc) · 949 Bytes
/
room_query_handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package application
import (
"github.com/iammuho/natternet/cmd/app/context"
"github.com/iammuho/natternet/internal/chat/application/dto"
"github.com/iammuho/natternet/internal/chat/domain/services"
"github.com/iammuho/natternet/internal/chat/domain/values"
"github.com/iammuho/natternet/pkg/errorhandler"
)
type RoomQueryHandler interface {
QueryRooms(*dto.QueryRoomsReqDTO) ([]*values.RoomValue, *errorhandler.Response)
}
type roomQueryHandler struct {
ctx context.AppContext
roomQueryServices services.RoomQueryDomainServices
}
func NewRoomQueryHandler(ctx context.AppContext, roomQueryServices services.RoomQueryDomainServices) RoomQueryHandler {
return &roomQueryHandler{
ctx: ctx,
roomQueryServices: roomQueryServices,
}
}
// Query rooms
func (r *roomQueryHandler) QueryRooms(req *dto.QueryRoomsReqDTO) ([]*values.RoomValue, *errorhandler.Response) {
return r.roomQueryServices.QueryRooms(req)
}