using MWS.Data.InterFace;
using MWS.Data.Manager;
using MWS.Model;
using MWS.Model.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace MWS.Domain.Web.Controller
{
    public class DeviceController:ApiController
    {
        [HttpGet]
        public Result<List<Zigbee>> GetAll()
        {
            Result<List<Zigbee>> result = new Result<List<Zigbee>>();

            try
            {
                IZigbee zigbeeManager = new ZigbeeManager();
                List<Zigbee> zigbees = zigbeeManager.GetAll();

                result.Data = zigbees;
                result.Message = "成功！";
            }
            catch (Exception ex)
            {
                result.Data = null;
                result.Message = "失败！";
            }
          
            return result;
        }

    }
}

