Skip to content

Commit

Permalink
✨ (command,query/response)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shion1305 committed May 7, 2024
1 parent 9d83ff6 commit 85a473d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions svc/pkg/domain/command/response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package command

import (
"context"
"ynufes-mypage-backend/svc/pkg/domain/model/response"
)

type Response interface {
Create(ctx context.Context, resp *response.Response) error
Set(ctx context.Context, resp response.Response) error
}
14 changes: 14 additions & 0 deletions svc/pkg/domain/query/response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package query

import (
"context"
"ynufes-mypage-backend/svc/pkg/domain/model/id"
"ynufes-mypage-backend/svc/pkg/domain/model/response"
)

type Response interface {
GetByID(ctx context.Context, oid id.ResponseID) (*response.Response, error)
ListByFormID(ctx context.Context, fid id.FormID) ([]response.Response, error)
ListByOrgID(ctx context.Context, oid id.OrgID) ([]response.Response, error)
ListByAuthorID(ctx context.Context, uid id.UserID) ([]response.Response, error)
}
8 changes: 8 additions & 0 deletions svc/pkg/registry/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ func (repo Repository) NewLineCommand() command.Line {
func (repo Repository) NewLineQuery() query.Line {
return reader.NewLine(repo.fb)
}

func (repo Repository) NewResponseCommand() command.Response {
return writer.NewResponse(repo.fb)
}

func (repo Repository) NewResponseQuery() query.Response {
return reader.NewResponse(repo.fb)
}

0 comments on commit 85a473d

Please sign in to comment.