-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReturnMessage.cs
56 lines (50 loc) · 1.79 KB
/
ReturnMessage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using Newtonsoft.Json;
namespace ShareMe
{
public class ReturnMessage
{
public bool Ok { get; private set; }
public string Error { get; private set; }
public string Warning { get; private set; }
public string Message { get; private set; }
public string[] FileUrls { get; private set; }
public string Token { get; private set; }
public static string OkFileUploaded(string message, string[] fileUrls)
=> JsonConvert.SerializeObject(new ReturnMessage
{
Ok = true,
Message = message,
FileUrls = fileUrls
},
Program.JsonSettings);
public static string OkFileDeleted(string message)
=> JsonConvert.SerializeObject(new ReturnMessage
{
Ok = true,
Message = message,
},
Program.JsonSettings);
public static string OkTokenMessage(string message, string token)
=> JsonConvert.SerializeObject(new ReturnMessage
{
Ok = true,
Message = message,
Token = token
},
Program.JsonSettings);
public static string WarningMessage(string warning)
=> JsonConvert.SerializeObject(new ReturnMessage
{
Ok = true,
Warning = warning
},
Program.JsonSettings);
public static string ErrorMessage(string error)
=> JsonConvert.SerializeObject(new ReturnMessage
{
Ok = false,
Error = error
},
Program.JsonSettings);
}
}