package org.springblade.common.constant;

import org.apache.commons.lang3.StringUtils;
import org.springblade.core.secure.BladeUser;

/**
 * @Author: Silent
 * @Description
 * @Date: Created in 14:59 2021/10/12
 * @Modified By:
 */
public interface Salesman {
	//角色名称
	String roleName = "salesman";

	//租户ID
	String tenantId = "000000";

	//二维码推广页面键值
	String EXTEND_QRCODE_PAGE = "extend.qrcode.page";

	/**
	 * 判断是否是业务员
	 * @param bladeUser
	 * @return
	 */
	static boolean isSalesman(BladeUser bladeUser) {
		return StringUtils.equals(bladeUser.getTenantId(), tenantId) && StringUtils.equals(bladeUser.getRoleName(), roleName);
	}
}
