Refactor KeyPairMapper to improve query readability by aliasing fields and reformatting SQL.
This commit is contained in:
parent
d28b4a2b62
commit
d1ba89acc8
|
|
@ -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("""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user