-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): use service for alerts
- Loading branch information
Showing
14 changed files
with
548 additions
and
170 deletions.
There are no files selected for viewing
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,19 @@ | ||
package mappers | ||
|
||
import ( | ||
"github.com/twirapp/twir/apps/api-gql/internal/delivery/gql/gqlmodel" | ||
"github.com/twirapp/twir/apps/api-gql/internal/entity" | ||
) | ||
|
||
func AlertEntityTo(e entity.Alert) gqlmodel.ChannelAlert { | ||
return gqlmodel.ChannelAlert{ | ||
ID: e.ID, | ||
Name: e.Name, | ||
AudioID: e.AudioID, | ||
AudioVolume: &e.AudioVolume, | ||
CommandIds: e.CommandIDS, | ||
RewardIds: e.RewardIDS, | ||
GreetingsIds: e.GreetingsIDS, | ||
KeywordsIds: e.KeywordsIDS, | ||
} | ||
} |
10 changes: 2 additions & 8 deletions
10
apps/api-gql/internal/delivery/gql/resolvers/admin-users.resolver.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
203 changes: 47 additions & 156 deletions
203
apps/api-gql/internal/delivery/gql/resolvers/alerts.resolver.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package entity | ||
|
||
import ( | ||
"github.com/google/uuid" | ||
) | ||
|
||
type Alert struct { | ||
ID uuid.UUID | ||
Name string | ||
ChannelID string | ||
AudioID *string | ||
AudioVolume int | ||
CommandIDS []string | ||
RewardIDS []string | ||
GreetingsIDS []string | ||
KeywordsIDS []string | ||
} | ||
|
||
var AlertNil = Alert{} |
Oops, something went wrong.