package cn.superdesk.uniorder.dubbo.provider.sys.role;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApi;
import cn.superdesk.uniorder.dto.param.system.role.SysMenuOpenApiParam;
import cn.superdesk.uniorder.dto.param.system.role.SysMenuOpenApiQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.sys.role.DubboSysMenuOpenApiService;
import cn.superdesk.uniorder.service.sys.role.SysMenuOpenApiService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @Description: 一级菜单-二级菜单-按钮 X 开放接口
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2021-11-01 10:58:18
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-11-01 10:58:18
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysMenuOpenApiServiceImpl implements DubboSysMenuOpenApiService {

	@Autowired
	private SysMenuOpenApiService sysMenuOpenApiService;


	/****************************************** extends BaseService 部分 start ******************************************/

	@Override
	public void addObj(SysMenuOpenApiParam param) {

		SysMenuOpenApi sysMenuOpenApi = AnBeanUtils.copy(param, SysMenuOpenApi.class);
		sysMenuOpenApiService.insertSelective(sysMenuOpenApi);

	}

	@Override
	public void updateObj(SysMenuOpenApiParam param) {

		SysMenuOpenApi sysMenuOpenApi = AnBeanUtils.copy(param, SysMenuOpenApi.class);
		sysMenuOpenApiService.updateByPrimaryKeySelective(sysMenuOpenApi);
	}

	@Override
	public void deleteObj(Long id) {
		sysMenuOpenApiService.deleteObj(id);
	}

	@Override
	public SysMenuOpenApi findById(Long id) {
		return sysMenuOpenApiService.findById(id);
	}

	@Override
	public PageInfo<SysMenuOpenApi> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
		return sysMenuOpenApiService.findByPaging(conditions, pageNun, pageSize);
	}

	@Override
	public List<SysMenuOpenApi> findAll(Map<String, Object> queryMap) {

		return sysMenuOpenApiService.findAll(queryMap);
	}

	/****************************************** extends BaseService 部分   end ******************************************/


	@Override
	public void addSysMenuOpenApi(SysMenuOpenApiParam param) {

		SysMenuOpenApi sysMenuOpenApi = AnBeanUtils.copy(param, SysMenuOpenApi.class);
		sysMenuOpenApiService.addSysMenuOpenApi(sysMenuOpenApi);
	}

	@Override
	public void updateSysMenuOpenApi(SysMenuOpenApiParam param) {

		SysMenuOpenApi sysMenuOpenApi = AnBeanUtils.copy(param, SysMenuOpenApi.class);
		sysMenuOpenApiService.updateSysMenuOpenApi(sysMenuOpenApi);
	}

	@Override
	public void deleteSysMenuOpenApi(Long id) {
		sysMenuOpenApiService.deleteSysMenuOpenApi(id);
	}

	@Override
	public SysMenuOpenApi findSysMenuOpenApiById(Long id) {
		return sysMenuOpenApiService.findSysMenuOpenApiById(id);
	}

	@Override
	public R<List<SysMenuOpenApi>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return sysMenuOpenApiService.pageQuery(conditions, pageNun, pageSize);
	}

	@Override
	public R<List<SysMenuOpenApi>> pageQueryGenericParam(SysMenuOpenApiQueryCriteria criteria) {
		return sysMenuOpenApiService.pageQueryGenericParam(criteria);
	}
}
