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

Commit8a730f8

Browse files
committed
Merge branch 'dhg' into dev/yatou
2 parents8448123 +94faf42 commit8a730f8

File tree

2 files changed

+106
-2
lines changed

2 files changed

+106
-2
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
usingDestinyCore.AspNetCore;
2+
usingDestinyCore.Enums;
3+
usingDestinyCore.Extensions;
4+
usingDestinyCore.Filter;
5+
usingDestinyCore.Helpers;
6+
usingDestinyCore.Ui;
7+
usingSystem;
8+
usingSystem.Collections.Generic;
9+
usingSystem.Linq;
10+
usingSystem.Text;
11+
usingSystem.Threading.Tasks;
12+
13+
namespaceDestiny.Core.Flow.AspNetCore
14+
{
15+
publicclassAjaxResult<TData>:ResultBase<TData>,IHasResultType<AjaxResultType>
16+
{
17+
publicAjaxResultTypeType
18+
{
19+
get;
20+
set;
21+
}
22+
23+
publicAjaxResult()
24+
{
25+
}
26+
27+
publicAjaxResult(AjaxResultTypetype=AjaxResultType.Success)
28+
:this("",default(TData),type)
29+
{
30+
}
31+
32+
publicAjaxResult(stringmessage,AjaxResultTypetype=AjaxResultType.Success,TDatadata=default(TData))
33+
:this(message,data,type)
34+
{
35+
}
36+
37+
publicAjaxResult(AjaxResultTypetype=AjaxResultType.Success,TDatadata=default(TData))
38+
:this("",data,type)
39+
{
40+
}
41+
42+
publicAjaxResult(stringmessage,TDatadata,AjaxResultTypetype)
43+
{
44+
Message=message;
45+
Data=data;
46+
Type=type;
47+
Success=Succeeded();
48+
}
49+
50+
publicAjaxResult(stringmessage,boolsuccess,TDatadata,AjaxResultTypetype)
51+
{
52+
Message=message;
53+
Data=data;
54+
Type=type;
55+
Success=success;
56+
}
57+
58+
publicboolSucceeded()
59+
{
60+
returnType==AjaxResultType.Success;
61+
}
62+
63+
publicboolError()
64+
{
65+
returnType==AjaxResultType.Error;
66+
}
67+
68+
publicobjectToObject()
69+
{
70+
returnnew
71+
{
72+
Data,
73+
Message,
74+
Success,
75+
Type
76+
};
77+
}
78+
79+
/// <summary>
80+
/// 只得到数据
81+
/// </summary>
82+
/// <returns></returns>
83+
publicTDataGetData()
84+
{
85+
returnthis.Data;
86+
}
87+
88+
publicstringToJson()
89+
{
90+
returnToObject().ToJson();
91+
}
92+
}
93+
94+
95+
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
usingDestinyCore.AspNetCore;
44
usingDestinyCore.AspNetCore.Api;
55
usingDestinyCore.Entity;
6+
usingDestinyCore.Enums;
7+
usingDestinyCore.Extensions;
68
usingDestinyCore.Filter;
9+
usingDestinyCore.Ui;
710
usingMicrosoft.AspNetCore.Authorization;
811
usingMicrosoft.AspNetCore.Mvc;
912
usingSystem;
@@ -80,6 +83,7 @@ public virtual async Task<AjaxResult> CreateAsync([FromBody] IInputDto dto)
8083
publicvirtualasyncTask<AjaxResult>LoadDataAsync(TPrimaryKeykey){
8184

8285
return(awaitCrudServiceAsync.LoadDataByKeyAsync(key)).ToAjaxResult();
86+
8387
}
8488

8589
[Description("异步更新")]
@@ -101,7 +105,7 @@ public virtual async Task<AjaxResult> DeleteAsync(TPrimaryKey key)
101105

102106
[Description("异步得到分页")]
103107
[HttpPost]
104-
publicasyncTask<PageList<IPagedListDto>>GetPageAsync([FromBody]PageRequestrequest)
108+
publicvirtualasyncTask<PageList<IPagedListDto>>GetPageAsync([FromBody]PageRequestrequest)
105109
{
106110
return(awaitCrudServiceAsync.GetPageAsync(request)).ToPageList();
107111

@@ -113,10 +117,15 @@ public async Task<PageList<IPagedListDto>> GetPageAsync([FromBody] PageRequest r
113117
/// <param name="dto"></param>
114118
[Description("异步创建或更新")]
115119
[HttpPost]
116-
publicasyncTask<AjaxResult>CreateOrUpdateAsync([FromBody]IInputDtodto)
120+
publicvirtualasyncTask<AjaxResult>CreateOrUpdateAsync([FromBody]IInputDtodto)
117121
{
118122
return(awaitCrudServiceAsync.CreateOrUpdateAsync(dto)).ToAjaxResult();
119123
}
124+
125+
126+
127+
128+
120129
}
121130

122131

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp