package com.ibeetl.admin.core.util.beetl;

import com.ibeetl.admin.core.rbac.tree.ChannelItem;
import com.ibeetl.admin.core.service.CorePlatformService;
import org.beetl.core.Context;
import org.beetl.core.Function;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 通过orderchannel获取channelname,从缓存中获取
 * @author xiao
 *
 */
@Component
public class ChanChannel implements Function {

	@Autowired
	CorePlatformService platFormService;
	
	
	public Object call(Object[] paras, Context ctx) {
		ChannelItem tree = platFormService.buildChannel();
		ChannelItem item = tree.findChild((Long)paras[0]);
		return item.getName();
		
	}
	
	

}
