first commit
This commit is contained in:
68
apps/user/client/auth/auth.go
Normal file
68
apps/user/client/auth/auth.go
Normal file
@@ -0,0 +1,68 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: user.proto
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/user"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
EmptyResponse = user.EmptyResponse
|
||||
EnterpriseAuthReq = user.EnterpriseAuthReq
|
||||
EnterpriseItem = user.EnterpriseItem
|
||||
GetEnterpriseAuthStatusReq = user.GetEnterpriseAuthStatusReq
|
||||
GetEnterpriseAuthStatusResp = user.GetEnterpriseAuthStatusResp
|
||||
GetPendingEnterpriseReq = user.GetPendingEnterpriseReq
|
||||
GetPendingEnterpriseResp = user.GetPendingEnterpriseResp
|
||||
LoginReq = user.LoginReq
|
||||
LoginResp = user.LoginResp
|
||||
PhoneLoginReq = user.PhoneLoginReq
|
||||
RegisterReq = user.RegisterReq
|
||||
ReviewEnterpriseReq = user.ReviewEnterpriseReq
|
||||
UserInfoReq = user.UserInfoReq
|
||||
UserInfoResp = user.UserInfoResp
|
||||
|
||||
Auth interface {
|
||||
// 注册接口
|
||||
RegisterUser(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*EmptyResponse, error)
|
||||
// 登录接口
|
||||
LoginUser(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error)
|
||||
// 手机登录接口
|
||||
PhoneLoginUser(ctx context.Context, in *PhoneLoginReq, opts ...grpc.CallOption) (*LoginResp, error)
|
||||
}
|
||||
|
||||
defaultAuth struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewAuth(cli zrpc.Client) Auth {
|
||||
return &defaultAuth{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// 注册接口
|
||||
func (m *defaultAuth) RegisterUser(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*EmptyResponse, error) {
|
||||
client := user.NewAuthClient(m.cli.Conn())
|
||||
return client.RegisterUser(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 登录接口
|
||||
func (m *defaultAuth) LoginUser(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) {
|
||||
client := user.NewAuthClient(m.cli.Conn())
|
||||
return client.LoginUser(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 手机登录接口
|
||||
func (m *defaultAuth) PhoneLoginUser(ctx context.Context, in *PhoneLoginReq, opts ...grpc.CallOption) (*LoginResp, error) {
|
||||
client := user.NewAuthClient(m.cli.Conn())
|
||||
return client.PhoneLoginUser(ctx, in, opts...)
|
||||
}
|
||||
68
apps/user/client/enterprise/enterprise.go
Normal file
68
apps/user/client/enterprise/enterprise.go
Normal file
@@ -0,0 +1,68 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: user.proto
|
||||
|
||||
package enterprise
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/user"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
EmptyResponse = user.EmptyResponse
|
||||
EnterpriseAuthReq = user.EnterpriseAuthReq
|
||||
EnterpriseItem = user.EnterpriseItem
|
||||
GetEnterpriseAuthStatusReq = user.GetEnterpriseAuthStatusReq
|
||||
GetEnterpriseAuthStatusResp = user.GetEnterpriseAuthStatusResp
|
||||
GetPendingEnterpriseReq = user.GetPendingEnterpriseReq
|
||||
GetPendingEnterpriseResp = user.GetPendingEnterpriseResp
|
||||
LoginReq = user.LoginReq
|
||||
LoginResp = user.LoginResp
|
||||
PhoneLoginReq = user.PhoneLoginReq
|
||||
RegisterReq = user.RegisterReq
|
||||
ReviewEnterpriseReq = user.ReviewEnterpriseReq
|
||||
UserInfoReq = user.UserInfoReq
|
||||
UserInfoResp = user.UserInfoResp
|
||||
|
||||
Enterprise interface {
|
||||
// 获取待审核企业列表
|
||||
GetPendingEnterprise(ctx context.Context, in *GetPendingEnterpriseReq, opts ...grpc.CallOption) (*GetPendingEnterpriseResp, error)
|
||||
// 审核企业
|
||||
ReviewEnterprise(ctx context.Context, in *ReviewEnterpriseReq, opts ...grpc.CallOption) (*EmptyResponse, error)
|
||||
// 提交审核
|
||||
CreateEnterpriseAuth(ctx context.Context, in *EnterpriseAuthReq, opts ...grpc.CallOption) (*EmptyResponse, error)
|
||||
}
|
||||
|
||||
defaultEnterprise struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewEnterprise(cli zrpc.Client) Enterprise {
|
||||
return &defaultEnterprise{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// 获取待审核企业列表
|
||||
func (m *defaultEnterprise) GetPendingEnterprise(ctx context.Context, in *GetPendingEnterpriseReq, opts ...grpc.CallOption) (*GetPendingEnterpriseResp, error) {
|
||||
client := user.NewEnterpriseClient(m.cli.Conn())
|
||||
return client.GetPendingEnterprise(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 审核企业
|
||||
func (m *defaultEnterprise) ReviewEnterprise(ctx context.Context, in *ReviewEnterpriseReq, opts ...grpc.CallOption) (*EmptyResponse, error) {
|
||||
client := user.NewEnterpriseClient(m.cli.Conn())
|
||||
return client.ReviewEnterprise(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 提交审核
|
||||
func (m *defaultEnterprise) CreateEnterpriseAuth(ctx context.Context, in *EnterpriseAuthReq, opts ...grpc.CallOption) (*EmptyResponse, error) {
|
||||
client := user.NewEnterpriseClient(m.cli.Conn())
|
||||
return client.CreateEnterpriseAuth(ctx, in, opts...)
|
||||
}
|
||||
58
apps/user/client/user/user.go
Normal file
58
apps/user/client/user/user.go
Normal file
@@ -0,0 +1,58 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: user.proto
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/user"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
EmptyResponse = user.EmptyResponse
|
||||
EnterpriseAuthReq = user.EnterpriseAuthReq
|
||||
EnterpriseItem = user.EnterpriseItem
|
||||
GetEnterpriseAuthStatusReq = user.GetEnterpriseAuthStatusReq
|
||||
GetEnterpriseAuthStatusResp = user.GetEnterpriseAuthStatusResp
|
||||
GetPendingEnterpriseReq = user.GetPendingEnterpriseReq
|
||||
GetPendingEnterpriseResp = user.GetPendingEnterpriseResp
|
||||
LoginReq = user.LoginReq
|
||||
LoginResp = user.LoginResp
|
||||
PhoneLoginReq = user.PhoneLoginReq
|
||||
RegisterReq = user.RegisterReq
|
||||
ReviewEnterpriseReq = user.ReviewEnterpriseReq
|
||||
UserInfoReq = user.UserInfoReq
|
||||
UserInfoResp = user.UserInfoResp
|
||||
|
||||
User interface {
|
||||
// 获取用户信息
|
||||
UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*UserInfoResp, error)
|
||||
GetEnterpriseAuthStatus(ctx context.Context, in *GetEnterpriseAuthStatusReq, opts ...grpc.CallOption) (*GetEnterpriseAuthStatusResp, error)
|
||||
}
|
||||
|
||||
defaultUser struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewUser(cli zrpc.Client) User {
|
||||
return &defaultUser{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
func (m *defaultUser) UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*UserInfoResp, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.UserInfo(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultUser) GetEnterpriseAuthStatus(ctx context.Context, in *GetEnterpriseAuthStatusReq, opts ...grpc.CallOption) (*GetEnterpriseAuthStatusResp, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.GetEnterpriseAuthStatus(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user