package cn.superdesk.uniorder.dubbo.provider._commom;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.common.UploadFiles;
import cn.superdesk.uniorder.dto.param._common.UploadFilesParam;
import cn.superdesk.uniorder.dto.param._common.UploadFilesQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade._commom.DubboUploadFilesService;
import cn.superdesk.uniorder.service._common.UploadFilesService;
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-11-22 17:13:37
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-11-22 17:13:37
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboUploadFilesServiceImpl implements DubboUploadFilesService {

	@Autowired
	private UploadFilesService uploadFilesService;


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

	@Override
	public void addObj(UploadFilesParam param) {

		UploadFiles uploadFiles = AnBeanUtils.copy(param, UploadFiles.class);
		uploadFilesService.insertSelective(uploadFiles);

	}

	@Override
	public void updateObj(UploadFilesParam param) {

		UploadFiles uploadFiles = AnBeanUtils.copy(param, UploadFiles.class);
		uploadFilesService.updateByPrimaryKeySelective(uploadFiles);
	}

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

	@Override
	public UploadFiles findById(Long id) {
		return uploadFilesService.findById(id);
	}

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

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

		return uploadFilesService.findAll(queryMap);
	}

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


	@Override
	public void addUploadFiles(UploadFilesParam param) {

		UploadFiles uploadFiles = AnBeanUtils.copy(param, UploadFiles.class);
		uploadFilesService.addUploadFiles(uploadFiles);
	}

	@Override
	public void updateUploadFiles(UploadFilesParam param) {

		UploadFiles uploadFiles = AnBeanUtils.copy(param, UploadFiles.class);
		uploadFilesService.updateUploadFiles(uploadFiles);
	}

	@Override
	public void deleteUploadFiles(Long id) {
		uploadFilesService.deleteUploadFiles(id);
	}

	@Override
	public UploadFiles findUploadFilesById(Long id) {
		return uploadFilesService.findUploadFilesById(id);
	}

	@Override
	public UploadFiles findUploadFilesByUid(String uid) {
		return uploadFilesService.findUploadFilesByUid(uid);
	}

	@Override
	public List<UploadFiles> findUploadFilesByIds(List<Long> ids){
		return uploadFilesService.findUploadFilesByIds(ids);
	}

	@Override
	public List<UploadFiles> findUploadFilesByUids(List<String> uids){
		return uploadFilesService.findUploadFilesByUids(uids);
	}

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

	@Override
	public R<List<UploadFiles>> pageQueryGenericParam(UploadFilesQueryCriteria criteria) {
		return uploadFilesService.pageQueryGenericParam(criteria);
	}
}
