package com.xueyi.system.digitalmans.service.impl;

import com.xueyi.system.api.digitalmans.domain.dto.DmModelDto;
import com.xueyi.system.digitalmans.domain.dto.DmModelUploadDto;
import com.xueyi.system.digitalmans.domain.query.DmModelQuery;
import com.xueyi.system.digitalmans.service.IDmModelService;
import com.xueyi.system.digitalmans.manager.IDmModelManager;
import com.xueyi.common.web.entity.service.impl.BaseServiceImpl;
import com.xueyi.system.resource.mapper.DmResourcesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 模型管理 服务层处理
 *
 * @author xueyi
 */
@Service
public class DmModelServiceImpl extends BaseServiceImpl<DmModelQuery, DmModelDto, IDmModelManager> implements IDmModelService {

    @Autowired
    DmResourcesMapper dmResourcesMapper;
    @Autowired
    IDmModelManager modelManager;

    /**
     * 查询模型对象列表 | 数据权限
     *
     * @param dmModel 模型对象
     * @return 模型对象集合
     */
    @Override
    //@DataScope(userAlias = "createBy", mapperScope = {"DmModelMapper"})
    public List<DmModelDto> selectListScope(DmModelQuery dmModel) {
        return baseManager.selectList(dmModel);
    }

    @Override
    public int uploadResource(DmModelUploadDto dto) {
        return modelManager.uploadResourceByResourceId(dto);
    }
}