Last active
July 13, 2020 06:03
-
-
Save anatoliyfedorenko/a69412565a36af2b72e7e13297001f76 to your computer and use it in GitHub Desktop.
Interface Refactoring
This file contains hidden or 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
// IStorage represents database methods | |
type IStorage interface { | |
// User() User | |
// Profile() Profile | |
// Agreement() Agreement | |
// AgreementChanges() AgreementChange | |
// Milestone() Milestone | |
// Contact() Contact | |
// Notifications() Notification | |
// Payout() Payout | |
// WebhookEvents() WebhookEvent | |
// Referrals() Referral | |
// VerificationCodes() VerificationCode | |
// Feedback() Feedback | |
// PlatformTransfe() PlatformTransfer | |
// this is just a temporary change not to break all the functionality. Will reimplment this | |
// for the version mentioned above as a next step with just a small chucks under improvements | |
User | |
Profile | |
Agreement | |
AgreementChange | |
Milestone | |
Contact | |
Notification | |
Payout | |
WebhookEvent | |
Referral | |
VerificationCode | |
Feedback | |
PlatformTransfer | |
} |
This file contains hidden or 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
// Notification inferface contains methods for notifications manipulation | |
type Notification interface { | |
CreateNotification(ctx context.Context, n *model.Notification) (model.Notification, error) | |
GetNotification(ctx context.Context, id int64) (model.Notification, error) | |
GetUnreadNotificationsCount(ctx context.Context, receiverID int64) (int, error) | |
ListNotification(ctx context.Context, userID int64) ([]model.Notification, error) | |
SetNotificationAsRead(ctx context.Context, id int64) error | |
ResetUnreadNotifications(ctx context.Context, receiverID int64) error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment