Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertUserToProtoUser(user User) *proto_build.User
- func GetProtoUser(db *gorm.DB, nickName string, password string) (*proto_build.User, error)
- func GetProtoUserByUserId(db *gorm.DB, userId uint64) (*proto_build.User, error)
- func QueryProtoUser(db *gorm.DB, keyword string, page uint64, pageSize uint64) ([]*proto_build.User, *proto_build.Pager, error)
- func UpdateUserAvatar(db *gorm.DB, userId uint64, avatarUrl string) error
- func UpdateUserPassword(db *gorm.DB, userId uint64, password string) error
- type Service
- func (s *Service) CreateUser(c context.Context, req *proto_build.UserCreateRequest) (*proto_build.UserCreateResponse, error)
- func (s *Service) GetUser(c context.Context, req *proto_build.UserGetRequest) (*proto_build.UserGetResponse, error)
- func (s *Service) Ping(c context.Context, req *proto_build.PingRequest) (*proto_build.PingResponse, error)
- func (s *Service) QueryUser(c context.Context, req *proto_build.UserQueryRequest) (*proto_build.UserQueryResponse, error)
- func (s *Service) UpdateAvatar(c context.Context, req *proto_build.UpdateAvatarRequest) (*proto_build.UpdateAvatarResponse, error)
- func (s *Service) UpdatePassword(c context.Context, req *proto_build.UpdatePasswordRequest) (*proto_build.UpdatePasswordResponse, error)
- func (s *Service) UserLogin(c context.Context, req *proto_build.UserLoginRequest) (*proto_build.UserLoginResponse, error)
- type User
Constants ¶
View Source
const ( GenderMale = "1" GenderFemale = "2" )
Variables ¶
View Source
var GenderDbToProto = map[string]proto_build.Gender{ GenderMale: proto_build.Gender_Male, GenderFemale: proto_build.Gender_Female, }
View Source
var GenderProtoToDb = map[proto_build.Gender]string{ proto_build.Gender_Male: GenderMale, proto_build.Gender_Female: GenderFemale, }
Functions ¶
func ConvertUserToProtoUser ¶
func ConvertUserToProtoUser(user User) *proto_build.User
func GetProtoUser ¶
func GetProtoUserByUserId ¶
func QueryProtoUser ¶
func QueryProtoUser(db *gorm.DB, keyword string, page uint64, pageSize uint64) ([]*proto_build.User, *proto_build.Pager, error)
Types ¶
type Service ¶
type Service struct { service.BasicService proto_build.UnimplementedUserServiceServer }
func NewService ¶
func (*Service) CreateUser ¶
func (s *Service) CreateUser(c context.Context, req *proto_build.UserCreateRequest) (*proto_build.UserCreateResponse, error)
func (*Service) GetUser ¶
func (s *Service) GetUser(c context.Context, req *proto_build.UserGetRequest) (*proto_build.UserGetResponse, error)
func (*Service) Ping ¶
func (s *Service) Ping(c context.Context, req *proto_build.PingRequest) (*proto_build.PingResponse, error)
func (*Service) QueryUser ¶
func (s *Service) QueryUser(c context.Context, req *proto_build.UserQueryRequest) (*proto_build.UserQueryResponse, error)
func (*Service) UpdateAvatar ¶
func (s *Service) UpdateAvatar(c context.Context, req *proto_build.UpdateAvatarRequest) (*proto_build.UpdateAvatarResponse, error)
func (*Service) UpdatePassword ¶
func (s *Service) UpdatePassword(c context.Context, req *proto_build.UpdatePasswordRequest) (*proto_build.UpdatePasswordResponse, error)
func (*Service) UserLogin ¶
func (s *Service) UserLogin(c context.Context, req *proto_build.UserLoginRequest) (*proto_build.UserLoginResponse, error)
Click to show internal directories.
Click to hide internal directories.