Implement AuthService and ApiClient core logic

This commit is contained in:
2026-04-09 14:22:47 +02:00
parent 3ee4edac6c
commit 8cbfa61766
22 changed files with 503 additions and 13 deletions

125
Models/AuthModels.cs Normal file
View File

@@ -0,0 +1,125 @@
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Chtn.CSharp.SDK.Models.Auth
{
public class LoginPasswordAuthReq
{
[JsonProperty("unameMailPhone")] public string UnameMailPhone { get; set; }
[JsonProperty("password")] public string Password { get; set; }
[JsonProperty("os")] public string Os { get; set; }
[JsonProperty("language")] public string Language { get; set; }
}
public class SignInSuccessResp
{
[JsonProperty("token")] public string Token { get; set; }
[JsonProperty("userid")] public string UserId { get; set; }
[JsonProperty("username")] public string Username { get; set; }
}
public class GetAuthMethods
{
[JsonProperty("identifier")] public string Identifier { get; set; }
}
public class AuthMethods
{
[JsonProperty("methods")] public List<string> Methods { get; set; }
}
public class OtpPleSendCodeReq
{
[JsonProperty("identifier")] public List<string> Identifier { get; set; }
}
public class OtpPleVerifyCodeReq
{
[JsonProperty("identifier")] public string Identifier { get; set; }
[JsonProperty("code")] public string Code { get; set; }
}
public class UnameUsageReq
{
[JsonProperty("username")] public string Username { get; set; }
}
public class EmailUsageReq
{
[JsonProperty("email")] public string Email { get; set; }
}
public class PleSendVCodeReq
{
[JsonProperty("email")] public string Email { get; set; }
}
public class PleVerifyVCodeReq
{
[JsonProperty("email")] public string Email { get; set; }
[JsonProperty("code")] public string Code { get; set; }
}
public class PleVerifyCodeResp
{
[JsonProperty("verifyOk")] public string VerifyOk { get; set; }
[JsonProperty("tempToken")] public string TempToken { get; set; }
}
public class FinishPleAccountReq
{
[JsonProperty("temptoken")] public string TempToken { get; set; }
[JsonProperty("username")] public string Username { get; set; }
[JsonProperty("password")] public string Password { get; set; }
}
public class LoginWithGoogleReq
{
[JsonProperty("idToken")] public string IdToken { get; set; }
}
public class LoginWithAppleReq
{
[JsonProperty("idToken")] public string IdToken { get; set; }
[JsonProperty("firstName")] public string FirstName { get; set; }
[JsonProperty("lastName")] public string LastName { get; set; }
}
public class CheckloginReq
{
[JsonProperty("token")] public string Token { get; set; }
}
public class RegisterReq
{
[JsonProperty("username")] public string Username { get; set; }
[JsonProperty("email")] public string Email { get; set; }
[JsonProperty("password")] public string Password { get; set; }
}
public class ResetPasswordReq
{
[JsonProperty("identifier")] public string Identifier { get; set; }
}
public class ResetPasswordResp
{
[JsonProperty("success")] public string Success { get; set; }
}
public class VerifyPasswordResetReq
{
[JsonProperty("identifier")] public string Identifier { get; set; }
[JsonProperty("code")] public string Code { get; set; }
[JsonProperty("newPassword")] public string NewPassword { get; set; }
}
public class UserDataValidationResp
{
[JsonProperty("available")] public string Available { get; set; }
}
public class GetAuthMethodsReq
{
public string Identifier { get; set; }
}
public class PleVerifyCodeReq
{
public string Email { get; set; }
public string Code { get; set; }
}
}