mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 18:22:11 +08:00
完善可以根据主键类型调整父类
This commit is contained in:
@@ -12,7 +12,7 @@ using OpenAuth.Repository.Interface;
|
||||
|
||||
namespace OpenAuth.App
|
||||
{
|
||||
public class {ModuleCode} : BaseStringApp<{ClassName},OpenAuthDBContext>
|
||||
public class {ModuleCode} : {BaseAppName}<{ClassName},OpenAuthDBContext>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -23,21 +23,22 @@ namespace OpenAuth.App
|
||||
var loginContext = _auth.GetCurrentUser();
|
||||
if (loginContext == null)
|
||||
{
|
||||
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
|
||||
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
|
||||
}
|
||||
|
||||
var properties = loginContext.GetProperties("{ClassName}");
|
||||
|
||||
if (properties == null || properties.Count == 0)
|
||||
{
|
||||
throw new Exception("当前登录用户没有访问该模块字段的权限,请联系管理员配置");
|
||||
throw new Exception("当前登录用户没有访问该模块字段的权限,请联系管理员配置");
|
||||
}
|
||||
|
||||
var result = new TableData();
|
||||
var objs = GetDataPrivilege("u");
|
||||
if (!string.IsNullOrEmpty(request.key))
|
||||
{
|
||||
objs = objs.Where(u => u.Id.Contains(request.key));
|
||||
//增加筛选条件,如:
|
||||
//objs = objs.Where(u => u.Name.Contains(request.key));
|
||||
}
|
||||
|
||||
var propertyStr = string.Join(',', properties.Select(u => u.Key));
|
||||
|
@@ -20,7 +20,7 @@ namespace OpenAuth.WebApi.Controllers
|
||||
|
||||
//获取详情
|
||||
[HttpGet]
|
||||
public Response<{ClassName}> Get(string id)
|
||||
public Response<{ClassName}> Get({KeyTypeName} id)
|
||||
{
|
||||
var result = new Response<{ClassName}>();
|
||||
try
|
||||
@@ -87,7 +87,7 @@ namespace OpenAuth.WebApi.Controllers
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public Response Delete([FromBody]string[] ids)
|
||||
public Response Delete([FromBody]{KeyTypeName}[] ids)
|
||||
{
|
||||
var result = new Response();
|
||||
try
|
||||
|
@@ -13,7 +13,7 @@ using OpenAuth.Repository.Core;
|
||||
namespace OpenAuth.Repository.Domain
|
||||
{
|
||||
{AttributeManager}
|
||||
public class {ClassName} : StringEntity
|
||||
public class {ClassName} : {BaseEntityName}
|
||||
{
|
||||
public {ClassName}()
|
||||
{
|
||||
|
Reference in New Issue
Block a user