mirror of
https://github.com/kiranhart/Auction-House.git
synced 2024-11-14 04:05:44 +01:00
🛠️ adjust auction insert to support dynamic request amounts
Took 24 seconds
This commit is contained in:
parent
c9dd119ee5
commit
5535fe71ae
@ -324,7 +324,7 @@ public class DataManager extends DataManagerAbstract {
|
||||
|
||||
public void insertAuction(AuctionedItem item, Callback<AuctionedItem> callback) {
|
||||
this.databaseConnector.connect(connection -> {
|
||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO " + this.getTablePrefix() + "auctions(id, owner, highest_bidder, owner_name, highest_bidder_name, category, base_price, bid_start_price, bid_increment_price, current_price, expired, expires_at, item_material, item_name, item_lore, item_enchants, item, listed_world, infinite, allow_partial_buys, server_auction, is_request) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
|
||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO " + this.getTablePrefix() + "auctions(id, owner, highest_bidder, owner_name, highest_bidder_name, category, base_price, bid_start_price, bid_increment_price, current_price, expired, expires_at, item_material, item_name, item_lore, item_enchants, item, listed_world, infinite, allow_partial_buys, server_auction, is_request, request_count) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
|
||||
final AuctionAPI api = AuctionAPI.getInstance();
|
||||
PreparedStatement fetch = connection.prepareStatement("SELECT * FROM " + this.getTablePrefix() + "auctions WHERE id = ?");
|
||||
|
||||
@ -351,6 +351,7 @@ public class DataManager extends DataManagerAbstract {
|
||||
statement.setBoolean(20, item.isAllowPartialBuy());
|
||||
statement.setBoolean(21, item.isServerItem());
|
||||
statement.setBoolean(22, item.isRequest());
|
||||
statement.setInt(23, item.getRequestAmount());
|
||||
|
||||
statement.executeUpdate();
|
||||
|
||||
@ -742,6 +743,7 @@ public class DataManager extends DataManagerAbstract {
|
||||
auctionItem.setAllowPartialBuy(hasColumn(resultSet, "allow_partial_buys") && resultSet.getBoolean("allow_partial_buys"));
|
||||
auctionItem.setServerItem(resultSet.getBoolean("server_auction"));
|
||||
auctionItem.setRequest(resultSet.getBoolean("is_request"));
|
||||
auctionItem.setRequestAmount(resultSet.getInt("request_count"));
|
||||
|
||||
return auctionItem;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user