package com.alttd.altitudeweb.database.web_db;

import org.apache.ibatis.annotations.*;

public interface KeyPairMapper {
    
    @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("""
            INSERT INTO key_pair (id, private_key, public_key, created_at)
            VALUES (#{id}, #{privateKey}, #{publicKey}, #{createdAt})
            """)
    void save(KeyPairEntity keyPair);
}
