package com.xinelu.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author haown
 * @Description 订阅消息跳转路径枚举类
 * @Date 2023-05-11 17:32
 * @return
 **/
@Getter
public enum MessageTypePath {
	//消息类型，1：健康推送，2：日常提醒, 3:风险评估完成, 4:推送筛查项目，5:预约筛查成功, 6:筛查完成,
	// 7:康复处方，8：随访提醒，9：纳入管理，10：申请转诊，11：转诊申请通过，12：申请会诊，13：会诊申请通过，14：处理异常"
	JKTS("1", "pages/index/index"),
	RCTX("2", "pages/dailyhealth/dailyhealth"),
	FXPG("3", "pages/index/index"),
	SCXM("4", "pagesB/screeningUserInfo/screeningUserInfo?assessRecordId="),
	YYCG("5", "pages/index/index"),
	SCWC("6", "pages/screeningResult/screeningResult?screeningId="),
	KFCF("7", "pages/boughtRecoveryPrescription/boughtRecoveryPrescription?prescriptionRecordId="),
	DEFAULT("0", "pages/index/index");

	private final String messageType;

	private final String path;

	MessageTypePath(String messageType, String path) {
		this.messageType = messageType;
		this.path = path;
	}

	public static MessageTypePath getPathByType(String type) {
		if(StringUtils.isBlank(type)) {
			return MessageTypePath.DEFAULT;
		}
		for (MessageTypePath typePath : MessageTypePath.values()) {
			if (type.equals(typePath.getMessageType())) {
				return typePath;
			}
		}
		return MessageTypePath.DEFAULT;
	}
}
