123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using IMCS.CCS.Repository;
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using IMCS.CCS.Entitys;
- namespace IMCS.CCS.Services
- {
- public class DeviceService: IDeviceService
- {
- private IDeviceRepository _repository;
- public DeviceService(IDeviceRepository repository) {
- _repository = repository;
- }
- public List<Device> GetDeviceList()
- {
- return _repository.GetDeviceList();
- }
- public List<Device> GetDeviceAllList()
- {
- return _repository.GetDeviceAllList();
- }
- //查询设备详情
- public async Task<Device> GetDeviceById(int id)
- {
- return await _repository.GetDeviceById(id);
- }
- //添加设备
- public async Task<bool> CreateDevice(Device device)
- {
- return await _repository.CreateDevice(device);
- }
- //更新设备
- public async Task<bool> UpdateDevice(Device device)
- {
- return await _repository.UpdateDevice(device);
- }
-
- }
- }
|