@@ -23,11 +23,13 @@ type ExchangePayload struct {
|
||||
Data *ExchangeData
|
||||
}
|
||||
|
||||
type ExchangeResponse struct {
|
||||
RedirectUri string `json:"redirect_uri"`
|
||||
}
|
||||
|
||||
type ExchangeResult struct {
|
||||
Common shared.CommonResult
|
||||
Data *struct {
|
||||
RedirectUri string `json:"redirect_uri"`
|
||||
}
|
||||
Data *ExchangeResponse
|
||||
}
|
||||
|
||||
func (self *AuthServiceImpl) Exchange(payload *ExchangePayload) (result *ExchangeResult) {
|
||||
@@ -113,16 +115,14 @@ func (self *AuthServiceImpl) Exchange(payload *ExchangePayload) (result *Exchang
|
||||
SetError(nil).
|
||||
Throw(payload.Context)
|
||||
|
||||
resultData := struct {
|
||||
RedirectUri string `json:"redirect_uri"`
|
||||
}{url.String()}
|
||||
resultData := &ExchangeResponse{url.String()}
|
||||
|
||||
result = &ExchangeResult{
|
||||
Common: shared.CommonResult{
|
||||
HttpCode: 200,
|
||||
Exception: exception,
|
||||
},
|
||||
Data: &resultData,
|
||||
Data: resultData,
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
@@ -26,9 +26,13 @@ type MagicPayload struct {
|
||||
Data *MagicData
|
||||
}
|
||||
|
||||
type MagicResponse struct {
|
||||
Uri string `json:"uri"`
|
||||
}
|
||||
|
||||
type MagicResult struct {
|
||||
Common shared.CommonResult
|
||||
Data any
|
||||
Data *MagicResponse
|
||||
}
|
||||
|
||||
func (self *AuthServiceImpl) Magic(payload *MagicPayload) (result *MagicResult) {
|
||||
@@ -129,7 +133,7 @@ func (self *AuthServiceImpl) Magic(payload *MagicPayload) (result *MagicResult)
|
||||
HttpCode: 200,
|
||||
Exception: exception,
|
||||
},
|
||||
Data: uriData,
|
||||
Data: &MagicResponse{uriData.Uri},
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user