-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
160 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package bizangela | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/tuihub/librarian/app/sephirah/internal/biz/bizutils" | ||
"github.com/tuihub/librarian/app/sephirah/internal/model/modelsupervisor" | ||
"github.com/tuihub/librarian/internal/lib/libauth" | ||
"github.com/tuihub/librarian/internal/model" | ||
"github.com/tuihub/librarian/internal/model/modelfeed" | ||
) | ||
|
||
func (a *Angela) PorterGetNotifyTargetItems(ctx context.Context, id model.InternalID, paging model.Paging) (*modelsupervisor.FeatureRequest, []*modelfeed.Item, error) { | ||
claims := libauth.FromContextAssertUserType(ctx, libauth.UserTypePorter) | ||
if claims == nil { | ||
return nil, nil, bizutils.NoPermissionError() | ||
} | ||
fr, items, err := a.repo.GetNotifyTargetItems(ctx, id, paging) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
return fr, items, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package service | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/tuihub/librarian/app/sephirah/internal/model/converter" | ||
"github.com/tuihub/librarian/internal/model" | ||
pb "github.com/tuihub/protos/pkg/librarian/sephirah/v1" | ||
) | ||
|
||
func (s *LibrarianSephirahServiceService) PorterGetNotifyTargetItems( | ||
ctx context.Context, | ||
req *pb.PorterGetNotifyTargetItemsRequest, | ||
) (*pb.PorterGetNotifyTargetItemsResponse, error) { | ||
fr, items, err := s.a.PorterGetNotifyTargetItems(ctx, | ||
converter.ToBizInternalID(req.GetId()), | ||
model.ToBizPaging(req.GetPaging()), | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &pb.PorterGetNotifyTargetItemsResponse{ | ||
Paging: nil, | ||
Destination: converter.ToPBFeatureRequest(fr), | ||
Items: converter.ToPBFeedItemList(items), | ||
}, nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters