Created UserService and TrashService

This commit is contained in:
Nicolas SANS
2023-03-21 11:34:57 +01:00
parent 4c873d4d09
commit 0f6b8a93b4
9 changed files with 126 additions and 48 deletions

View File

@ -9,9 +9,19 @@ namespace services
{
public class TrashService
{
public static Trash GetTrash(String id)
public static Trash GetTrash(String token, String id)
{
return Api<Trash>.get("/api/collections/trashs/records/"+id);
return Api<Trash>.get("/api/collections/trashs/records/"+id, token);
}
public static TrashList ListTrash(String token)
{
return Api<TrashList>.get("/api/collections/trashs/records/", token);
}
public static DataList ListTrashData(String token, String trashId)
{
return Api<DataList>.get("/api/collections/data/records/?trash_id="+trashId, token);
}
}
}

15
services/UserService.cs Normal file
View File

@ -0,0 +1,15 @@
using models;
using UnityEngine;
using utils;
namespace services
{
public class UserService
{
public static LoginResponse Login(LoginRequest request)
{
var response = Api<LoginResponse>.post("/api/collections/users/auth-with-password", JsonUtility.ToJson(request));
return response;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2fe63392645946c48c112658ebbf75c5
timeCreated: 1679389336