Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0bee326

Browse files
committed
修改公共增删查改控制器
1 parenta224d84 commit0bee326

File tree

1 file changed

+80
-7
lines changed

1 file changed

+80
-7
lines changed

‎src/Destiny.Core.Flow.AspNetCore/CrudAdminControllerBaseOfModle.cs‎

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,51 @@
1616
namespaceDestiny.Core.Flow.AspNetCore
1717
{
1818

19+
/// <summary>
20+
/// 增删改查权API制器(无权限)
21+
/// </summary>
22+
/// <typeparam name="ICrudService">增删改查服务</typeparam>
23+
/// <typeparam name="TPrimaryKey">键</typeparam>
24+
/// <typeparam name="TEntity">实体</typeparam>
25+
/// <typeparam name="IInputDto">输入DTO</typeparam>
26+
/// <typeparam name="IIOutputDto">输出DTO</typeparam>
27+
/// <typeparam name="IPagedListDto">分页DTO</typeparam>
28+
publicabstractclassCrudApiControllerBase<ICrudService,TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>:CrudApiControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>
29+
whereTEntity:EntityBase<TPrimaryKey>
30+
whereTPrimaryKey:IEquatable<TPrimaryKey>
31+
whereIInputDto:IInputDto<TPrimaryKey>
32+
whereIPagedListDto:IOutputDto<TPrimaryKey>
33+
whereIIOutputDto:IOutputDto<TPrimaryKey>
34+
whereICrudService:ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>
35+
{
36+
37+
38+
protectedCrudApiControllerBase(ICrudServicecrudServiceAsync):base(crudServiceAsync)
39+
{
1940

41+
this.CrudServiceAsync=crudServiceAsync;
42+
}
43+
44+
}
45+
46+
/// <summary>
47+
/// 增删改查权API制器(无权限)
48+
/// </summary>
49+
/// <typeparam name="TPrimaryKey">键</typeparam>
50+
/// <typeparam name="TEntity">实体</typeparam>
51+
/// <typeparam name="IInputDto">输入DTO</typeparam>
52+
/// <typeparam name="IIOutputDto">输出DTO</typeparam>
53+
/// <typeparam name="IPagedListDto">分页DTO</typeparam>
2054
[Route("api/[controller]/[action]")]
2155
[ApiController]
2256
publicabstractclassCrudApiControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>:ApiControllerBase
2357
whereTEntity:EntityBase<TPrimaryKey>
24-
whereTPrimaryKey:IEquatable<TPrimaryKey>
25-
whereIInputDto:IInputDto<TPrimaryKey>
26-
whereIPagedListDto:IOutputDto<TPrimaryKey>
27-
whereIIOutputDto:IOutputDto<TPrimaryKey>
58+
whereTPrimaryKey:IEquatable<TPrimaryKey>
59+
whereIInputDto:IInputDto<TPrimaryKey>
60+
whereIPagedListDto:IOutputDto<TPrimaryKey>
61+
whereIIOutputDto:IOutputDto<TPrimaryKey>
2862
{
29-
protectedICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>CrudServiceAsync{get;set;}
63+
protectedvirtualICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>CrudServiceAsync{get;set;}
3064
protectedCrudApiControllerBase(ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>crudServiceAsync)
3165
{
3266

@@ -74,18 +108,57 @@ public async Task<PageList<IPagedListDto>> GetPageAsync([FromBody] PageRequest r
74108
}
75109
}
76110

111+
112+
/// <summary>
113+
/// 增删改查控制器(有权限)
114+
/// </summary>
115+
/// <typeparam name="TPrimaryKey">键</typeparam>
116+
/// <typeparam name="TEntity">实体</typeparam>
117+
/// <typeparam name="IInputDto">输入DTO</typeparam>
118+
/// <typeparam name="IIOutputDto">输出DTO</typeparam>
119+
/// <typeparam name="IPagedListDto">分页DTO</typeparam>
77120
[Authorize]
78121
publicabstractclassCrudAdminControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>:CrudApiControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>
79122
whereTEntity:EntityBase<TPrimaryKey>
80123
whereTPrimaryKey:IEquatable<TPrimaryKey>
124+
whereIInputDto:IInputDto<TPrimaryKey>
125+
whereIPagedListDto:IOutputDto<TPrimaryKey>
126+
whereIIOutputDto:IOutputDto<TPrimaryKey>
127+
{
128+
129+
130+
131+
protectedCrudAdminControllerBase(ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>crudServiceAsync):base(crudServiceAsync)
132+
{
133+
134+
this.CrudServiceAsync=crudServiceAsync;
135+
}
136+
137+
}
138+
139+
/// <summary>
140+
/// 增删改查控制器(有权限)
141+
/// </summary>
142+
/// <typeparam name="ICrudService">增删改查服务</typeparam>
143+
/// <typeparam name="TPrimaryKey">键</typeparam>
144+
/// <typeparam name="TEntity">实体</typeparam>
145+
/// <typeparam name="IInputDto">输入DTO</typeparam>
146+
/// <typeparam name="IIOutputDto">输出DTO</typeparam>
147+
/// <typeparam name="IPagedListDto">分页DTO</typeparam>
148+
149+
[Authorize]
150+
publicabstractclassCrudAdminControllerBase<ICrudService,TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>:CrudApiControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>
151+
whereTEntity:EntityBase<TPrimaryKey>
152+
whereTPrimaryKey:IEquatable<TPrimaryKey>
81153
whereIInputDto:IInputDto<TPrimaryKey>
82154
whereIPagedListDto:IOutputDto<TPrimaryKey>
83-
whereIIOutputDto:IOutputDto<TPrimaryKey>
155+
whereIIOutputDto:IOutputDto<TPrimaryKey>
156+
whereICrudService:ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>
84157
{
85158

86159

87160

88-
protectedCrudAdminControllerBase(ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>crudServiceAsync):base(crudServiceAsync)
161+
protectedCrudAdminControllerBase(ICrudServicecrudServiceAsync):base(crudServiceAsync)
89162
{
90163

91164
this.CrudServiceAsync=crudServiceAsync;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp