46 lines
978 B
Go
46 lines
978 B
Go
package repository
|
|
|
|
import (
|
|
"amocrm/internal/models"
|
|
"context"
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
func (r *Repository) UpdateListUsers(ctx context.Context) error {
|
|
//TODO:IMPLEMENT ME
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (r *Repository) GettingUserFromCash(ctx context.Context) (*models.UserListResp, error) {
|
|
//TODO:IMPLEMENT ME
|
|
|
|
return &models.UserListResp{}, nil
|
|
}
|
|
|
|
func (r *Repository) SoftDeleteAccount(ctx context.Context) error {
|
|
//TODO:IMPLEMENT ME
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (r *Repository) GetCurrentAccount(ctx context.Context) (*models.GetCurrentAccountResp, error) {
|
|
//TODO:IMPLEMENT ME
|
|
|
|
return &models.GetCurrentAccountResp{}, nil
|
|
}
|
|
|
|
func (r *Repository) CreateAccount(ctx context.Context, accountID string) error {
|
|
userData := models.User{}
|
|
userData.ObjID = primitive.NewObjectID()
|
|
userData.Accountid = accountID
|
|
_, err := r.mdbUser.InsertOne(ctx, userData)
|
|
if err != nil {
|
|
r.logger.Error("error createAccount in mongodb")
|
|
return err
|
|
}
|
|
return nil
|
|
}
|