/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.lightinit.hsdatagateway.modules.gateway.service;

import java.util.List;

import com.lightinit.hsdatagateway.common.persistence.Page;
import com.lightinit.hsdatagateway.common.service.CrudService;
import com.lightinit.hsdatagateway.modules.gateway.entity.BizRoute;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lightinit.hsdatagateway.common.persistence.Page;
import com.lightinit.hsdatagateway.common.service.CrudService;
import com.lightinit.hsdatagateway.modules.gateway.entity.BizRoute;
import com.lightinit.hsdatagateway.modules.gateway.dao.BizRouteDao;

/**
 * 路由管理Service
 * @Author yangrui
 * @version 2019-03-05
 */
@Service
@Transactional(readOnly = true)
public class BizRouteService extends CrudService<BizRouteDao, BizRoute> {

	public BizRoute get(Long id) {
		return super.get(id);
	}
	
	public List<BizRoute> findList(BizRoute bizRoute) {
		return super.findList(bizRoute);
	}
	
	public Page<BizRoute> findPage(Page<BizRoute> page, BizRoute bizRoute) {
		return super.findPage(page, bizRoute);
	}
	
	@Transactional(readOnly = false)
	public void save(BizRoute bizRoute) {
		super.save(bizRoute);
	}
	
	@Transactional(readOnly = false)
	public void delete(BizRoute bizRoute) {
		super.delete(bizRoute);
	}

	public BizRoute getByContextPath(String contextPath){
		return dao.getByContextPath(contextPath);
	}

	/**
	 * 根据routeId修改路由
	 * @param bizRoute
	 */
	@Transactional(readOnly = false)
	public void updateByRouteId(BizRoute bizRoute) {
		dao.updateByRouteId(bizRoute);
	}

	/**
	 * api接口 查询路由信息
	 * @param bizRoute
	 * @return
	 */
	public List<BizRoute> findListByApi(BizRoute bizRoute) {
		return dao.findListByApi(bizRoute);

	}
}