app

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegService

func NewRegService(
	regRepo repository.UserReg,
) *regService

func NewWhiteListService

func NewWhiteListService(
	whiteRepo repository.WhiteList,
) *whiteListService

Types

type BindEmailCmd

type BindEmailCmd struct {
	User     domain.Account
	Email    domain.Email
	PassCode string
	PassWord domain.Password
}

type CreatePlatformAccountCmd

type CreatePlatformAccountCmd struct {
	Email    domain.Email
	Account  domain.Account
	Password domain.Password
}

type EmailService

type EmailService interface {
	SendBindEmail(*SendBindEmailCmd) (string, error)
	VerifyBindEmail(*BindEmailCmd) (string, error)
}

func NewEmailService

func NewEmailService(
	auth authing.User,
	login login.Login,
	us UserService,
) EmailService

type FollowDTO

type FollowDTO struct {
	Account    string `json:"account"`
	AvatarId   string `json:"avatar_id"`
	Bio        string `json:"bio"`
	IsFollower bool   `json:"is_follower"`
}

type FollowsDTO

type FollowsDTO struct {
	Total int         `json:"total"`
	Data  []FollowDTO `json:"data"`
}

type FollowsListCmd

type FollowsListCmd struct {
	User domain.Account

	repository.FollowFindOption
}

type PlatformInfoDTO

type PlatformInfoDTO struct {
	PlatformUser  domain.PlatformUser
	PlatformToken domain.PlatformToken
}

type RefreshTokenCmd

type RefreshTokenCmd struct {
	Account     domain.Account
	Id          string
	NamespaceId string
}

type RegService

type RegService interface {
	// register
	UpsertUserRegInfo(*UserRegisterInfoCmd) error
	GetUserRegInfo(domain.Account) (UserRegisterInfoDTO, error)
}

type SendBindEmailCmd

type SendBindEmailCmd struct {
	User  domain.Account
	Email domain.Email
	Capt  string
}

type UpdatePlateformInfoCmd

type UpdatePlateformInfoCmd struct {
	PlatformInfoDTO

	User  domain.Account
	Email domain.Email
}

type UpdatePlateformTokenCmd

type UpdatePlateformTokenCmd struct {
	User          domain.Account
	PlatformToken domain.PlatformToken
}

type UpdateUserBasicInfoCmd

type UpdateUserBasicInfoCmd struct {
	Bio      domain.Bio
	Email    domain.Email
	AvatarId domain.AvatarId
	// contains filtered or unexported fields
}

type UserCreateCmd

type UserCreateCmd struct {
	Email    domain.Email
	Account  domain.Account
	Password domain.Password

	Bio      domain.Bio
	AvatarId domain.AvatarId
}

user

func (*UserCreateCmd) Validate

func (cmd *UserCreateCmd) Validate() error

type UserDTO

type UserDTO struct {
	Id      string `json:"id"`
	Email   string `json:"email"`
	Account string `json:"account"`

	Bio      string `json:"bio"`
	AvatarId string `json:"avatar_id"`

	FollowerCount  int `json:"follower_count"`
	FollowingCount int `json:"following_count"`

	CourseAgreement   string `json:"course_agreement"`
	FinetuneAgreement string `json:"finetune_agreement"`
	UserAgreement     string `json:"user_agreement"`

	Platform struct {
		UserId      string
		Token       string
		NamespaceId string
		CreateAt    int64
	} `json:"-"`
}

type UserInfoDTO

type UserInfoDTO struct {
	Points int `json:"points"`

	UserDTO
}

type UserRegisterInfoCmd

type UserRegisterInfoCmd domain.UserRegInfo

register

func (*UserRegisterInfoCmd) Validate

func (cmd *UserRegisterInfoCmd) Validate() error

type UserRegisterInfoDTO

type UserRegisterInfoDTO domain.UserRegInfo

type UserService

type UserService interface {
	// user
	Create(*UserCreateCmd) (UserDTO, error)
	CreatePlatformAccount(*CreatePlatformAccountCmd) (PlatformInfoDTO, error)
	UpdatePlateformInfo(*UpdatePlateformInfoCmd) error
	UpdatePlateformToken(*UpdatePlateformTokenCmd) error
	NewPlatformAccountWithUpdate(*CreatePlatformAccountCmd) error
	UpdateBasicInfo(domain.Account, UpdateUserBasicInfoCmd) error
	UpdateAgreement(u domain.Account, t app.AgreementType) error

	UserInfo(domain.Account) (UserInfoDTO, error)
	GetByAccount(domain.Account) (UserDTO, error)
	GetByFollower(owner, follower domain.Account) (UserDTO, bool, error)

	AddFollowing(*domain.FollowerInfo) error
	RemoveFollowing(*domain.FollowerInfo) error
	ListFollowing(*FollowsListCmd) (FollowsDTO, error)

	AddFollower(*domain.FollowerInfo) error
	RemoveFollower(*domain.FollowerInfo) error
	ListFollower(*FollowsListCmd) (FollowsDTO, error)

	RefreshGitlabToken(*RefreshTokenCmd) error
}

func NewUserService

func NewUserService(
	repo repository.User,
	ps platform.User,
	sender message.MessageProducer,
	points pointsPort.Points,
	encryption utils.SymmetricEncryption,
) UserService

ps: platform user service

type UserWhiteListCmd

type UserWhiteListCmd domain.WhiteListInfo

type WhiteListService

type WhiteListService interface {
	// register
	CheckWhiteList(*UserWhiteListCmd) (*WhitelistDTO, error)
	CheckCloudWhitelist(domain.Account) (bool, bool, error)
}

type WhitelistDTO

type WhitelistDTO struct {
	Allowed bool `json:"allowed"`
}

Jump to

Keyboard shortcuts

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