Repository navigation
Expand file tree
/
Copy pathUser.cs
More file actions
127 lines (114 loc) · 3.24 KB
/
Copy pathUser.cs
File metadata and controls
127 lines (114 loc) · 3.24 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
using System;
using System.Collections.Generic;
using ServiceStack;
namespace BlazorDiffusion.ServiceModel;
[Tag(Tag.User)]
[ValidateIsAuthenticated]
public class GetUserProfile : IReturn<GetUserProfileResponse> {}
public class GetUserProfileResponse
{
public UserProfile Result { get; set; }
public ResponseStatus ResponseStatus { get; set; }
}
public class UserProfile
{
public string DisplayName { get; set; }
public string? Avatar { get; set; }
public string? Handle { get; set; }
}
[Tag(Tag.User)]
[ValidateIsAuthenticated]
public class UpdateUserProfile : IUpdateDb<AppUser>, IReturn<UserProfile>
{
[ValidateNotEmpty]
public string DisplayName { get; set; }
[Input(Type="File"), UploadTo("avatars")]
public string? Avatar { get; set; }
[ValidateMaximumLength(20)]
public string? Handle { get; set; }
}
[Tag(Tag.User)]
[ValidateIsAuthenticated]
[AutoApply(Behavior.AuditQuery)]
public class GetArtifactUserData : IGet, IReturn<GetArtifactUserDataResponse>
{
public int ArtifactId { get; set; }
}
public class GetArtifactUserDataResponse
{
public int ArtifactId { get; set; }
public bool Liked { get; set; }
public List<int> UpVoted { get; set; }
public List<int> DownVoted { get; set; }
}
[Tag(Tag.User)]
[ValidateIsAuthenticated]
[AutoApply(Behavior.AuditQuery)]
public class GetAlbumUserData : IGet, IReturn<GetAlbumUserDataResponse>
{
public int AlbumId { get; set; }
}
public class GetAlbumUserDataResponse
{
public int AlbumId { get; set; }
public List<int> LikedArtifacts { get; set; }
}
[Tag(Tag.User)]
public class AnonData : IReturn<AnonDataResponse> { }
public class AnonDataResponse
{
public List<AlbumResult> TopAlbums { get; set; }
public ResponseStatus ResponseStatus { get; set; }
}
[Tag(Tag.User)]
[ValidateIsAuthenticated]
public class CheckQuota : IReturn<CheckQuotaResponse>
{
public int Images { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
public class CheckQuotaResponse
{
public TimeSpan TimeRemaining { get; set; }
public int CreditsUsed { get; set; }
public int CreditsRequested { get; set; }
public int CreditsRemaining { get; set; }
public int DailyQuota { get; set; }
public string RequestedDetails { get; set; }
}
[Tag(Tag.User)]
[ValidateIsAuthenticated]
public class UserData : IReturn<UserDataResponse> {}
public class UserDataResponse
{
public UserResult User { get; set; }
public UserProfile Profile { get; set; }
public List<SignupType> Signups { get; set; }
public List<string> Roles { get; set; }
public ResponseStatus ResponseStatus { get; set; }
}
[Tag(Tag.User)]
public class GetUserInfo : IReturn<GetUserInfoResponse>
{
public string RefId { get; set; }
}
public class GetUserInfoResponse
{
public UserResult Result { get; set; }
public ResponseStatus ResponseStatus { get; set; }
}
public class Likes
{
public List<int> ArtifactIds { get; set; }
public List<int> AlbumIds { get; set; }
}
public class UserResult
{
public string RefId { get; set; }
public string? Handle { get; set; }
public string? Avatar { get; set; }
public string? ProfileUrl { get; set; }
public Likes Likes { get; set; }
public List<AlbumResult> Albums { get; set; }
}