chuni: enable ticket system

This commit is contained in:
5ebef5658c5fcb6f5a62e75318bdc7fad90b21bc 2020-07-30 03:28:46 -05:00 committed by Tau
parent abcccfb9a0
commit a8539b475e
3 changed files with 37 additions and 3 deletions

View File

@ -1,13 +1,30 @@
import { GameChargeJson } from "../proto/gameCharge";
import { Repositories } from "../repo";
import { GetGameChargeRequest } from "../request/getGameCharge";
import { GetGameChargeResponse } from "../response/getGameCharge";
import { CHARGE_IDS } from "../static/charge";
export default async function getGameCharge(
rep: Repositories,
req: GetGameChargeRequest
): Promise<GetGameChargeResponse> {
const gameChargeList: GameChargeJson[] = [];
for (const [i, charge] of CHARGE_IDS.entries()) {
gameChargeList.push({
chargeId: charge.id.toString(),
orderId: (i+1).toString(),
price: charge.price.toString(),
salePrice: charge.salePrice.toString(),
startDate: "2017-12-05 07:00:00.0",
endDate: "2029-12-31 23:59:59.0",
saleStartDate: "2017-12-05 07:00:00.0",
saleEndDate: "2030-12-31 23:59:59.0"
});
}
return {
length: "0",
gameChargeList: [],
length: gameChargeList.length.toString(),
gameChargeList,
};
}

View File

@ -26,6 +26,6 @@ export default async function getGameSetting(
maxCountMusic: "100",
},
isDumpUpload: "false",
isAou: "false",
isAou: "true",
};
}

View File

@ -0,0 +1,17 @@
export const CHARGE_IDS = Object.freeze([
{
id: 2310, //World's End ticket x5
price: 1,
salePrice: 1,
},
{
id: 2060, //4x bonus ticket
price: 1,
salePrice: 1,
},
{
id: 2230, //6 songs premium ticket
price: 2,
salePrice: 2,
},
]);