You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
using Infrastructure.Application;
|
|
using Infrastructure.Data;
|
|
using Infrastructure.Extensions;
|
|
using Infrastructure.Web.Mvc;
|
|
using IoT.Shared.Application.Domain.Entities;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Platform.Application.Models;
|
|
using Platform.Areas.IoTCenter.Controllers;
|
|
using System.Linq;
|
|
|
|
namespace Platform.Areas.UserCenter.Controllers
|
|
{
|
|
[Authorize]
|
|
[ApiController]
|
|
[Route("UserCenter/[controller]/[action]")]
|
|
[Area("UserCenter")]
|
|
[ControllerScope(ControllerScopeType.Organ)]
|
|
public class OrganBuildingController : BuildingController
|
|
{
|
|
public OrganBuildingController(IRepository<Building> repo, AjaxController ajax) : base(repo, ajax)
|
|
{
|
|
}
|
|
|
|
public override IQueryable<Building> Query(PagedListModel<EditBuildingModel> model, IQueryable<Building> query)
|
|
{
|
|
var organId = User.GetOrganId();
|
|
return base.Query(model, query)
|
|
.WhereIf(organId.HasValue, o => o.Organ.Id == organId.Value);
|
|
}
|
|
}
|
|
}
|