/**
 * 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 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.BizSign;
import com.lightinit.hsdatagateway.modules.gateway.dao.BizSignDao;

/**
 * 签名管理Service
 * @Author yangrui
 * @version 2019-03-05
 */
@Service
@Transactional(readOnly = true)
public class BizSignService extends CrudService<BizSignDao, BizSign> {

	public BizSign get(Long id) {
		return super.get(id);
	}
	
	public List<BizSign> findList(BizSign bizSign) {
		return super.findList(bizSign);
	}
	
	public Page<BizSign> findPage(Page<BizSign> page, BizSign bizSign) {
		return super.findPage(page, bizSign);
	}

	public BizSign getByAppIdAndUserId(String appId, String userId){
		BizSign bizSign = new BizSign();
		bizSign.setAppId(appId);
		bizSign.setUserId(userId);
		return dao.getByAppIdAndUserId(bizSign);
	}

	@Transactional(readOnly = false)
	public void save(BizSign bizSign) {
		super.save(bizSign);
	}
	
	@Transactional(readOnly = false)
	public void delete(BizSign bizSign) {
		super.delete(bizSign);
	}


	/**
	 * 根据id修改签名信息
	 * @param bizSign
	 */
	@Transactional(readOnly = false)
	public void updateById(BizSign bizSign) {
		dao.updateById(bizSign);

	}

	/**
	 * api接口 查询签名信息
	 * @param bizSign
	 * @return
	 */
    public List<BizSign> findListByApi(BizSign bizSign) {
    	return dao.findListByApi(bizSign);
    }
}