|
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace UserCenter.Controllers
|
|
|
|
@ -32,16 +33,6 @@ namespace UserCenter.Controllers
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//var model = this._nodeCategoryRepo.ReadOnlyTable()
|
|
|
|
|
// .Include(o => o.CategoryNodes)
|
|
|
|
|
// .ThenInclude(o => o.Node)
|
|
|
|
|
// .OrderBy(o => o.DisplayOrder)
|
|
|
|
|
// .Select(o => new
|
|
|
|
|
// {
|
|
|
|
|
// o.Name,
|
|
|
|
|
// o.DisplayOrder,
|
|
|
|
|
// Nodes = o.CategoryNodes.Select(o => o.Node)
|
|
|
|
|
// });
|
|
|
|
|
var model = this._nodeRepo.ReadOnlyTable()
|
|
|
|
|
.Select(o => new
|
|
|
|
|
{
|
|
|
|
@ -60,5 +51,26 @@ namespace UserCenter.Controllers
|
|
|
|
|
return Problem(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public ActionResult GetNode([Required]string number)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var model = this._nodeRepo.ReadOnlyTable()
|
|
|
|
|
.Include(o => o.Devices)
|
|
|
|
|
.ThenInclude(o => o.Product)
|
|
|
|
|
.Include(o => o.Devices)
|
|
|
|
|
.ThenInclude(o => o.Data)
|
|
|
|
|
.Where(o => o.Number == number)
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
return Ok(model);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ex.PrintStack();
|
|
|
|
|
return Problem(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|