auth_controller.go
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/auth/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/auth/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/auth/service"
)
type AuthController struct {
beego.BaseController
}
func (controller *AuthController) CompanySignUp() {
authService := service.NewAuthService(nil)
companySignUpCommand := &command.CompanySignUpCommand{}
controller.Unmarshal(companySignUpCommand)
data, err := authService.CompanySignUp(companySignUpCommand)
controller.Response(data, err)
}
func (controller *AuthController) SignUp() {
authService := service.NewAuthService(nil)
companySignUpCommand := &command.UserSignUpCommand{}
controller.Unmarshal(companySignUpCommand)
data, err := authService.UserSignUp(companySignUpCommand)
controller.Response(data, err)
}
func (controller *AuthController) PhoneAuthCheck() {
authService := service.NewAuthService(nil)
phoneAuthCheckCommand := &command.PhoneAuthCheckCommand{}
controller.Unmarshal(phoneAuthCheckCommand)
data, err := authService.PhoneAuthCheck(phoneAuthCheckCommand)
controller.Response(data, err)
}
func (controller *AuthController) PhoneAuthResetPassword() {
authService := service.NewAuthService(nil)
phoneAuthResetPasswordCommand := &command.PhoneAuthResetPasswordCommand{}
controller.Unmarshal(phoneAuthResetPasswordCommand)
data, err := authService.PhoneAuthResetPassword(phoneAuthResetPasswordCommand)
controller.Response(data, err)
}
func (controller *AuthController) PhoneAuthChangePassword() {
authService := service.NewAuthService(nil)
phoneAuthChangePasswordCommand := &command.PhoneAuthChangePasswordCommand{}
controller.Unmarshal(phoneAuthChangePasswordCommand)
data, err := authService.PhoneAuthChangePassword(phoneAuthChangePasswordCommand)
controller.Response(data, err)
}
func (controller *AuthController) PhoneAuthResetPhone() {
authService := service.NewAuthService(nil)
phoneAuthResetPhoneCommand := &command.PhoneAuthResetPhoneCommand{}
controller.Unmarshal(phoneAuthResetPhoneCommand)
data, err := authService.PhoneAuthResetPhone(phoneAuthResetPhoneCommand)
controller.Response(data, err)
}
func (controller *AuthController) DestroyAccount() {
authService := service.NewAuthService(nil)
destroyAccountCommand := &command.DestroyAccountCommand{}
controller.Unmarshal(destroyAccountCommand)
data, err := authService.DestroyAccount(destroyAccountCommand)
controller.Response(data, err)
}
func (controller *AuthController) UserInfo() {
authService := service.NewAuthService(nil)
userInfoQuery := &query.UserInfoQuery{}
controller.Unmarshal(userInfoQuery)
data, err := authService.UserInfo(userInfoQuery)
controller.Response(data, err)
}
func (controller *AuthController) RefreshIM() {
authService := service.NewAuthService(nil)
refreshIMCommand := &command.RefreshIMCommand{}
controller.Unmarshal(refreshIMCommand)
data, err := authService.RefreshIM(refreshIMCommand)
controller.Response(data, err)
}