FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Blog.Core/Blog.Core.Model/MessageModel.cs at master · BaseCoreVueProject/Blog.Core · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
BaseCoreVueProject
/
Blog.Core
Public
forked from
anjoy8/Blog.Core
Notifications
You must be signed in to change notification settings
Fork
16
Star
62
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Blog.Core
/
Blog.Core.Model
/
MessageModel.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
98 lines (96 loc) · 2.85 KB
Breadcrumbs
Blog.Core
/
Blog.Core.Model
/
MessageModel.cs
Copy path
File metadata and controls
98 lines (96 loc) · 2.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
namespace
Blog
.
Core
.
Model
{
/// <summary>
/// 通用返回信息类
/// </summary>
public
class
MessageModel
<
T
>
{
/// <summary>
/// 状态码
/// </summary>
public
int
status
{
get
;
set
;
}
=
200
;
/// <summary>
/// 操作是否成功
/// </summary>
public
bool
success
{
get
;
set
;
}
=
false
;
/// <summary>
/// 返回信息
/// </summary>
public
string
msg
{
get
;
set
;
}
=
""
;
/// <summary>
/// 开发者信息
/// </summary>
public
string
msgDev
{
get
;
set
;
}
/// <summary>
/// 返回数据集合
/// </summary>
public
T
response
{
get
;
set
;
}
/// <summary>
/// 返回成功
/// </summary>
/// <param name="msg">消息</param>
/// <returns></returns>
public
static
MessageModel
<
T
>
Success
(
string
msg
)
{
return
Message
(
true
,
msg
,
default
)
;
}
/// <summary>
/// 返回成功
/// </summary>
/// <param name="msg">消息</param>
/// <param name="response">数据</param>
/// <returns></returns>
public
static
MessageModel
<
T
>
Success
(
string
msg
,
T
response
)
{
return
Message
(
true
,
msg
,
response
)
;
}
/// <summary>
/// 返回失败
/// </summary>
/// <param name="msg">消息</param>
/// <returns></returns>
public
static
MessageModel
<
T
>
Fail
(
string
msg
)
{
return
Message
(
false
,
msg
,
default
)
;
}
/// <summary>
/// 返回失败
/// </summary>
/// <param name="msg">消息</param>
/// <param name="response">数据</param>
/// <returns></returns>
public
static
MessageModel
<
T
>
Fail
(
string
msg
,
T
response
)
{
return
Message
(
false
,
msg
,
response
)
;
}
/// <summary>
/// 返回消息
/// </summary>
/// <param name="success">失败/成功</param>
/// <param name="msg">消息</param>
/// <param name="response">数据</param>
/// <returns></returns>
public
static
MessageModel
<
T
>
Message
(
bool
success
,
string
msg
,
T
response
)
{
return
new
MessageModel
<
T
>
(
)
{
msg
=
msg
,
response
=
response
,
success
=
success
}
;
}
}
public
class
MessageModel
{
/// <summary>
/// 状态码
/// </summary>
public
int
status
{
get
;
set
;
}
=
200
;
/// <summary>
/// 操作是否成功
/// </summary>
public
bool
success
{
get
;
set
;
}
=
false
;
/// <summary>
/// 返回信息
/// </summary>
public
string
msg
{
get
;
set
;
}
=
""
;
/// <summary>
/// 返回数据集合
/// </summary>
public
object
response
{
get
;
set
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL