package com.fshark.overseas.advert.entity.mapper;

import com.fshark.overseas.advert.entity.ServerRoleAccount;
import org.jdbi.v3.core.mapper.RowMapper;
import org.jdbi.v3.core.statement.StatementContext;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ServerRoleAccountMapper implements RowMapper<ServerRoleAccount> {
    @Override
    public ServerRoleAccount map(ResultSet rs, StatementContext ctx) throws SQLException {
        return ServerRoleAccount.builder()
                .uid(rs.getString("uid"))
                .did(rs.getString("did"))
                .gameId(rs.getString("game_id"))
                .platform(rs.getString("platform"))
                .time_zone(rs.getString("time_zone"))
                .mediaSource(rs.getString("media_source"))
                .campaign_id(rs.getString("campaign_id"))
                .ad_set_id(rs.getString("ad_set_id"))
                .ad_id(rs.getString("ad_id"))
                .register_server_id(rs.getString("register_server_id"))
                .role_id(rs.getString("role_id"))
                .event_time(rs.getString("event_time"))
                .build();
    }
}
