Refactor KeyPairMapper to improve query readability by aliasing fields and reformatting SQL.

This commit is contained in:
akastijn 2025-08-05 23:55:15 +02:00
parent d28b4a2b62
commit d1ba89acc8

View File

@ -4,7 +4,12 @@ import org.apache.ibatis.annotations.*;
public interface KeyPairMapper {
@Select("SELECT * FROM key_pair ORDER BY id DESC LIMIT 1")
@Select("""
SELECT id, private_key AS privateKey, public_key AS publicKey, created_at AS createdAt
FROM key_pair
ORDER BY id
DESC LIMIT 1
""")
KeyPairEntity getKeyPair();
@Insert("""