Add user settings update functionality in UserController and UserService
Implement a new endpoint in UserController to allow users to update their settings. The UserService is updated to handle the logic for updating user settings, including partial updates for various fields. Additionally, the User entity and database schema are modified to accommodate new user settings properties, ensuring persistence and retrieval of user preferences.
This commit is contained in:
@@ -133,6 +133,14 @@ public static class PostgreSqlMappers
|
||||
OwnerWalletAddress = entity.OwnerWalletAddress,
|
||||
Id = entity.Id, // Assuming Id is the primary key for UserEntity
|
||||
IsAdmin = entity.IsAdmin,
|
||||
LastConnectionDate = entity.LastConnectionDate,
|
||||
LowEthAmountAlert = entity.LowEthAmountAlert,
|
||||
EnableAutoswap = entity.EnableAutoswap,
|
||||
AutoswapAmount = entity.AutoswapAmount,
|
||||
MaxWaitingTimeForPositionToGetFilledSeconds = entity.MaxWaitingTimeForPositionToGetFilledSeconds,
|
||||
MaxTxnGasFeePerPosition = entity.MaxTxnGasFeePerPosition,
|
||||
IsGmxEnabled = entity.IsGmxEnabled,
|
||||
MinimumConfidence = entity.MinimumConfidence,
|
||||
Accounts = entity.Accounts?.Select(MapAccountWithoutUser).ToList() ?? new List<Account>()
|
||||
};
|
||||
}
|
||||
@@ -167,7 +175,15 @@ public static class PostgreSqlMappers
|
||||
AvatarUrl = user.AvatarUrl,
|
||||
TelegramChannel = user.TelegramChannel,
|
||||
OwnerWalletAddress = user.OwnerWalletAddress,
|
||||
IsAdmin = user.IsAdmin
|
||||
IsAdmin = user.IsAdmin,
|
||||
LastConnectionDate = user.LastConnectionDate,
|
||||
LowEthAmountAlert = user.LowEthAmountAlert,
|
||||
EnableAutoswap = user.EnableAutoswap,
|
||||
AutoswapAmount = user.AutoswapAmount,
|
||||
MaxWaitingTimeForPositionToGetFilledSeconds = user.MaxWaitingTimeForPositionToGetFilledSeconds,
|
||||
MaxTxnGasFeePerPosition = user.MaxTxnGasFeePerPosition,
|
||||
IsGmxEnabled = user.IsGmxEnabled,
|
||||
MinimumConfidence = user.MinimumConfidence
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user