|
16 | 16 | namespaceDestiny.Core.Flow.AspNetCore |
17 | 17 | { |
18 | 18 |
|
| 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 | +{ |
19 | 40 |
|
| 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> |
20 | 54 | [Route("api/[controller]/[action]")] |
21 | 55 | [ApiController] |
22 | 56 | publicabstractclassCrudApiControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>:ApiControllerBase |
23 | 57 | 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> |
28 | 62 | { |
29 | | -protectedICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>CrudServiceAsync{get;set;} |
| 63 | +protectedvirtualICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>CrudServiceAsync{get;set;} |
30 | 64 | protectedCrudApiControllerBase(ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>crudServiceAsync) |
31 | 65 | { |
32 | 66 |
|
@@ -74,18 +108,57 @@ public async Task<PageList<IPagedListDto>> GetPageAsync([FromBody] PageRequest r |
74 | 108 | } |
75 | 109 | } |
76 | 110 |
|
| 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> |
77 | 120 | [Authorize] |
78 | 121 | publicabstractclassCrudAdminControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>:CrudApiControllerBase<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto> |
79 | 122 | whereTEntity:EntityBase<TPrimaryKey> |
80 | 123 | 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> |
81 | 153 | whereIInputDto:IInputDto<TPrimaryKey> |
82 | 154 | whereIPagedListDto:IOutputDto<TPrimaryKey> |
83 | | -whereIIOutputDto:IOutputDto<TPrimaryKey> |
| 155 | +whereIIOutputDto:IOutputDto<TPrimaryKey> |
| 156 | +whereICrudService:ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto> |
84 | 157 | { |
85 | 158 |
|
86 | 159 |
|
87 | 160 |
|
88 | | -protectedCrudAdminControllerBase(ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>crudServiceAsync):base(crudServiceAsync) |
| 161 | +protectedCrudAdminControllerBase(ICrudServicecrudServiceAsync):base(crudServiceAsync) |
89 | 162 | { |
90 | 163 |
|
91 | 164 | this.CrudServiceAsync=crudServiceAsync; |
|