Documentation ¶
Index ¶
- type Account
- type AccountService
- func (s *AccountService) ChangePictureAccount(id, userId int, filepath string) (models.Account, error)
- func (s *AccountService) CreateAccount(userId int, name string, balance float64) (int, error)
- func (s *AccountService) DeleteAccount(id, userId int) error
- func (s *AccountService) ExistsAccount(id int) (models.Account, error)
- func (s *AccountService) GetAccount(id, userId int) (models.Account, error)
- func (s *AccountService) GetAllAccounts(userId int) ([]models.Account, error)
- func (s *AccountService) RestoreAccount(id, userId int) error
- func (s *AccountService) UpdateAccount(id, userId int, name string, balance float64) (models.Account, error)
- func (s *AccountService) UploadAccountPicture(id, userId int, filepath string) (models.Account, error)
- type AuthService
- type Authorization
- type Category
- type CategoryService
- func (c *CategoryService) ChangePictureCategory(id int, filepath string) (models.Category, error)
- func (c *CategoryService) CreateCategory(name, description string, price float64) (models.Category, error)
- func (c *CategoryService) DeleteCategory(id int) error
- func (c *CategoryService) GetCategories() ([]models.Category, error)
- func (c *CategoryService) GetCategory(id int) (models.Category, error)
- func (c *CategoryService) RestoreCategory(id int) error
- func (c *CategoryService) UpdateCategory(id int, name, description string, price float64) (models.Category, error)
- func (c *CategoryService) UploadPictureCategory(id int, filepath string) (models.Category, error)
- type Report
- type ReportService
- func (s *ReportService) GetCSVReport(userFrom, userTo models.User, accountFrom, accountTo models.Account, ...) (*os.File, error)
- func (s *ReportService) GetExcelReport(userFrom, userTo models.User, accountFrom, accountTo models.Account, ...) (*excelize.File, error)
- func (s *ReportService) GetReport(FromID, ToID int, ToType string, Limit, Page int, Type string, ...) ([]models.Transaction, error)
- type Service
- type Transaction
- type TransactionService
- func (t *TransactionService) CreateTransaction(tr models.Transaction) (models.Transaction, error)
- func (t *TransactionService) GetTransaction(id, userId int) (models.Transaction, error)
- func (t *TransactionService) GetTransactions(userId int) ([]models.Transaction, error)
- func (t *TransactionService) UpdateTransaction(id, userId int, comment string) (models.Transaction, error)
- type User
- type UserService
- func (u *UserService) DeleteUserById(id int) error
- func (u *UserService) GetUserById(id int) (models.User, error)
- func (u *UserService) RestoreUserById(id int) error
- func (u *UserService) UpdatePictureUser(id int, filepath string) (models.User, error)
- func (u *UserService) UpdateUser(id int, firstname, lastname, email, username, password string) (models.User, error)
- func (u *UserService) UploadUserPicture(id int, filepath string) (models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account interface { ExistsAccount(id int) (models.Account, error) GetAccount(id, userId int) (models.Account, error) GetAllAccounts(userId int) ([]models.Account, error) CreateAccount(userId int, name string, balance float64) (int, error) UpdateAccount(id, userId int, name string, balance float64) (models.Account, error) DeleteAccount(id, userId int) error RestoreAccount(id, userId int) error ChangePictureAccount(id, userId int, filepath string) (models.Account, error) UploadAccountPicture(id, userId int, filepath string) (models.Account, error) }
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
func NewAccountService ¶
func NewAccountService(repo repository.Account) *AccountService
func (*AccountService) ChangePictureAccount ¶
func (*AccountService) CreateAccount ¶
func (*AccountService) DeleteAccount ¶
func (s *AccountService) DeleteAccount(id, userId int) error
func (*AccountService) ExistsAccount ¶
func (s *AccountService) ExistsAccount(id int) (models.Account, error)
func (*AccountService) GetAccount ¶
func (s *AccountService) GetAccount(id, userId int) (models.Account, error)
func (*AccountService) GetAllAccounts ¶
func (s *AccountService) GetAllAccounts(userId int) ([]models.Account, error)
func (*AccountService) RestoreAccount ¶
func (s *AccountService) RestoreAccount(id, userId int) error
func (*AccountService) UpdateAccount ¶
func (*AccountService) UploadAccountPicture ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(repo repository.Authorization) *AuthService
func (*AuthService) CreateUser ¶
func (s *AuthService) CreateUser(firstname, lastname, username, email, password string) (int, error)
func (*AuthService) GenerateToken ¶
func (s *AuthService) GenerateToken(email, username, password string) (string, error)
func (*AuthService) ParseToken ¶
func (s *AuthService) ParseToken(token string) (int, error)
type Authorization ¶
type Category ¶
type Category interface { CreateCategory(name, description string, price float64) (models.Category, error) GetCategories() ([]models.Category, error) GetCategory(id int) (models.Category, error) UpdateCategory(id int, name, description string, price float64) (models.Category, error) UploadPictureCategory(id int, filepath string) (models.Category, error) ChangePictureCategory(id int, filepath string) (models.Category, error) DeleteCategory(id int) error RestoreCategory(id int) error }
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func NewCategoryService ¶
func NewCategoryService(repo repository.Category) *CategoryService
func (*CategoryService) ChangePictureCategory ¶
func (*CategoryService) CreateCategory ¶
func (*CategoryService) DeleteCategory ¶
func (c *CategoryService) DeleteCategory(id int) error
func (*CategoryService) GetCategories ¶
func (c *CategoryService) GetCategories() ([]models.Category, error)
func (*CategoryService) GetCategory ¶
func (c *CategoryService) GetCategory(id int) (models.Category, error)
func (*CategoryService) RestoreCategory ¶
func (c *CategoryService) RestoreCategory(id int) error
func (*CategoryService) UpdateCategory ¶
func (*CategoryService) UploadPictureCategory ¶
type Report ¶
type Report interface { GetCSVReport( userFrom, userTo models.User, accountFrom, accountTo models.Account, tr []models.Transaction, ) (*os.File, error) GetExcelReport( userFrom, userTo models.User, accountFrom, accountTo models.Account, tr []models.Transaction, ) (*excelize.File, error) GetReport( FromID, ToID int, ToType string, Limit, Page int, Type string, From, To time.Time, ) ([]models.Transaction, error) }
type ReportService ¶
type ReportService struct {
// contains filtered or unexported fields
}
func NewReportService ¶
func NewReportService(repo repository.Report) *ReportService
func (*ReportService) GetCSVReport ¶
func (s *ReportService) GetCSVReport( userFrom, userTo models.User, accountFrom, accountTo models.Account, tr []models.Transaction, ) (*os.File, error)
func (*ReportService) GetExcelReport ¶
func (s *ReportService) GetExcelReport( userFrom, userTo models.User, accountFrom, accountTo models.Account, tr []models.Transaction, ) (*excelize.File, error)
type Service ¶
type Service struct { Authorization User Account Category Transaction Report }
func NewService ¶
func NewService(repository *repository.Repository) *Service
type Transaction ¶
type Transaction interface { CreateTransaction(tr models.Transaction) (models.Transaction, error) GetTransaction(id, userId int) (models.Transaction, error) UpdateTransaction(id, userId int, comment string) (models.Transaction, error) GetTransactions(userId int) ([]models.Transaction, error) }
type TransactionService ¶
type TransactionService struct {
// contains filtered or unexported fields
}
func NewTransactionService ¶
func NewTransactionService(repo repository.Transaction) *TransactionService
func (*TransactionService) CreateTransaction ¶
func (t *TransactionService) CreateTransaction(tr models.Transaction) (models.Transaction, error)
func (*TransactionService) GetTransaction ¶
func (t *TransactionService) GetTransaction(id, userId int) (models.Transaction, error)
func (*TransactionService) GetTransactions ¶
func (t *TransactionService) GetTransactions(userId int) ([]models.Transaction, error)
func (*TransactionService) UpdateTransaction ¶
func (t *TransactionService) UpdateTransaction(id, userId int, comment string) (models.Transaction, error)
type User ¶
type User interface { GetUserById(id int) (models.User, error) UpdateUser(id int, firstname, lastname, email, username, password string) (models.User, error) DeleteUserById(id int) error RestoreUserById(id int) error UpdatePictureUser(id int, filepath string) (models.User, error) UploadUserPicture(id int, filepath string) (models.User, error) }
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(repo repository.User) *UserService
func (*UserService) DeleteUserById ¶
func (u *UserService) DeleteUserById(id int) error
func (*UserService) GetUserById ¶
func (u *UserService) GetUserById(id int) (models.User, error)
func (*UserService) RestoreUserById ¶
func (u *UserService) RestoreUserById(id int) error
func (*UserService) UpdatePictureUser ¶
func (*UserService) UpdateUser ¶
func (*UserService) UploadUserPicture ¶
Click to show internal directories.
Click to hide internal directories.