diff --git a/src/main/java/br/com/notehub/application/dto/response/token/AuthRES.java b/src/main/java/br/com/notehub/application/dto/response/token/AuthRES.java index 3b0251a..e4f43df 100644 --- a/src/main/java/br/com/notehub/application/dto/response/token/AuthRES.java +++ b/src/main/java/br/com/notehub/application/dto/response/token/AuthRES.java @@ -39,6 +39,7 @@ public AuthRES(Token token, String accessToken) { token.getUser().getMessage(), token.getUser().getHost(), token.getUser().isProfilePrivate(), + token.getUser().isDev(), token.getUser().isSponsor(), token.getUser().isBlocked(), token.getUser().getScore(), diff --git a/src/main/java/br/com/notehub/application/dto/response/user/CreateUserRES.java b/src/main/java/br/com/notehub/application/dto/response/user/CreateUserRES.java index 13e8602..b48894a 100644 --- a/src/main/java/br/com/notehub/application/dto/response/user/CreateUserRES.java +++ b/src/main/java/br/com/notehub/application/dto/response/user/CreateUserRES.java @@ -12,6 +12,7 @@ public record CreateUserRES( String display_name, Host host, boolean profile_private, + boolean dev, boolean sponsor, boolean blocked, Long score @@ -24,6 +25,7 @@ public CreateUserRES(User user) { user.getDisplayName(), user.getHost(), user.isProfilePrivate(), + user.isDev(), user.isSponsor(), user.isBlocked(), user.getScore() diff --git a/src/main/java/br/com/notehub/application/dto/response/user/DetailUserRES.java b/src/main/java/br/com/notehub/application/dto/response/user/DetailUserRES.java index f0e99f1..c9ed8f2 100644 --- a/src/main/java/br/com/notehub/application/dto/response/user/DetailUserRES.java +++ b/src/main/java/br/com/notehub/application/dto/response/user/DetailUserRES.java @@ -17,6 +17,7 @@ public record DetailUserRES( int followers_count, int following_count, boolean profile_private, + boolean dev, boolean sponsor, boolean blocked ) { @@ -32,6 +33,7 @@ public DetailUserRES(User user) { user.getFollowersCount(), user.getFollowingCount(), user.isProfilePrivate(), + user.isDev(), user.isSponsor(), user.isBlocked() ); diff --git a/src/main/java/br/com/notehub/application/dto/response/user/PersonalUserRES.java b/src/main/java/br/com/notehub/application/dto/response/user/PersonalUserRES.java index 2ebf6fc..e0d9bd8 100644 --- a/src/main/java/br/com/notehub/application/dto/response/user/PersonalUserRES.java +++ b/src/main/java/br/com/notehub/application/dto/response/user/PersonalUserRES.java @@ -15,6 +15,7 @@ public record PersonalUserRES( String message, Host host, boolean profile_private, + boolean dev, boolean sponsor, boolean blocked, Long score, diff --git a/src/main/java/br/com/notehub/application/implementation/user/UserServiceImpl.java b/src/main/java/br/com/notehub/application/implementation/user/UserServiceImpl.java index 92f68b6..0fb6d60 100644 --- a/src/main/java/br/com/notehub/application/implementation/user/UserServiceImpl.java +++ b/src/main/java/br/com/notehub/application/implementation/user/UserServiceImpl.java @@ -50,7 +50,7 @@ public class UserServiceImpl implements UserService { private void validateGif(User user, String img, String field) { if (img == null || !img.endsWith(".gif")) return; if (field.equals("banner")) throw new GifNotAllowedException("banner", "GIFs são proibidos como banner."); - if (!user.isSponsor()) throw new GifNotAllowedException("avatar", "GIFs apenas para patrocinadores."); + if (!user.isDev() && !user.isSponsor()) throw new GifNotAllowedException("avatar", "GIFs apenas para patrocinadores."); } @SneakyThrows diff --git a/src/main/java/br/com/notehub/domain/user/User.java b/src/main/java/br/com/notehub/domain/user/User.java index f5bc2be..c7ef8d5 100644 --- a/src/main/java/br/com/notehub/domain/user/User.java +++ b/src/main/java/br/com/notehub/domain/user/User.java @@ -61,6 +61,8 @@ public class User implements UserDetails { private boolean profilePrivate = false; + private boolean dev = false; + private boolean sponsor = false; private boolean blocked = false; diff --git a/src/main/resources/db/migration/V20260407__alter_table_users_add_dev_flag.sql b/src/main/resources/db/migration/V20260407__alter_table_users_add_dev_flag.sql new file mode 100644 index 0000000..cae70d7 --- /dev/null +++ b/src/main/resources/db/migration/V20260407__alter_table_users_add_dev_flag.sql @@ -0,0 +1 @@ +ALTER TABLE users ADD COLUMN dev BOOLEAN DEFAULT FALSE; \ No newline at end of file