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 OrganOrganController : OrganController
|
|
{
|
|
public OrganOrganController(IRepository<Organ> repo, AjaxController ajax) : base(repo, ajax)
|
|
{
|
|
}
|
|
|
|
public override IQueryable<Organ> Query(PagedListModel<EditOrganModel> model, IQueryable<Organ> query)
|
|
{
|
|
var organId = User.GetOrganId();
|
|
return base.Query(model, query)
|
|
.WhereIf(organId.HasValue, o => o.Id == organId.Value);
|
|
}
|
|
}
|
|
}
|