Commit c5320fbf by Leo Zheng

给guchengLoad和gateStatus增加了日期参数

parent 2c4e0209
......@@ -26,7 +26,10 @@ export class gateStatusStrategy extends abstractDataStrategyLeft {
* 执行门状态策略,生成随机的门状态。
* @returns 门状态的对象表示。
*/
execute(): any {
execute(params?: any): any {
if (!params || !params.query || !params.query.date) {
throw new Error("Date parameter is required.")
}
this.gateStatusMap.forEach((value, key, map) => {
map.set(key, randomStatusGenerator.getRandomStatus());
});
......
......@@ -14,7 +14,10 @@ export class guchengLoadStrategy extends abstractDataStrategyLeft {
* 执行古城负载策略,生成随机的负载状态。
* @returns 随机的负载状态。
*/
execute(): any {
execute(params?: any): any {
if (!params || !params.query || !params.query.date) {
throw new Error("Date parameter is required.")
}
return randomStatusGenerator.getRandomStatus();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment