service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	// AppKey    string `form:"app_key" binding:"required"` // 原始post方式
	AppKey    string `json:"app_key" binding:"required"` // json格式
	AppSecret string `json:"app_secret" binding:"required"`
}

type Platform

type Platform struct {
	PlatformId       int    `json:"platform_id"`
	PlatformName     string `json:"name"`
	PlatformAbbr     string `json:"abbr"`
	PlatformType     string `json:"type"`
	PlatformDesc     string `json:"description"`
	PlatformDomain   string `json:"domain"`
	PlatformImgUrl   string `json:"img_url"`
	PlatformLoginUrl string `json:"login_url"`
}

type Service

type Service struct {
	Ctx context.Context
	Db  *gorm.DB
}

func NewService

func NewService(ctx context.Context) *Service

func (*Service) CheckAuth

func (svc *Service) CheckAuth(param *AuthRequest) error

func (*Service) CreatePlatform

func (srv *Service) CreatePlatform(params Platform) (*Platform, error)

func (*Service) CreateUser

func (srv *Service) CreateUser(params *UserCreateRequest) error

func (*Service) CreateUserAccount

func (srv *Service) CreateUserAccount(params UserAccountCreateRequest) error

func (*Service) DeletePlatform

func (srv *Service) DeletePlatform(params Platform) error

func (*Service) DeleteUser

func (srv *Service) DeleteUser(params *UserDeleteRequest) error

func (*Service) DeleteUserAccount

func (srv *Service) DeleteUserAccount(params UserAccountGetRequest) error

func (*Service) DeleteUserAccountList

func (srv *Service) DeleteUserAccountList(params UserAccountGetRequest) error

func (*Service) GetAllUserAccount

func (srv *Service) GetAllUserAccount(pager *page.Pager) ([]UserAccount, error)

func (*Service) GetPlatform

func (srv *Service) GetPlatform(params Platform) (*Platform, error)

func (*Service) GetPlatformList

func (srv *Service) GetPlatformList(params Platform, pager *page.Pager) ([]Platform, error)

func (*Service) GetUser

func (srv *Service) GetUser(params *UserGetRequest) (*User, error)

func (*Service) GetUserAccount

func (srv *Service) GetUserAccount(params UserAccountGetRequest) (*UserAccount, error)

func (*Service) GetUserAccountList

func (srv *Service) GetUserAccountList(params UserAccountGetRequest, pager *page.Pager) ([]UserAccount, error)

func (*Service) GetUserList

func (srv *Service) GetUserList(params *UserGetRequest, pager *page.Pager) ([]User, error)

func (*Service) IsExistsUserEmail

func (srv *Service) IsExistsUserEmail(param *UserEmailExistsRequest) (bool, error)

func (*Service) IsExistsUserName

func (srv *Service) IsExistsUserName(param *UserNameExistsRequest) (bool, error)

func (*Service) IsExistsUserPhone

func (srv *Service) IsExistsUserPhone(uper *UserPhoneExistsRequest) (bool, error)

func (*Service) UpdatePlatform

func (srv *Service) UpdatePlatform(params Platform) (Platform, error)

func (*Service) UpdateUser

func (srv *Service) UpdateUser(params *UserUpdateRequest) error

func (*Service) UpdateUserAccount

func (srv *Service) UpdateUserAccount(params UserAccountCreateRequest) error

func (*Service) UserAuth

func (srv *Service) UserAuth(param *UserAuthRequest) (token string, err *errcode.Error)

func (*Service) UserAuthByConfirmEmail

func (srv *Service) UserAuthByConfirmEmail(uma UserEmailAuth) (bool, error)

func (*Service) UserAuthByEmailCode

func (srv *Service) UserAuthByEmailCode(uma UserEmailAuth) (bool, error)

func (*Service) UserAuthByPhone

func (srv *Service) UserAuthByPhone(upa UserPhoneAuth) (bool, error)

func (*Service) UserAuthByWechat

func (srv *Service) UserAuthByWechat(upa UserPhoneAuth) (bool, error)

type User

type User struct {
	UserId      int    `json:"user_id"`
	UserName    string `json:"user_name"`
	PhoneNumber string `json:"phone_number"`
	Email       string `json:"email"`
	Sex         int    `json:"sex"`
	Description string `json:"description"`
}

type UserAccount

type UserAccount struct {
	UserId           int    `json:"user_id"`
	PlatformId       int    `json:"platform_id"`
	Password         string `json:"password"`
	PlatformName     string `json:"name"`
	PlatformAbbr     string `json:"abbr"`
	PlatformType     string `json:"type"`
	PlatformDesc     string `json:"description"`
	PlatformDomain   string `json:"domain"`
	PlatformImgUrl   string `json:"img_url"`
	PlatformLoginUrl string `json:"login_url"`
}

type UserAccountCreateRequest

type UserAccountCreateRequest struct {
	UserId     int    `json:"user_id"`
	PlatformId int    `json:"platform_id"`
	Password   string `json:"password"`
}

type UserAccountGetRequest

type UserAccountGetRequest struct {
	UserId     int
	PlatformId int
}

type UserAuthRequest

type UserAuthRequest struct {
	UserId   int    `json:"user_id" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type UserCreateRequest

type UserCreateRequest struct {
	UserName    string `json:"user_name" binding:"required"`
	Password    string `json:"password" binding:"required"`
	PhoneNumber string `json:"phone_number" binding:"required"`
	Email       string `json:"email"`
	Sex         int    `json:"sex"`
	Description string `json:"description"`
}

type UserDeleteRequest

type UserDeleteRequest struct {
	UserId int
}

type UserEmailAuth

type UserEmailAuth struct {
	Suffix string `json:"suffix" binding:"required"`
}

type UserEmailCodeAuth

type UserEmailCodeAuth struct {
	Code string `json:"suffix" binding:"required"`
}

type UserEmailExistsRequest

type UserEmailExistsRequest struct {
	Email string `json:"email" binding:"required"`
}

type UserGetRequest

type UserGetRequest struct {
	UserId int
}

type UserNameExistsRequest

type UserNameExistsRequest struct {
	UserName string `json:"user_name" binding:"required"`
}

type UserPhoneAuth

type UserPhoneAuth struct {
	PhoneNumber string `json:"phone_number" binding:"required"`
	Code        string `json:"suffix" binding:"required"`
}

type UserPhoneExistsRequest

type UserPhoneExistsRequest struct {
	PhoneNumber string `json:"phone_number" binding:"required"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	UserId      int    `json:"user_id"`
	UserName    string `json:"user_name"`
	PhoneNumber string `json:"phone_number"`
	Email       string `json:"email"`
	Sex         int    `json:"sex"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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