class Enum {
	constructor(key,val) {
		this.#key = key;
		this.#val  = val;
	}
	
	/**
	 * 枚举类型的key
	 */
	#key;
	
	/**
	 * 枚举类型的值
	 */
	#val;
	
	get val() {
		return this.#val;
	}
}


export class SystemMessageEnum  {
	
	#map = new Map();
	
	constructor() {
		this.enums("TRADE",new Enum(1,"交易通知"));
		this.enums("BINDDING",new Enum(2,"竞标消息"));
		this.enums("NOTICE",new Enum(3,"系统通知"));
		this.enums("ACTIVITY",new Enum(4,"优惠活动"));
		this.enums("PAY",new Enum(5,"收费通知"));
	}
	
	val(key) {
		return this.#map[key];
	}
	
	enums(type,content) {
		console.log(type)
		console.log(content)
		this.#map[type] = content;
	}
}

Logo

前往低代码交流专区

更多推荐