12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using Ant.Core.WebApi.Model;
- using Central.Control.WebApi.Models.Request;
- using Central.Control.WebApi.Models.Response;
- using Central.Control.WebApi.Service.Interface;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Http;
- namespace Central.Control.WebApi.Controllers
- {
- /// <summary>
- /// 设备相关接口
- /// </summary>
- [RoutePrefix("api/device")]
- public class DeviceController : ApiController
- {
- private readonly IDeviceService _deviceService;
- /// <summary>
- ///
- /// </summary>
- /// <param name="deviceService"></param>
- public DeviceController(IDeviceService deviceService)
- {
- _deviceService = deviceService;
- }
- /// <summary>
- /// 获取设备正在售卖的商品
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [Route("deviceproduct")]
- public ApiResult<DeviceProductResponseDto> GetDeviceProduct()
- {
- return _deviceService.GetDeviceProduct();
- }
- /// <summary>
- /// 设置设备售卖商品
- /// </summary>
- /// <param name="req"></param>
- /// <returns></returns>
- [HttpPost]
- [Route("deviceproduct")]
- public ApiResult SaveDeviceProduct(DeviceProductRequestDto req)
- {
- return _deviceService.SaveDeviceProduct(req);
- }
- /// <summary>
- /// 获取设备正在使用的包装盒表
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [Route("devicepacking")]
- public ApiResult<DevicePackingResponseDto> GetDevicePacking()
- {
- return _deviceService.GetDevicePacking();
- }
- /// <summary>
- /// 设备可以添加的包装盒列表
- /// </summary>
- /// <param name="kw"></param>
- /// <param name="skip"></param>
- /// <param name="limit"></param>
- /// <returns></returns>
- [HttpGet]
- [Route("devicecanusepackings")]
- public PagedApiResult<DeviceCanUsePackingResponseDto> GetDeviceCanUsePackings(string kw = "", int skip = 0, int limit = 1)
- {
- return _deviceService.GetDeviceCanUsePackings(kw, skip, limit);
- }
- /// <summary>
- /// 添加/修改设备包装盒
- /// </summary>
- /// <param name="req"></param>
- /// <returns></returns>
- [HttpPost]
- [Route("devicepacking")]
- public ApiResult SaveDevicePacking(DevicePackingRequestDto req)
- {
- return _deviceService.SaveDevicePacking(req);
- }
- }
- }
|