first commit
This commit is contained in:
42
apps/user/internal/server/auth/authserver.go
Normal file
42
apps/user/internal/server/auth/authserver.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: user.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/internal/logic/auth"
|
||||
"tianyuan-api/apps/user/internal/svc"
|
||||
"tianyuan-api/apps/user/user"
|
||||
)
|
||||
|
||||
type AuthServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
user.UnimplementedAuthServer
|
||||
}
|
||||
|
||||
func NewAuthServer(svcCtx *svc.ServiceContext) *AuthServer {
|
||||
return &AuthServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 注册接口
|
||||
func (s *AuthServer) RegisterUser(ctx context.Context, in *user.RegisterReq) (*user.EmptyResponse, error) {
|
||||
l := authlogic.NewRegisterUserLogic(ctx, s.svcCtx)
|
||||
return l.RegisterUser(in)
|
||||
}
|
||||
|
||||
// 登录接口
|
||||
func (s *AuthServer) LoginUser(ctx context.Context, in *user.LoginReq) (*user.LoginResp, error) {
|
||||
l := authlogic.NewLoginUserLogic(ctx, s.svcCtx)
|
||||
return l.LoginUser(in)
|
||||
}
|
||||
|
||||
// 手机登录接口
|
||||
func (s *AuthServer) PhoneLoginUser(ctx context.Context, in *user.PhoneLoginReq) (*user.LoginResp, error) {
|
||||
l := authlogic.NewPhoneLoginUserLogic(ctx, s.svcCtx)
|
||||
return l.PhoneLoginUser(in)
|
||||
}
|
||||
42
apps/user/internal/server/enterprise/enterpriseserver.go
Normal file
42
apps/user/internal/server/enterprise/enterpriseserver.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: user.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/internal/logic/enterprise"
|
||||
"tianyuan-api/apps/user/internal/svc"
|
||||
"tianyuan-api/apps/user/user"
|
||||
)
|
||||
|
||||
type EnterpriseServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
user.UnimplementedEnterpriseServer
|
||||
}
|
||||
|
||||
func NewEnterpriseServer(svcCtx *svc.ServiceContext) *EnterpriseServer {
|
||||
return &EnterpriseServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 获取待审核企业列表
|
||||
func (s *EnterpriseServer) GetPendingEnterprise(ctx context.Context, in *user.GetPendingEnterpriseReq) (*user.GetPendingEnterpriseResp, error) {
|
||||
l := enterpriselogic.NewGetPendingEnterpriseLogic(ctx, s.svcCtx)
|
||||
return l.GetPendingEnterprise()
|
||||
}
|
||||
|
||||
// 审核企业
|
||||
func (s *EnterpriseServer) ReviewEnterprise(ctx context.Context, in *user.ReviewEnterpriseReq) (*user.EmptyResponse, error) {
|
||||
l := enterpriselogic.NewReviewEnterpriseLogic(ctx, s.svcCtx)
|
||||
return l.ReviewEnterprise(in)
|
||||
}
|
||||
|
||||
// 提交审核
|
||||
func (s *EnterpriseServer) CreateEnterpriseAuth(ctx context.Context, in *user.EnterpriseAuthReq) (*user.EmptyResponse, error) {
|
||||
l := enterpriselogic.NewCreateEnterpriseAuthLogic(ctx, s.svcCtx)
|
||||
return l.CreateEnterpriseAuth(in)
|
||||
}
|
||||
35
apps/user/internal/server/user/userserver.go
Normal file
35
apps/user/internal/server/user/userserver.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: user.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/user/internal/logic/user"
|
||||
"tianyuan-api/apps/user/internal/svc"
|
||||
"tianyuan-api/apps/user/user"
|
||||
)
|
||||
|
||||
type UserServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
user.UnimplementedUserServer
|
||||
}
|
||||
|
||||
func NewUserServer(svcCtx *svc.ServiceContext) *UserServer {
|
||||
return &UserServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
func (s *UserServer) UserInfo(ctx context.Context, in *user.UserInfoReq) (*user.UserInfoResp, error) {
|
||||
l := userlogic.NewUserInfoLogic(ctx, s.svcCtx)
|
||||
return l.UserInfo(in)
|
||||
}
|
||||
|
||||
func (s *UserServer) GetEnterpriseAuthStatus(ctx context.Context, in *user.GetEnterpriseAuthStatusReq) (*user.GetEnterpriseAuthStatusResp, error) {
|
||||
l := userlogic.NewGetEnterpriseAuthStatusLogic(ctx, s.svcCtx)
|
||||
return l.GetEnterpriseAuthStatus(in)
|
||||
}
|
||||
Reference in New Issue
Block a user