From db38b7ef5db16d6b07c61737db41fcdbe89e9ca8 Mon Sep 17 00:00:00 2001 From: fuji Date: Fri, 21 May 2021 23:30:41 +0900 Subject: [PATCH 1/2] fix enum --- docs/swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 4070c8cc..da5f0b7f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1119,7 +1119,7 @@ components: 値がない場合は、belongs として振る舞う schema: type: string - example: + enum: - admins - belongs From 8d9c022019ee794b2b043a885460a611eb092181 Mon Sep 17 00:00:00 2001 From: fuji Date: Sun, 23 May 2021 14:09:11 +0900 Subject: [PATCH 2/2] add traPGroup to filter --- usecase/production/event.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/usecase/production/event.go b/usecase/production/event.go index 3ef7b7cf..81e1d3f9 100644 --- a/usecase/production/event.go +++ b/usecase/production/event.go @@ -175,6 +175,7 @@ func createUserMap(users []*domain.User) map[uuid.UUID]*domain.User { return userMap } +// add traQ group and traP(111...) func addTraQGroupIDs(repo *Repository, userID uuid.UUID, expr filter.Expr) filter.Expr { t, err := repo.GormRepo.GetToken(userID) if err != nil { @@ -195,6 +196,14 @@ func addTraQGroupIDs(repo *Repository, userID uuid.UUID, expr filter.Expr) filte if err != nil { return e } + // add traP + user, err := repo.GormRepo.GetUser(id) + if err != nil { + return e + } + if user.Provider.Issuer == traQIssuerName { + groupIDs = append(groupIDs, traPGroupID) + } return &filter.LogicOpExpr{ LogicOp: filter.Or, Lhs: e,