mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 18:17:28 +08:00
[+] Add profile picture field to aqua net user
This commit is contained in:
@@ -208,7 +208,11 @@ class UserRegistrar(
|
|||||||
if (!mime.startsWith("image/")) 400 - "Invalid file type"
|
if (!mime.startsWith("image/")) 400 - "Invalid file type"
|
||||||
|
|
||||||
// Save the image
|
// Save the image
|
||||||
(portraitPath / "${u.auId}.${MIMES.forName(mime)?.extension ?: "jpg"}").writeBytes(bytes)
|
val name = "${u.auId}.${MIMES.forName(mime)?.extension ?: "jpg"}"
|
||||||
|
async {
|
||||||
|
(portraitPath / name).writeBytes(bytes)
|
||||||
|
userRepo.save(u.apply { profilePicture = name })
|
||||||
|
}
|
||||||
|
|
||||||
SUCCESS
|
SUCCESS
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class AquaNetUser(
|
|||||||
// Profile fields
|
// Profile fields
|
||||||
var profileLocation: String = "",
|
var profileLocation: String = "",
|
||||||
var profileBio: String = "",
|
var profileBio: String = "",
|
||||||
|
var profilePicture: String = "",
|
||||||
|
|
||||||
// Email confirmation
|
// Email confirmation
|
||||||
var emailConfirmed: Boolean = false,
|
var emailConfirmed: Boolean = false,
|
||||||
|
|||||||
1
src/main/resources/db/migration/mariadb/V1000_3__pfp.sql
Normal file
1
src/main/resources/db/migration/mariadb/V1000_3__pfp.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE aqua_net_user ADD profile_picture VARCHAR(255) NULL;
|
||||||
Reference in New Issue
Block a user