🎨 complete SMS login function

This commit is contained in:
landaiqing
2024-08-14 00:11:32 +08:00
parent 48c5aeb0f4
commit 368adadf52
38 changed files with 687 additions and 232 deletions

View File

@@ -0,0 +1,30 @@
package dto
import "encoding/json"
// RefreshTokenRequest 刷新token请求
type RefreshTokenRequest struct {
RefreshToken string `json:"refresh_token"`
}
// PhoneLoginRequest 手机号登录请求
type PhoneLoginRequest struct {
Phone string `json:"phone"`
Captcha string `json:"captcha"`
}
// ResponseData 返回数据
type ResponseData struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresAt int64 `json:"expires_at"`
UID *string `json:"uid"`
}
func (res ResponseData) MarshalBinary() ([]byte, error) {
return json.Marshal(res)
}
func (res ResponseData) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, &res)
}