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

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.sys.notify.SysNotifyCategory;
import cn.superdesk.uniorder.dto.param.system.notify.SysNotifyCategoryParam;
import cn.superdesk.uniorder.dubbo.facade.sys.notify.DubboSysNotifyCategoryService;
import cn.superdesk.uniorder.service.sys.notify.SysNotifyCategoryService;
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:
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2021-03-01 17:37:17
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-03-01 17:37:17
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysNotifyCategoryServiceImpl implements DubboSysNotifyCategoryService {

	@Autowired
	private SysNotifyCategoryService sysNotifyCategoryService;


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

	@Override
	public void addObj(SysNotifyCategoryParam param) {

		SysNotifyCategory sysNotifyCategory = AnBeanUtils.copy(param, SysNotifyCategory.class);
		sysNotifyCategoryService.insertSelective(sysNotifyCategory);

	}

	@Override
	public void updateObj(SysNotifyCategoryParam param) {

		SysNotifyCategory sysNotifyCategory = AnBeanUtils.copy(param, SysNotifyCategory.class);
		sysNotifyCategoryService.updateByPrimaryKeySelective(sysNotifyCategory);
	}

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

	@Override
	public SysNotifyCategory findById(Long id) {
		return sysNotifyCategoryService.findById(id);
	}

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

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

		return sysNotifyCategoryService.findAll(queryMap);
	}

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


	@Override
	public void addSysNotifyCategory(SysNotifyCategoryParam param) {

		SysNotifyCategory sysNotifyCategory = AnBeanUtils.copy(param, SysNotifyCategory.class);
		sysNotifyCategoryService.addSysNotifyCategory(sysNotifyCategory);
	}

	@Override
	public void updateSysNotifyCategory(SysNotifyCategoryParam param) {

		SysNotifyCategory sysNotifyCategory = AnBeanUtils.copy(param, SysNotifyCategory.class);
		sysNotifyCategoryService.updateSysNotifyCategory(sysNotifyCategory);
	}

	@Override
	public void deleteSysNotifyCategory(Long id) {
		sysNotifyCategoryService.deleteSysNotifyCategory(id);
	}

	@Override
	public SysNotifyCategory findSysNotifyCategoryById(Long id) {
		return sysNotifyCategoryService.findSysNotifyCategoryById(id);
	}

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

	}
}
