Documentation
¶
Index ¶
- type BidService
- func (bs BidService) AcceptBid(userID int, bidID int, projectID int)
- func (bs BidService) GetPrivateProjectBids(userID int, projectID int) []dto.PrivateProjectBidInfo
- func (bs BidService) GetPublicProjectBids(projectID int) []dto.PublicProjectBidInfo
- func (bs BidService) GetTeamBids(userID int, teamID int64) []dto.BidInfo
- func (bs BidService) PutBidOnProject(info dto.BidInfo) int
- func (bs BidService) UpdateBid(info dto.BidInfo)
- type CareerService
- type ChatService
- func (cs *ChatService) CreateUserRoom(userID int, targetUserID int) *dto.RoomInfo
- func (cs *ChatService) GetAllRoom(userID int) []dto.RoomInfo
- func (cs *ChatService) GetRoomMessages(userID, roomID int) []dto.Message
- func (cs *ChatService) SaveMessage(roomID int, senderID int, content string) *dto.Message
- type CommentService
- func (cs CommentService) GetCommentInfo(id int) *dto.CommentWithUserDTO
- func (cs CommentService) GetCommentOfProject(projectID int) *dto.CommentDTO
- func (cs CommentService) GetUserComments(userID int) []dto.CommentWithUserDTO
- func (cs CommentService) GetUserStarAndComment(userID int) (float64, int)
- func (cs CommentService) PutComment(userID, ProjectID int, content string, star int) int
- type EmailService
- func (es *EmailService) SendAcceptedInvitationEmail(inviteeid, inviterid int, teamid int64) error
- func (es *EmailService) SendEmail(to, subject string, body string) error
- func (es *EmailService) SendEmailVerificationEmail(userid int) error
- func (es *EmailService) SendNotification(userID int, subject string, body string) error
- func (es *EmailService) SendTeamInvites(userid int, newMembers []int, teamid int64) error
- type FileService
- func (fs *FileService) DeleteProfilePhoto(userid int)
- func (fs *FileService) DeleteResume(userid int)
- func (fs *FileService) DeleteTeamProfilePhoto(teamid int64)
- func (fs *FileService) GetProfilePhotoURL(userid int, wantHighQual bool) string
- func (fs *FileService) GetResumeURL(userid int) string
- func (fs *FileService) GetTeamProfilePhotoURL(teamid int64, wantHighQual bool) string
- func (fs *FileService) UploadProfilePhoto(data []byte, userid int)
- func (fs *FileService) UploadResume(data []byte, userid int)
- func (fs *FileService) UploadTeamProfilePhoto(data []byte, teamid int64)
- type JWT
- type LabelService
- type PaymentService
- func (paymentService *PaymentService) Deposit(userID int, amount int64, description string)
- func (paymentService *PaymentService) GetUserBalance(userID int) int64
- func (paymentService *PaymentService) GetUserTransactions(userID int, offset, limit int, sortBy, order string) (int, []dto.UserTransactionDTO)
- func (paymentService *PaymentService) ProjectPayment(ctx context.Context, tx transaction.Tx, userID int, amount int64)
- func (paymentService *PaymentService) TransferMoney(ctx context.Context, tx transaction.Tx, fromUserID, toUserID int, amount int64, ...)
- func (paymentService *PaymentService) Withdraw(userID int, amount int64, description string)
- type ProjectService
- func (projectService *ProjectService) CreateProject(userID int, title, description string, label int, durationInt int, price int64, ...) int
- func (projectService *ProjectService) DeleteProject(userID, projectID int)
- func (projectService *ProjectService) EndOfProject(userID, projectID int)
- func (projectService *ProjectService) GetOneManTeamProjects(userID int) []models.ProjectModel
- func (ps *ProjectService) GetParticipatedProjectsForUser(userid int) []models.ProjectModel
- func (projectService *ProjectService) GetProject(projectID int) *models.ProjectModel
- func (projectService *ProjectService) GetProjectCount(userID int) int
- func (projectService *ProjectService) GetTeamProjects(userID int, teamID int64) []models.ProjectModel
- func (projectService *ProjectService) GetUserProjects(userID, targetuserID, offset, limit int) ([]models.ProjectModel, int)
- func (projectService *ProjectService) LandingProps() []dto.ProjectLanding
- func (ps *ProjectService) SearchProjects(req *elasticmodel.QueryAndTagSearchReqDto) []map[string]any
- func (projectService *ProjectService) UpdateProject(projectID, userID int, title, description string, label int, price int64, ...)
- type RoleService
- type SherlockService
- type SmsService
- type TagService
- func (ts *TagService) GetTags() []byte
- func (ts *TagService) GetTagsForUser(userid int) []dto.GetTagDto
- func (ts *TagService) UpdateTagsForCareerOrUser(careerUserid int, newTags []dto.RecieveTagDTO, isForUser bool) []dto.RecieveTagDTO
- func (ts *TagService) UpdateTagsForProject(projectid int, newTags []int)
- type TeamService
- func (ts *TeamService) AcceptInvite(token string, teamid int64)
- func (ts *TeamService) BehindCurtainTeam(ctx context.Context, tx transaction.Tx, userid int)
- func (ts *TeamService) CreateTeam(userid int, teamInfo *dto.TeamCreateDto) int64
- func (ts *TeamService) DeleteTeam(commanderid int, teamid int64)
- func (ts *TeamService) DeleteTeamProfile(commanderid int, teamid int64)
- func (ts *TeamService) GetAllTeamsIDs(userID int) []int64
- func (ts *TeamService) GetInternalTeamInfo(teamid int64) *dto.GetInternalTeamInfo
- func (ts *TeamService) GetMembers(commanderid int, teamid int64) []dto.SendMemberDto
- func (ts *TeamService) GetOneManTeamID(userid int) int64
- func (ts *TeamService) GetTeam(commanderid int, teamid int64) *dto.GetTeamDto
- func (ts *TeamService) GetTeamsForBidding(userid int) *dto.TeamListDto
- func (ts *TeamService) GetTeamsForUser(userid int, active, dontCare int) []dto.GetTeamPreviewDto
- func (ts *TeamService) InviteMembers(userid int, teamid int64, members []int)
- func (ts *TeamService) KickMemebr(commanderid int, poorGuysid []int, teamid int64)
- func (ts *TeamService) LeaveTeam(userid int, teamid int64)
- func (ts *TeamService) SearchTeams(req *elasticmodel.SimpleQuerySearchReqDto) []map[string]any
- func (ts *TeamService) UpdateMemeberRole(commanderid int, info *dto.UpdateMemberRoleDto)
- func (ts *TeamService) UpdatePosition(commanderid int, req *dto.UpdateMemberPositionDto)
- func (ts *TeamService) UpdateTeamInfo(userid int, info *dto.UpdateTeamInfoDto)
- func (ts *TeamService) UpdateTeamProfile(commanderid int, teamid int64, data []byte)
- type UrlTokenService
- func (s *UrlTokenService) DeleteToken(token string) error
- func (s *UrlTokenService) GenerateEmailVerificationToken(userid int) (string, error)
- func (s *UrlTokenService) GenerateTeamInviteToken(userid, senderID int, teamid int64) (string, error)
- func (s *UrlTokenService) GetToken(tokenStr string) (*models.UrlToken, error)
- func (s *UrlTokenService) GetTokenWithPurpose(tokenStr string, expectedPurpose enums.UrlTokenPurpose) (*models.UrlToken, error)
- type UserService
- func (userService *UserService) AuthenticateUser(identifier string, password string) *models.UserModel
- func (us *UserService) CacheUserInfo(phonenumber string, username string, password string, otp string) string
- func (userService *UserService) ChangePassword(user_id int, new_password string)
- func (userService *UserService) ChangePasswordValidate(user_id int, old_password string)
- func (us *UserService) CheckAvailabilityForSignup(phonenumber string, username string) string
- func (us *UserService) CheckFlagForPasswordReset(session string) int
- func (us *UserService) DeleteUser(userid int)
- func (us *UserService) GetUserInfo(targetUserid int, userid int) *dto.UserProfileDTO
- func (us *UserService) Register(phonenumber string, username string, password []byte, session string) int
- func (us *UserService) ResendEmailVerification(userid int)
- func (us *UserService) SearchUsers(req *elasticmodel.QueryAndTagSearchReqDto) []map[string]any
- func (us *UserService) SetForgetPasswordFlag(userID string) string
- func (us *UserService) SetupOTP(phonenumber string, code string) string
- func (us *UserService) UpdateEmail(userid int, email string)
- func (us *UserService) UpdatePhone(phone string, userid string)
- func (us *UserService) UpdatePhoneSendOTP(phone string, userid int, code string) string
- func (us *UserService) UpdateUserData(userid int, userData *dto.UpdateUserDTO)
- func (us *UserService) UpdateUsername(userid int, username string)
- func (us *UserService) ValidateOTP(session string, otp string) (string, string, []byte)
- func (us *UserService) VerifyEmail(userid int, token string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BidService ¶
type BidService struct {
ProjectService services.ProjectService
PaymentService services.PaymentService
TeamService services.TeamService
MailService services.EmailService
TxManager transaction.TxManager
BidRepo repositories.BidRepo
TeamRepo repositories.TeamRepo
}
func NewBidService ¶
func NewBidService( projectservice services.ProjectService, paymentservice services.PaymentService, teamservice services.TeamService, mailService services.EmailService, bidRepo repositories.BidRepo, teamRepo repositories.TeamRepo, txManager transaction.TxManager, ) *BidService
func (BidService) GetPrivateProjectBids ¶
func (bs BidService) GetPrivateProjectBids(userID int, projectID int) []dto.PrivateProjectBidInfo
func (BidService) GetPublicProjectBids ¶
func (bs BidService) GetPublicProjectBids(projectID int) []dto.PublicProjectBidInfo
func (BidService) GetTeamBids ¶
func (bs BidService) GetTeamBids(userID int, teamID int64) []dto.BidInfo
func (BidService) PutBidOnProject ¶
func (bs BidService) PutBidOnProject(info dto.BidInfo) int
func (BidService) UpdateBid ¶
func (bs BidService) UpdateBid(info dto.BidInfo)
type CareerService ¶
type CareerService struct {
TagService services.TagService
CareerRepo repositories.CareerRepo
TagRepo repositories.TagRepo
UserRepo repositories.UserRepo
}
func NewCareerService ¶
func NewCareerService( careerRepo repositories.CareerRepo, tagService services.TagService, tagRepo repositories.TagRepo, userRepo repositories.UserRepo, ) *CareerService
func (*CareerService) GetCareersForUser ¶
func (cs *CareerService) GetCareersForUser(userid int, target int) []dto.SendCareerDTO
func (*CareerService) UpdateCareers ¶
type ChatService ¶
type ChatService struct {
TxManager transaction.TxManager
ChatRepo repositories.ChatRepo
UserService services.UserService
}
func NewChatService ¶
func NewChatService( txManager transaction.TxManager, chatRepo repositories.ChatRepo, userService services.UserService, ) *ChatService
func (*ChatService) CreateUserRoom ¶
func (cs *ChatService) CreateUserRoom(userID int, targetUserID int) *dto.RoomInfo
func (*ChatService) GetAllRoom ¶
func (cs *ChatService) GetAllRoom(userID int) []dto.RoomInfo
func (*ChatService) GetRoomMessages ¶
func (cs *ChatService) GetRoomMessages(userID, roomID int) []dto.Message
func (*ChatService) SaveMessage ¶
type CommentService ¶
type CommentService struct {
CommentRepo repositories.CommentRepo
ProjectRepo repositories.ProjectRepo
ProjectService services.ProjectService
}
func NewCommentService ¶
func NewCommentService( commentRepo repositories.CommentRepo, projectRepo repositories.ProjectRepo, projectService services.ProjectService, ) *CommentService
func (CommentService) GetCommentInfo ¶
func (cs CommentService) GetCommentInfo(id int) *dto.CommentWithUserDTO
func (CommentService) GetCommentOfProject ¶
func (cs CommentService) GetCommentOfProject(projectID int) *dto.CommentDTO
func (CommentService) GetUserComments ¶
func (cs CommentService) GetUserComments(userID int) []dto.CommentWithUserDTO
func (CommentService) GetUserStarAndComment ¶
func (cs CommentService) GetUserStarAndComment(userID int) (float64, int)
func (CommentService) PutComment ¶
func (cs CommentService) PutComment(userID, ProjectID int, content string, star int) int
type EmailService ¶
type EmailService struct {
Env *bootstrap.Env
UserRepo repositories.UserRepo
TeamRepo repositories.TeamRepo
UrlTokenService services.UrlTokenService
}
func NewEmailService ¶
func NewEmailService( userRepo repositories.UserRepo, env *bootstrap.Env, tr repositories.TeamRepo, uts services.UrlTokenService, ) *EmailService
func (*EmailService) SendAcceptedInvitationEmail ¶
func (es *EmailService) SendAcceptedInvitationEmail(inviteeid, inviterid int, teamid int64) error
func (*EmailService) SendEmail ¶
func (es *EmailService) SendEmail(to, subject string, body string) error
func (*EmailService) SendEmailVerificationEmail ¶
func (es *EmailService) SendEmailVerificationEmail(userid int) error
func (*EmailService) SendNotification ¶
func (es *EmailService) SendNotification(userID int, subject string, body string) error
func (*EmailService) SendTeamInvites ¶
func (es *EmailService) SendTeamInvites(userid int, newMembers []int, teamid int64) error
i made a decision to use the email service for sending team invites. pro: 1- it is handled in one thread 2- the code remains the same when i microservice it later \t con:depends on other services highly coupled
type FileService ¶
func NewFileService ¶
func NewFileService(s3storage storage.S3Storage) *FileService
func (*FileService) DeleteProfilePhoto ¶
func (fs *FileService) DeleteProfilePhoto(userid int)
func (*FileService) DeleteResume ¶
func (fs *FileService) DeleteResume(userid int)
func (*FileService) DeleteTeamProfilePhoto ¶
func (fs *FileService) DeleteTeamProfilePhoto(teamid int64)
func (*FileService) GetProfilePhotoURL ¶
func (fs *FileService) GetProfilePhotoURL(userid int, wantHighQual bool) string
func (*FileService) GetResumeURL ¶
func (fs *FileService) GetResumeURL(userid int) string
func (*FileService) GetTeamProfilePhotoURL ¶
func (fs *FileService) GetTeamProfilePhotoURL(teamid int64, wantHighQual bool) string
func (*FileService) UploadProfilePhoto ¶
func (fs *FileService) UploadProfilePhoto(data []byte, userid int)
func (*FileService) UploadResume ¶
func (fs *FileService) UploadResume(data []byte, userid int)
func (*FileService) UploadTeamProfilePhoto ¶
func (fs *FileService) UploadTeamProfilePhoto(data []byte, teamid int64)
type JWT ¶
type JWT struct {
PrivateKey *rsa.PrivateKey
PublicKey *rsa.PublicKey
}
func (*JWT) RefreshToken ¶
type LabelService ¶
type LabelService struct {
LableRepo repositories.LabelRepo
UserRepo repositories.UserRepo
}
func NewLabelService ¶
func NewLabelService( labelRepo repositories.LabelRepo, userRepo repositories.UserRepo, ) *LabelService
func (*LabelService) GetLabelInfo ¶
func (ls *LabelService) GetLabelInfo(labelID int) *models.LabelModel
func (*LabelService) GetLabels ¶
func (ls *LabelService) GetLabels() []byte
type PaymentService ¶
type PaymentService struct {
MailService services.EmailService
PaymentRepo repositories.PaymentRepo
TxManager transaction.TxManager
}
func NewPaymentService ¶
func NewPaymentService( mailService services.EmailService, paymentRepo repositories.PaymentRepo, txManager transaction.TxManager, ) *PaymentService
func (*PaymentService) Deposit ¶
func (paymentService *PaymentService) Deposit(userID int, amount int64, description string)
func (*PaymentService) GetUserBalance ¶
func (paymentService *PaymentService) GetUserBalance(userID int) int64
func (*PaymentService) GetUserTransactions ¶
func (paymentService *PaymentService) GetUserTransactions(userID int, offset, limit int, sortBy, order string) (int, []dto.UserTransactionDTO)
func (*PaymentService) ProjectPayment ¶
func (paymentService *PaymentService) ProjectPayment(ctx context.Context, tx transaction.Tx, userID int, amount int64)
func (*PaymentService) TransferMoney ¶
func (paymentService *PaymentService) TransferMoney(ctx context.Context, tx transaction.Tx, fromUserID, toUserID int, amount int64, description string)
type ProjectService ¶
type ProjectService struct {
ProjectRepo repositories.ProjectRepo
PaymentService services.PaymentService
MailService services.EmailService
Constants *bootstrap.Constants
TxManager transaction.TxManager
TagRepo repositories.TagRepo
BidRepo repositories.BidRepo
TagService services.TagService
TeamService services.TeamService
SearchRepo elastic.SearchRepo
}
func NewProjectService ¶
func NewProjectService( projectRepo repositories.ProjectRepo, paymentService services.PaymentService, mailService services.EmailService, constants *bootstrap.Constants, tagRepo repositories.TagRepo, bidRepo repositories.BidRepo, tagService services.TagService, teamService services.TeamService, txManager transaction.TxManager, searchRepo elastic.SearchRepo, ) *ProjectService
func (*ProjectService) CreateProject ¶
func (*ProjectService) DeleteProject ¶
func (projectService *ProjectService) DeleteProject(userID, projectID int)
func (*ProjectService) EndOfProject ¶
func (projectService *ProjectService) EndOfProject(userID, projectID int)
func (*ProjectService) GetOneManTeamProjects ¶
func (projectService *ProjectService) GetOneManTeamProjects(userID int) []models.ProjectModel
func (*ProjectService) GetParticipatedProjectsForUser ¶
func (ps *ProjectService) GetParticipatedProjectsForUser(userid int) []models.ProjectModel
func (*ProjectService) GetProject ¶
func (projectService *ProjectService) GetProject(projectID int) *models.ProjectModel
func (*ProjectService) GetProjectCount ¶
func (projectService *ProjectService) GetProjectCount(userID int) int
func (*ProjectService) GetTeamProjects ¶
func (projectService *ProjectService) GetTeamProjects(userID int, teamID int64) []models.ProjectModel
func (*ProjectService) GetUserProjects ¶
func (projectService *ProjectService) GetUserProjects(userID, targetuserID, offset, limit int) ([]models.ProjectModel, int)
func (*ProjectService) LandingProps ¶
func (projectService *ProjectService) LandingProps() []dto.ProjectLanding
func (*ProjectService) SearchProjects ¶
func (ps *ProjectService) SearchProjects(req *elasticmodel.QueryAndTagSearchReqDto) []map[string]any
func (*ProjectService) UpdateProject ¶
type RoleService ¶
type RoleService struct {
RoleRepo repositories.RoleRepo
}
func NewRoleService ¶
func NewRoleService() *RoleService
func (*RoleService) GetAllRolesForTeam ¶
func (rs *RoleService) GetAllRolesForTeam() []string
func (*RoleService) GetPermissionsForRole ¶
func (rs *RoleService) GetPermissionsForRole(role string) []string
type SherlockService ¶
type SherlockService struct {
SearchRepo elastic.SearchRepo
FileService services.FileService
}
func NewSherlockService ¶
func NewSherlockService( sr elastic.SearchRepo, fs services.FileService, ) *SherlockService
func (*SherlockService) SearchEverything ¶
func (ss *SherlockService) SearchEverything(req *elasticmodel.SearchRequest) []elasticmodel.InnerHits
type SmsService ¶
func NewSmsService ¶
func NewSmsService(env *bootstrap.Env, constant *bootstrap.Constants) *SmsService
func (*SmsService) GenerateOTP ¶
func (ss *SmsService) GenerateOTP() string
func (*SmsService) SendOTP ¶
func (ss *SmsService) SendOTP(phonenumber string, code string)
type TagService ¶
type TagService struct {
TagRepo repositories.TagRepo
UserRepo repositories.UserRepo
}
func NewTagService ¶
func NewTagService( tagRepo repositories.TagRepo, userRepo repositories.UserRepo, ) *TagService
func (*TagService) GetTags ¶
func (ts *TagService) GetTags() []byte
func (*TagService) GetTagsForUser ¶
func (ts *TagService) GetTagsForUser(userid int) []dto.GetTagDto
func (*TagService) UpdateTagsForCareerOrUser ¶
func (ts *TagService) UpdateTagsForCareerOrUser(careerUserid int, newTags []dto.RecieveTagDTO, isForUser bool) []dto.RecieveTagDTO
func (*TagService) UpdateTagsForProject ¶
func (ts *TagService) UpdateTagsForProject(projectid int, newTags []int)
type TeamService ¶
type TeamService struct {
TeamRepo repositories.TeamRepo
UserRepo repositories.UserRepo
RoleRepo repositories.RoleRepo
TransactionManager transaction.TxManager
FileService services.FileService
SearchRepo elastic.SearchRepo
EmailService services.EmailService
UrlTokenService services.UrlTokenService
}
func NewTeamService ¶
func NewTeamService( teamRepo repositories.TeamRepo, userRepo repositories.UserRepo, roleRepo repositories.RoleRepo, tManager transaction.TxManager, fileService services.FileService, sp elastic.SearchRepo, emailService services.EmailService, uts services.UrlTokenService, ) *TeamService
func (*TeamService) AcceptInvite ¶
func (ts *TeamService) AcceptInvite(token string, teamid int64)
func (*TeamService) BehindCurtainTeam ¶
func (ts *TeamService) BehindCurtainTeam(ctx context.Context, tx transaction.Tx, userid int)
func (*TeamService) CreateTeam ¶
func (ts *TeamService) CreateTeam(userid int, teamInfo *dto.TeamCreateDto) int64
func (*TeamService) DeleteTeam ¶
func (ts *TeamService) DeleteTeam(commanderid int, teamid int64)
func (*TeamService) DeleteTeamProfile ¶
func (ts *TeamService) DeleteTeamProfile(commanderid int, teamid int64)
func (*TeamService) GetAllTeamsIDs ¶
func (ts *TeamService) GetAllTeamsIDs(userID int) []int64
func (*TeamService) GetInternalTeamInfo ¶
func (ts *TeamService) GetInternalTeamInfo(teamid int64) *dto.GetInternalTeamInfo
func (*TeamService) GetMembers ¶
func (ts *TeamService) GetMembers(commanderid int, teamid int64) []dto.SendMemberDto
func (*TeamService) GetOneManTeamID ¶
func (ts *TeamService) GetOneManTeamID(userid int) int64
func (*TeamService) GetTeam ¶
func (ts *TeamService) GetTeam(commanderid int, teamid int64) *dto.GetTeamDto
func (*TeamService) GetTeamsForBidding ¶
func (ts *TeamService) GetTeamsForBidding(userid int) *dto.TeamListDto
func (*TeamService) GetTeamsForUser ¶
func (ts *TeamService) GetTeamsForUser(userid int, active, dontCare int) []dto.GetTeamPreviewDto
func (*TeamService) InviteMembers ¶
func (ts *TeamService) InviteMembers(userid int, teamid int64, members []int)
TODO: email? some sort of request must be sent and then when it is accepted, the member gets added ! this version is naive
func (*TeamService) KickMemebr ¶
func (ts *TeamService) KickMemebr(commanderid int, poorGuysid []int, teamid int64)
func (*TeamService) LeaveTeam ¶
func (ts *TeamService) LeaveTeam(userid int, teamid int64)
func (*TeamService) SearchTeams ¶
func (ts *TeamService) SearchTeams(req *elasticmodel.SimpleQuerySearchReqDto) []map[string]any
func (*TeamService) UpdateMemeberRole ¶
func (ts *TeamService) UpdateMemeberRole(commanderid int, info *dto.UpdateMemberRoleDto)
func (*TeamService) UpdatePosition ¶
func (ts *TeamService) UpdatePosition(commanderid int, req *dto.UpdateMemberPositionDto)
func (*TeamService) UpdateTeamInfo ¶
func (ts *TeamService) UpdateTeamInfo(userid int, info *dto.UpdateTeamInfoDto)
func (*TeamService) UpdateTeamProfile ¶
func (ts *TeamService) UpdateTeamProfile(commanderid int, teamid int64, data []byte)
type UrlTokenService ¶
type UrlTokenService struct {
Constants *bootstrap.Constants
UrlTokenRepo repositories.UrlTokenRepo
}
func NewUrlTokenService ¶
func NewUrlTokenService(r repositories.UrlTokenRepo, c *bootstrap.Constants) *UrlTokenService
func (*UrlTokenService) DeleteToken ¶
func (s *UrlTokenService) DeleteToken(token string) error
func (*UrlTokenService) GenerateEmailVerificationToken ¶
func (s *UrlTokenService) GenerateEmailVerificationToken(userid int) (string, error)
func (*UrlTokenService) GenerateTeamInviteToken ¶
func (s *UrlTokenService) GenerateTeamInviteToken(userid, senderID int, teamid int64) (string, error)
func (*UrlTokenService) GetToken ¶
func (s *UrlTokenService) GetToken(tokenStr string) (*models.UrlToken, error)
func (*UrlTokenService) GetTokenWithPurpose ¶
func (s *UrlTokenService) GetTokenWithPurpose(tokenStr string, expectedPurpose enums.UrlTokenPurpose) (*models.UrlToken, error)
type UserService ¶
type UserService struct {
UserRepo repositories.UserRepo
CacheRepo redis.UserCache
TxManager transaction.TxManager
Constants *bootstrap.Constants
Env *bootstrap.Env
FileService services.FileService
TeamService services.TeamService
CommentService services.CommentService
SecretSauce *pkg.SecretSauce
SearchRepo elastic.SearchRepo
EmailService services.EmailService
UrlTokenService services.UrlTokenService
}
func NewUserService ¶
func NewUserService( userRepo repositories.UserRepo, cacheRepo redis.UserCache, txManager transaction.TxManager, constants *bootstrap.Constants, Env *bootstrap.Env, fileService services.FileService, teamService services.TeamService, commentService services.CommentService, secretSauce *pkg.SecretSauce, searchRepo elastic.SearchRepo, emailService services.EmailService, urlTokenService services.UrlTokenService, ) *UserService
func (*UserService) AuthenticateUser ¶
func (userService *UserService) AuthenticateUser(identifier string, password string) *models.UserModel
func (*UserService) CacheUserInfo ¶
func (us *UserService) CacheUserInfo(phonenumber string, username string, password string, otp string) string
caches the data until otp is expired or entered.
func (*UserService) ChangePassword ¶
func (userService *UserService) ChangePassword(user_id int, new_password string)
func (*UserService) ChangePasswordValidate ¶
func (userService *UserService) ChangePasswordValidate(user_id int, old_password string)
func (*UserService) CheckAvailabilityForSignup ¶
func (us *UserService) CheckAvailabilityForSignup(phonenumber string, username string) string
signup stage. checks if username or phonenumber is already taken.
func (*UserService) CheckFlagForPasswordReset ¶
func (us *UserService) CheckFlagForPasswordReset(session string) int
func (*UserService) DeleteUser ¶
func (us *UserService) DeleteUser(userid int)
func (*UserService) GetUserInfo ¶
func (us *UserService) GetUserInfo(targetUserid int, userid int) *dto.UserProfileDTO
func (*UserService) Register ¶
func (us *UserService) Register(phonenumber string, username string, password []byte, session string) int
last stage of signup
func (*UserService) ResendEmailVerification ¶
func (us *UserService) ResendEmailVerification(userid int)
func (*UserService) SearchUsers ¶
func (us *UserService) SearchUsers(req *elasticmodel.QueryAndTagSearchReqDto) []map[string]any
func (*UserService) SetForgetPasswordFlag ¶
func (us *UserService) SetForgetPasswordFlag(userID string) string
func (*UserService) SetupOTP ¶
func (us *UserService) SetupOTP(phonenumber string, code string) string
for forget password: creates uuid and otp and caches otp
func (*UserService) UpdateEmail ¶
func (us *UserService) UpdateEmail(userid int, email string)
func (*UserService) UpdatePhone ¶
func (us *UserService) UpdatePhone(phone string, userid string)
func (*UserService) UpdatePhoneSendOTP ¶
func (us *UserService) UpdatePhoneSendOTP(phone string, userid int, code string) string
func (*UserService) UpdateUserData ¶
func (us *UserService) UpdateUserData(userid int, userData *dto.UpdateUserDTO)
func (*UserService) UpdateUsername ¶
func (us *UserService) UpdateUsername(userid int, username string)
func (*UserService) ValidateOTP ¶
checks the code with cache and returns the data. returns phonenumber, username, password
func (*UserService) VerifyEmail ¶
func (us *UserService) VerifyEmail(userid int, token string)
Source Files
¶
- bid_service_impl.go
- career_service_impl.go
- chat_service_impl.go
- comment_service_impl.go
- email_service_impl.go
- file_service_impl.go
- jwt_service_impl.go
- label_service_impl.go
- payment_service_impl.go
- project_service_impl.go
- role_service_impl.go
- sherlock_service_impl.go
- sms_service_impl.go
- tag_service_impl.go
- team_service_impl.go
- urltoken_service_impl.go
- user_service_impl.go
Click to show internal directories.
Click to hide internal directories.