domain

package
v0.0.0-...-8129d12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(strings []string, str string) bool

func ContainsUser

func ContainsUser(users []*User, user *User) bool

Types

type FamilyMembers

type FamilyMembers struct {
	Father   *User   `json:"user_father,omitempty"`
	Mother   *User   `json:"user_mother,omitempty"`
	Partner  *User   `json:"user_partner,omitempty"`
	Brothers []*User `json:"user_brothers,omitempty"`
	Sisters  []*User `json:"user_sisters,omitempty"`
	Children []*User `json:"user_children,omitempty"`
}

type User

type User struct {
	Id              primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	UserId          string             `bson:"user_id,omitempty" json:"user_id,omitempty"`
	UserName        string             `bson:"user_name" json:"user_name"`
	UserGender      string             `bson:"user_gender" json:"user_gender"`
	UserEmail       string             `bson:"user_email" json:"user_email"`
	UserPhoneNumber string             `bson:"user_phone_number" json:"user_phone_number"`
	UserPassword    string             `bson:"user_password" json:"user_password"`
	UserMother      string             `bson:"user_mother" json:"user_mother"`
	UserFather      string             `bson:"user_father" json:"user_father"`
	UserPartner     string             `bson:"user_partner" json:"user_partner"`
	UserBrothers    []string           `bson:"user_brothers" json:"user_brothers"`
	UserSisters     []string           `bson:"user_sisters" json:"user_sisters"`
	UserChildren    []string           `bson:"user_children" json:"user_children"`
	UserLocation    string             `bson:"user_location" json:"user_location"`
}

type UserRepository

type UserRepository interface {
	GetAllFamilyMembers(string) (*FamilyMembers, *errs.AppError)
	CreateUser(User) (string, *errs.AppError)
	GetUserByUserId(string) (*User, *errs.AppError)
	SearchUser(string, string) ([]*User, *errs.AppError)
	FindRelationship(string, string) ([]*User, *errs.AppError)
}

type UserRepositoryDb

type UserRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewUserRepository

func NewUserRepository(dbClient *mongo.Client) UserRepositoryDb

func (UserRepositoryDb) CreateUser

func (d UserRepositoryDb) CreateUser(u User) (string, *errs.AppError)

func (UserRepositoryDb) FindRelationship

func (d UserRepositoryDb) FindRelationship(start string, end string) ([]*User, *errs.AppError)

func (UserRepositoryDb) GetAllFamilyMembers

func (d UserRepositoryDb) GetAllFamilyMembers(user_id string) (*FamilyMembers, *errs.AppError)

func (UserRepositoryDb) GetUserByUserId

func (d UserRepositoryDb) GetUserByUserId(user_id string) (*User, *errs.AppError)

func (UserRepositoryDb) SearchUser

func (d UserRepositoryDb) SearchUser(key string, value string) ([]*User, *errs.AppError)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL