|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
using Application.Domain.Entities;
|
|
|
|
|
using Application.Models;
|
|
|
|
|
using Infrastructure.Application;
|
|
|
|
|
using Infrastructure.Data;
|
|
|
|
|
using Infrastructure.Extensions;
|
|
|
|
|
using Infrastructure.Security;
|
|
|
|
@ -8,14 +7,14 @@ using Infrastructure.Web.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UserCenter.Application.Models;
|
|
|
|
|
|
|
|
|
|
namespace UserCenter.Areas.Admin.Controllers
|
|
|
|
|
{
|
|
|
|
|
[Authorize]
|
|
|
|
|
[Area(nameof(Admin))]
|
|
|
|
|
public class UserController : CrudController<User, PagedListModel<EditUserModel>, EditUserModel, EditUserModel>
|
|
|
|
|
public class UserController : CrudController<User, SearchUserModel, EditUserModel, EditUserModel>
|
|
|
|
|
{
|
|
|
|
|
private readonly IEncryptionService _encrypitonService;
|
|
|
|
|
private readonly AjaxController _ajax;
|
|
|
|
@ -27,6 +26,11 @@ namespace UserCenter.Areas.Admin.Controllers
|
|
|
|
|
this._ajax = ajax;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IQueryable<User> Query(SearchUserModel model, IQueryable<User> query)
|
|
|
|
|
{
|
|
|
|
|
return query.WhereIf(!model.IsDeleted, o => o.IsDeleted == null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IQueryable<User> Include(IQueryable<User> query)
|
|
|
|
|
{
|
|
|
|
|
return query.Include(o => o.UserRoles).ThenInclude(o => o.Role);
|
|
|
|
|