mystcapi/pkg/models/login.go
HeshamTB 9c1014ac72
init: can do full login:
ooo muh gut

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2024-04-29 17:38:11 +03:00

60 lines
1.3 KiB
Go

package models
type LoginPhoneListRequest struct {
Username string `json:"username"`
Password string `json:"password"`
}
type LoginPhoneListResponse struct {
PhoneNumbers []PhoneNumber `json:"phoneNumbers"`
LoginToken string `json:"loginToken"`
}
type PhoneNumberType string
var (
POSTPAID PhoneNumberType = "1"
PREPAID PhoneNumberType = "2"
)
func (p PhoneNumberType) String() string {
switch p {
case "1":
return "POSTPAID"
case "2":
return "PREPAID"
default:
return "UNKOWN"
}
}
type PhoneNumber struct {
Number string `json:"number"`
Type PhoneNumberType `json:"type"`
Contact string `json:"contact"`
}
type LoginRequest struct {
LoginToken string `json:"loginToken"`
PhoneNumber string `json:"phoneNumber"`
}
type LoginResponse struct {
OtpToken string `json:"otpToken"`
ExpiresIn string `json:"expiresIn"`
TokenType string `json:"tokenType"`
}
type LoginVerificationRequest struct {
Username string `json:"username"`
OtpToken string `json:"otpToken"`
Otp string `json:"otp"`
}
type LoginVerificationResponse struct {
AccessToken string `json:"accessToken"`
TokenType string `json:"tokenType"`
ExpiresIn string `json:"expiresIn"`
RefreshToken string `json:"refreshToken"`
}