feat: implement resolvers

This commit is contained in:
Lakhan Samani
2022-07-10 21:49:33 +05:30
parent 09c3eafe6b
commit e91a819067
87 changed files with 1807 additions and 428 deletions

View File

@@ -1,6 +1,7 @@
package provider_template
import (
"context"
"time"
"github.com/authorizerdev/authorizer/server/db/models"
@@ -9,7 +10,7 @@ import (
)
// AddWebhookLog to add webhook log
func (p *provider) AddWebhookLog(webhookLog models.WebhookLog) (models.WebhookLog, error) {
func (p *provider) AddWebhookLog(ctx context.Context, webhookLog models.WebhookLog) (*model.WebhookLog, error) {
if webhookLog.ID == "" {
webhookLog.ID = uuid.New().String()
}
@@ -17,10 +18,10 @@ func (p *provider) AddWebhookLog(webhookLog models.WebhookLog) (models.WebhookLo
webhookLog.Key = webhookLog.ID
webhookLog.CreatedAt = time.Now().Unix()
webhookLog.UpdatedAt = time.Now().Unix()
return webhookLog, nil
return webhookLog.AsAPIWebhookLog(), nil
}
// ListWebhookLogs to list webhook logs
func (p *provider) ListWebhookLogs(pagination model.Pagination, webhookID string) (*model.WebhookLogs, error) {
func (p *provider) ListWebhookLogs(ctx context.Context, pagination model.Pagination, webhookID string) (*model.WebhookLogs, error) {
return nil, nil
}