RobotsController.cs 731 字节
using DeviceLib.BLL;
using DeviceLib.Model.AGV;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace DeviceLib.WebApi.Controllers
{
    [RoutePrefix("api/robots")]
    public class RobotsController: ApiController
    {
        [HttpGet]
        public List<Robot> Get()
        {
            return RobotManager.GetAllRobots();
        }
        [HttpGet]
        [Route("{id}")]
        public Robot Get(int id)
        {
            return RobotManager.GetRobot(id);
        }
        [HttpGet]
        [Route("{ip}")]
        public Robot Get(string ip)
        {
            return RobotManager.GetRobot(ip);
        }
    }
}