mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-24 07:00:49 +08:00
feat: relocate remaining dtos
This commit is contained in:
@@ -12,5 +12,6 @@ public class CategoryDto {
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
private Long count;
|
||||
}
|
||||
|
||||
|
||||
12
backend/src/main/java/com/openisle/dto/CategoryRequest.java
Normal file
12
backend/src/main/java/com/openisle/dto/CategoryRequest.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request body for creating or updating a category. */
|
||||
@Data
|
||||
public class CategoryRequest {
|
||||
private String name;
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
}
|
||||
15
backend/src/main/java/com/openisle/dto/CommentInfoDto.java
Normal file
15
backend/src/main/java/com/openisle/dto/CommentInfoDto.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** DTO for comment information in user profiles. */
|
||||
@Data
|
||||
public class CommentInfoDto {
|
||||
private Long id;
|
||||
private String content;
|
||||
private LocalDateTime createdAt;
|
||||
private PostMetaDto post;
|
||||
private ParentCommentDto parentComment;
|
||||
}
|
||||
10
backend/src/main/java/com/openisle/dto/CommentRequest.java
Normal file
10
backend/src/main/java/com/openisle/dto/CommentRequest.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request body for creating or replying to a comment. */
|
||||
@Data
|
||||
public class CommentRequest {
|
||||
private String content;
|
||||
private String captcha;
|
||||
}
|
||||
15
backend/src/main/java/com/openisle/dto/ConfigDto.java
Normal file
15
backend/src/main/java/com/openisle/dto/ConfigDto.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import com.openisle.model.PasswordStrength;
|
||||
import com.openisle.model.PublishMode;
|
||||
import com.openisle.model.RegisterMode;
|
||||
import lombok.Data;
|
||||
|
||||
/** DTO for site configuration. */
|
||||
@Data
|
||||
public class ConfigDto {
|
||||
private PublishMode publishMode;
|
||||
private PasswordStrength passwordStrength;
|
||||
private Integer aiFormatLimit;
|
||||
private RegisterMode registerMode;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request for Discord OAuth login. */
|
||||
@Data
|
||||
public class DiscordLoginRequest {
|
||||
private String code;
|
||||
private String redirectUri;
|
||||
}
|
||||
15
backend/src/main/java/com/openisle/dto/DraftDto.java
Normal file
15
backend/src/main/java/com/openisle/dto/DraftDto.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** DTO representing a saved draft. */
|
||||
@Data
|
||||
public class DraftDto {
|
||||
private Long id;
|
||||
private String title;
|
||||
private String content;
|
||||
private Long categoryId;
|
||||
private List<Long> tagIds;
|
||||
}
|
||||
14
backend/src/main/java/com/openisle/dto/DraftRequest.java
Normal file
14
backend/src/main/java/com/openisle/dto/DraftRequest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Request body for saving a draft. */
|
||||
@Data
|
||||
public class DraftRequest {
|
||||
private String title;
|
||||
private String content;
|
||||
private Long categoryId;
|
||||
private List<Long> tagIds;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to trigger a forgot password email. */
|
||||
@Data
|
||||
public class ForgotPasswordRequest {
|
||||
private String email;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request for GitHub OAuth login. */
|
||||
@Data
|
||||
public class GithubLoginRequest {
|
||||
private String code;
|
||||
private String redirectUri;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request for Google OAuth login. */
|
||||
@Data
|
||||
public class GoogleLoginRequest {
|
||||
private String idToken;
|
||||
}
|
||||
11
backend/src/main/java/com/openisle/dto/LoginRequest.java
Normal file
11
backend/src/main/java/com/openisle/dto/LoginRequest.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to login. */
|
||||
@Data
|
||||
public class LoginRequest {
|
||||
private String username;
|
||||
private String password;
|
||||
private String captcha;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to submit a reason (e.g., for moderation). */
|
||||
@Data
|
||||
public class MakeReasonRequest {
|
||||
private String token;
|
||||
private String reason;
|
||||
}
|
||||
10
backend/src/main/java/com/openisle/dto/MilkTeaInfoDto.java
Normal file
10
backend/src/main/java/com/openisle/dto/MilkTeaInfoDto.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Info about the milk tea activity. */
|
||||
@Data
|
||||
public class MilkTeaInfoDto {
|
||||
private long redeemCount;
|
||||
private boolean ended;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to redeem the milk tea activity. */
|
||||
@Data
|
||||
public class MilkTeaRedeemRequest {
|
||||
private String contact;
|
||||
}
|
||||
23
backend/src/main/java/com/openisle/dto/NotificationDto.java
Normal file
23
backend/src/main/java/com/openisle/dto/NotificationDto.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import com.openisle.model.NotificationType;
|
||||
import com.openisle.model.ReactionType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** DTO representing a user notification. */
|
||||
@Data
|
||||
public class NotificationDto {
|
||||
private Long id;
|
||||
private NotificationType type;
|
||||
private PostSummaryDto post;
|
||||
private CommentDto comment;
|
||||
private CommentDto parentComment;
|
||||
private AuthorDto fromUser;
|
||||
private ReactionType reactionType;
|
||||
private String content;
|
||||
private Boolean approved;
|
||||
private boolean read;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Request to mark notifications as read. */
|
||||
@Data
|
||||
public class NotificationMarkReadRequest {
|
||||
private List<Long> ids;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** DTO representing unread notification count. */
|
||||
@Data
|
||||
public class NotificationUnreadCountDto {
|
||||
private long count;
|
||||
}
|
||||
11
backend/src/main/java/com/openisle/dto/ParentCommentDto.java
Normal file
11
backend/src/main/java/com/openisle/dto/ParentCommentDto.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** DTO representing a parent comment. */
|
||||
@Data
|
||||
public class ParentCommentDto {
|
||||
private Long id;
|
||||
private String author;
|
||||
private String content;
|
||||
}
|
||||
16
backend/src/main/java/com/openisle/dto/PostMetaDto.java
Normal file
16
backend/src/main/java/com/openisle/dto/PostMetaDto.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Lightweight post metadata used in user profile lists. */
|
||||
@Data
|
||||
public class PostMetaDto {
|
||||
private Long id;
|
||||
private String title;
|
||||
private String snippet;
|
||||
private LocalDateTime createdAt;
|
||||
private String category;
|
||||
private long views;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Public key response for web push. */
|
||||
@Data
|
||||
public class PushPublicKeyDto {
|
||||
private String key;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request body for saving a push subscription. */
|
||||
@Data
|
||||
public class PushSubscriptionRequest {
|
||||
private String endpoint;
|
||||
private String p256dh;
|
||||
private String auth;
|
||||
}
|
||||
10
backend/src/main/java/com/openisle/dto/ReactionRequest.java
Normal file
10
backend/src/main/java/com/openisle/dto/ReactionRequest.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import com.openisle.model.ReactionType;
|
||||
import lombok.Data;
|
||||
|
||||
/** Request for reacting to a post or comment. */
|
||||
@Data
|
||||
public class ReactionRequest {
|
||||
private ReactionType type;
|
||||
}
|
||||
12
backend/src/main/java/com/openisle/dto/RegisterRequest.java
Normal file
12
backend/src/main/java/com/openisle/dto/RegisterRequest.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to register a new user. */
|
||||
@Data
|
||||
public class RegisterRequest {
|
||||
private String username;
|
||||
private String email;
|
||||
private String password;
|
||||
private String captcha;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to reset password. */
|
||||
@Data
|
||||
public class ResetPasswordRequest {
|
||||
private String token;
|
||||
private String password;
|
||||
}
|
||||
14
backend/src/main/java/com/openisle/dto/SearchResultDto.java
Normal file
14
backend/src/main/java/com/openisle/dto/SearchResultDto.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** DTO representing a search result entry. */
|
||||
@Data
|
||||
public class SearchResultDto {
|
||||
private String type;
|
||||
private Long id;
|
||||
private String text;
|
||||
private String subText;
|
||||
private String extra;
|
||||
private Long postId;
|
||||
}
|
||||
16
backend/src/main/java/com/openisle/dto/SiteConfigDto.java
Normal file
16
backend/src/main/java/com/openisle/dto/SiteConfigDto.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import com.openisle.model.RegisterMode;
|
||||
import lombok.Data;
|
||||
|
||||
/** Public site configuration values. */
|
||||
@Data
|
||||
public class SiteConfigDto {
|
||||
private boolean captchaEnabled;
|
||||
private boolean registerCaptchaEnabled;
|
||||
private boolean loginCaptchaEnabled;
|
||||
private boolean postCaptchaEnabled;
|
||||
private boolean commentCaptchaEnabled;
|
||||
private int aiFormatLimit;
|
||||
private RegisterMode registerMode;
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* DTO representing a tag.
|
||||
*/
|
||||
@@ -12,5 +14,7 @@ public class TagDto {
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
private LocalDateTime createdAt;
|
||||
private Long count;
|
||||
}
|
||||
|
||||
|
||||
12
backend/src/main/java/com/openisle/dto/TagRequest.java
Normal file
12
backend/src/main/java/com/openisle/dto/TagRequest.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request body for creating or updating a tag. */
|
||||
@Data
|
||||
public class TagRequest {
|
||||
private String name;
|
||||
private String description;
|
||||
private String icon;
|
||||
private String smallIcon;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request for Twitter OAuth login. */
|
||||
@Data
|
||||
public class TwitterLoginRequest {
|
||||
private String code;
|
||||
private String redirectUri;
|
||||
private String codeVerifier;
|
||||
}
|
||||
10
backend/src/main/java/com/openisle/dto/UpdateProfileDto.java
Normal file
10
backend/src/main/java/com/openisle/dto/UpdateProfileDto.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request body for updating user profile. */
|
||||
@Data
|
||||
public class UpdateProfileDto {
|
||||
private String username;
|
||||
private String introduction;
|
||||
}
|
||||
13
backend/src/main/java/com/openisle/dto/UserAggregateDto.java
Normal file
13
backend/src/main/java/com/openisle/dto/UserAggregateDto.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Aggregated user data including posts and replies. */
|
||||
@Data
|
||||
public class UserAggregateDto {
|
||||
private UserDto user;
|
||||
private List<PostMetaDto> posts;
|
||||
private List<CommentInfoDto> replies;
|
||||
}
|
||||
30
backend/src/main/java/com/openisle/dto/UserDto.java
Normal file
30
backend/src/main/java/com/openisle/dto/UserDto.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/** Detailed user information. */
|
||||
@Data
|
||||
public class UserDto {
|
||||
private Long id;
|
||||
private String username;
|
||||
private String email;
|
||||
private String avatar;
|
||||
private String role;
|
||||
private String introduction;
|
||||
private long followers;
|
||||
private long following;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime lastPostTime;
|
||||
private LocalDateTime lastCommentTime;
|
||||
private long totalViews;
|
||||
private long visitedDays;
|
||||
private long readPosts;
|
||||
private long likesSent;
|
||||
private long likesReceived;
|
||||
private boolean subscribed;
|
||||
private int experience;
|
||||
private int currentLevel;
|
||||
private int nextLevelExp;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to verify a forgot password code. */
|
||||
@Data
|
||||
public class VerifyForgotRequest {
|
||||
private String email;
|
||||
private String code;
|
||||
}
|
||||
10
backend/src/main/java/com/openisle/dto/VerifyRequest.java
Normal file
10
backend/src/main/java/com/openisle/dto/VerifyRequest.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.openisle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/** Request to verify a user registration. */
|
||||
@Data
|
||||
public class VerifyRequest {
|
||||
private String username;
|
||||
private String code;
|
||||
}
|
||||
Reference in New Issue
Block a user