feat(auth): add facebook identity psid login
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Facebook identity 绑定响应 DTO
|
||||
*/
|
||||
import {
|
||||
FacebookIdentityResponseSchema,
|
||||
type FacebookIdentityResponseInput,
|
||||
type FacebookIdentityResponseData,
|
||||
} from "@/data/schemas/auth/facebook_identity_response";
|
||||
|
||||
export class FacebookIdentityResponse {
|
||||
private constructor(input: FacebookIdentityResponseInput) {
|
||||
const data = FacebookIdentityResponseSchema.parse(input);
|
||||
Object.assign(this, data);
|
||||
Object.freeze(this);
|
||||
}
|
||||
|
||||
static from(input: FacebookIdentityResponseInput): FacebookIdentityResponse {
|
||||
return new FacebookIdentityResponse(input);
|
||||
}
|
||||
|
||||
static fromJson(json: unknown): FacebookIdentityResponse {
|
||||
return FacebookIdentityResponse.from(
|
||||
json as FacebookIdentityResponseInput,
|
||||
);
|
||||
}
|
||||
|
||||
toJson(): FacebookIdentityResponseData {
|
||||
return FacebookIdentityResponseSchema.parse(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user