Skip to content

Commit 8bc8aa9

Browse files
nsnailtk
andauthored
feat: ✨ 框架代码同步 (#148)
[skip ci] Co-authored-by: tk <fiyne1a@dingtalk.com>
1 parent d00f0d2 commit 8bc8aa9

File tree

121 files changed

+2339
-1467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2339
-1467
lines changed

assets/seed-data/Sys_Menu.json

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"Component": "sys/user",
2525
"Icon": "el-icon-user",
2626
"Id": 373837957840901,
27-
"Name": "sys-user",
27+
"Name": "sys/user",
2828
"ParentId": 373837917724677,
2929
"Path": "/sys/user",
3030
"Sort": 100,
@@ -35,7 +35,7 @@
3535
"Component": "sys/role",
3636
"Icon": "sc-icon-role",
3737
"Id": 373838018527237,
38-
"Name": "sys-role",
38+
"Name": "sys/role",
3939
"ParentId": 373837917724677,
4040
"Path": "/sys/role",
4141
"Sort": 99,
@@ -46,7 +46,7 @@
4646
"Component": "sys/dept",
4747
"Icon": "sc-icon-dept",
4848
"Id": 373838045605893,
49-
"Name": "sys-dept",
49+
"Name": "sys/dept",
5050
"ParentId": 373837917724677,
5151
"Path": "/sys/dept",
5252
"Sort": 98,
@@ -57,7 +57,7 @@
5757
"Component": "sys/menu",
5858
"Icon": "el-icon-fold",
5959
"Id": 373838070898693,
60-
"Name": "sys-menu",
60+
"Name": "sys/menu",
6161
"ParentId": 373837917724677,
6262
"Path": "/sys/menu",
6363
"Sort": 97,
@@ -78,7 +78,7 @@
7878
"Component": "sys/config",
7979
"Icon": "el-icon-set-up",
8080
"Id": 380415005847557,
81-
"Name": "sys-config",
81+
"Name": "sys/config",
8282
"ParentId": 485278637670422,
8383
"Path": "/sys/config",
8484
"Sort": 100,
@@ -89,7 +89,7 @@
8989
"Component": "sys/job",
9090
"Icon": "sc-icon-ScheduledJob",
9191
"Id": 510067557638158,
92-
"Name": "sys-job",
92+
"Name": "sys/job",
9393
"ParentId": 485278637670422,
9494
"Path": "/sys/job",
9595
"Sort": 99,
@@ -100,7 +100,7 @@
100100
"Component": "sys/dic",
101101
"Icon": "sc-icon-dic",
102102
"Id": 375315654221829,
103-
"Name": "sys-dic",
103+
"Name": "sys/dic",
104104
"ParentId": 485278637670422,
105105
"Path": "/sys/dic",
106106
"Sort": 98,
@@ -111,7 +111,7 @@
111111
"Component": "sys/msg",
112112
"Icon": "el-icon-message",
113113
"Id": 482779610341392,
114-
"Name": "sys-msg",
114+
"Name": "sys/msg",
115115
"ParentId": 485278637670422,
116116
"Path": "/sys/msg",
117117
"Sort": 97,
@@ -122,7 +122,7 @@
122122
"Component": "sys/api",
123123
"Icon": "sc-icon-api",
124124
"Id": 397880678895621,
125-
"Name": "sys-api",
125+
"Name": "sys/api",
126126
"ParentId": 485278637670422,
127127
"Path": "/sys/api",
128128
"Sort": 96,
@@ -133,7 +133,7 @@
133133
"Component": "sys/cache",
134134
"Icon": "sc-icon-memory",
135135
"Id": 374911555702789,
136-
"Name": "sys-cache",
136+
"Name": "sys/cache",
137137
"ParentId": 485278637670422,
138138
"Path": "/sys/cache",
139139
"Sort": 95,
@@ -154,7 +154,7 @@
154154
"Component": "sys/log/operation",
155155
"Icon": "el-icon-pointer",
156156
"Id": 485285246504976,
157-
"Name": "sys-log-operation",
157+
"Name": "sys/log/operation",
158158
"ParentId": 374792687640581,
159159
"Path": "/sys/log/operation",
160160
"Sort": 100,
@@ -165,7 +165,7 @@
165165
"Component": "sys/log/login",
166166
"Icon": "sc-icon-OpenDoor",
167167
"Id": 485285246504970,
168-
"Name": "sys-log-login",
168+
"Name": "sys/log/login",
169169
"ParentId": 374792687640581,
170170
"Path": "/sys/log/login",
171171
"Sort": 99,
@@ -186,7 +186,7 @@
186186
"Component": "dev/code",
187187
"Icon": "sc-icon-code2",
188188
"Id": 373838147022853,
189-
"Name": "dev-code",
189+
"Name": "dev/code",
190190
"ParentId": 373838105399301,
191191
"Path": "/dev/code",
192192
"Sort": 100,
@@ -197,10 +197,20 @@
197197
"Id": 482777529417739,
198198
"ParentId": 373838105399301,
199199
"Icon": "el-icon-eleme-filled",
200-
"Name": "dev-element",
201-
"Path": "https://element-plus.gitee.io/zh-CN/component/button.html",
200+
"Name": "dev/element",
201+
"Path": "http://element-plus.org/zh-CN/component/overview.html",
202202
"Sort": 99,
203203
"Title": "Element",
204204
"Type": 3,
205+
},
206+
{
207+
"Id": 560217289232398,
208+
"ParentId": 373838105399301,
209+
"Icon": "sc-icon-FreeSql",
210+
"Name": "dev/freesql",
211+
"Path": "https://freesql.net/guide",
212+
"Sort": 99,
213+
"Title": "FreeSql",
214+
"Type": 3,
205215
}
206216
]

assets/seed-data/Sys_RoleApi.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,13 @@
3434
{
3535
"ApiId": "api/sys/site.msg/set.site.msg.status",
3636
"RoleId": 371729946431493,
37+
},
38+
{
39+
"ApiId": "api/sys/user/get.session.user.app.config",
40+
"RoleId": 371729946431493,
41+
},
42+
{
43+
"ApiId": "api/sys/user/set.session.user.app.config",
44+
"RoleId": 371729946431493,
3745
}
3846
]

assets/seed-data/Sys_User.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,13 @@
66
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
77
"Token": "A9AFD92E-A33D-4152-9A6C-A9C141D24887",
88
"UserName": "root"
9+
},
10+
{
11+
"DeptId": 372119301627909,
12+
"Enabled": true,
13+
"Id": 560217289236492,
14+
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
15+
"Token": "4208EA97-B32F-4E39-A290-4C0D27B61EBF",
16+
"UserName": "user"
917
}
1018
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[
22
{
33
"Id": 370942943322181
4+
},
5+
{
6+
"Id": 560217289236492
47
}
58
]

assets/seed-data/Sys_UserRole.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{
33
"RoleId": 370943613149253,
44
"UserId": 370942943322181
5+
},
6+
{
7+
"RoleId": 371729946431493,
8+
"UserId": 560217289236492
59
}
610
]

src/backend/NetAdmin.AdmServer.Tests/AllTests.cs

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,13 @@ public async Task<DateTime> GetServerUtcTimeAsync()
954954
return default;
955955
}
956956

957+
/// <inheritdoc />
958+
[Fact]
959+
public Task<GetSessionUserAppConfigRsp> GetSessionUserAppConfigAsync()
960+
{
961+
return default;
962+
}
963+
957964
/// <inheritdoc />
958965
[Fact]
959966
public async Task<string> GetVersionAsync()
@@ -1342,7 +1349,7 @@ public Task<UserInfoRsp> RegisterAsync(RegisterUserReq req)
13421349
/// <inheritdoc />
13431350
[InlineData(default)]
13441351
[Theory]
1345-
public Task<uint> ResetPasswordAsync(ResetPasswordReq req)
1352+
public Task<int> ResetPasswordAsync(ResetPasswordReq req)
13461353
{
13471354
return default;
13481355
}
@@ -1363,6 +1370,14 @@ public Task<UserInfoRsp> SetAvatarAsync(SetAvatarReq req)
13631370
return default;
13641371
}
13651372

1373+
/// <inheritdoc />
1374+
[InlineData(default)]
1375+
[Theory]
1376+
public Task<int> SetDisplayDashboardAsync(SetDisplayDashboardReq req)
1377+
{
1378+
return default;
1379+
}
1380+
13661381
/// <inheritdoc />
13671382
[InlineData(default)]
13681383
[Theory]
@@ -1374,31 +1389,47 @@ public Task<UserInfoRsp> SetEmailAsync(SetEmailReq req)
13741389
/// <inheritdoc />
13751390
[InlineData(default)]
13761391
[Theory]
1377-
public Task SetEnabledAsync(SetDeptEnabledReq req)
1392+
public Task<int> SetEnabledAsync(SetDeptEnabledReq req)
1393+
{
1394+
return default;
1395+
}
1396+
1397+
/// <inheritdoc />
1398+
[InlineData(default)]
1399+
[Theory]
1400+
public Task<int> SetEnabledAsync(SetConfigEnabledReq req)
13781401
{
13791402
return default;
13801403
}
13811404

13821405
/// <inheritdoc />
13831406
[InlineData(default)]
13841407
[Theory]
1385-
public Task SetEnabledAsync(SetRoleEnabledReq req)
1408+
public Task<int> SetEnabledAsync(SetRoleEnabledReq req)
13861409
{
13871410
return default;
13881411
}
13891412

13901413
/// <inheritdoc />
13911414
[InlineData(default)]
13921415
[Theory]
1393-
public Task SetEnabledAsync(SetJobEnabledReq req)
1416+
public Task<int> SetEnabledAsync(SetJobEnabledReq req)
13941417
{
13951418
return default;
13961419
}
13971420

13981421
/// <inheritdoc />
13991422
[InlineData(default)]
14001423
[Theory]
1401-
public Task SetEnabledAsync(SetUserEnabledReq req)
1424+
public Task<int> SetEnabledAsync(SetUserEnabledReq req)
1425+
{
1426+
return default;
1427+
}
1428+
1429+
/// <inheritdoc />
1430+
[InlineData(default)]
1431+
[Theory]
1432+
public Task<int> SetIgnorePermissionControlAsync(SetIgnorePermissionControlReq req)
14021433
{
14031434
return default;
14041435
}
@@ -1414,7 +1445,15 @@ public Task<UserInfoRsp> SetMobileAsync(SetMobileReq req)
14141445
/// <inheritdoc />
14151446
[InlineData(default)]
14161447
[Theory]
1417-
public Task<uint> SetPasswordAsync(SetPasswordReq req)
1448+
public Task<int> SetPasswordAsync(SetPasswordReq req)
1449+
{
1450+
return default;
1451+
}
1452+
1453+
/// <inheritdoc />
1454+
[InlineData(default)]
1455+
[Theory]
1456+
public Task<int> SetSessionUserAppConfigAsync(SetSessionUserAppConfigReq req)
14181457
{
14191458
return default;
14201459
}

src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_JobRecord.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace NetAdmin.Domain.DbMaps.Sys;
99
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(JobId)}_{nameof(TimeId)}", $"{nameof(JobId)},{nameof(TimeId)}", true)]
1010
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(CreatedTime), nameof(CreatedTime), false)]
1111
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(JobId), nameof(JobId), false)]
12+
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(HttpStatusCode), nameof(HttpStatusCode), false)]
1213
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_JobRecord))]
1314
public record Sys_JobRecord : LiteImmutableEntity
1415
{

src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_User.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void Register(TypeAdapterConfig config)
115115
? Array.Empty<Sys_Role>()
116116
: s.RoleIds.Select(x => new Sys_Role { Id = x }));
117117

118-
_ = config.ForType<EditSingleUserReq, Sys_User>()
118+
_ = config.ForType<EditUserReq, Sys_User>()
119119
.Map( //
120120
d => d.Password, s => s.PasswordText.NullOrEmpty() ? Guid.Empty : s.PasswordText.Pwd().Guid())
121121
.Map( //

src/backend/NetAdmin.Domain/DbMaps/Sys/Sys_UserProfile.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ namespace NetAdmin.Domain.DbMaps.Sys;
99
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_UserProfile))]
1010
public record Sys_UserProfile : VersionEntity, IRegister
1111
{
12+
/// <summary>
13+
/// 应用配置
14+
/// </summary>
15+
#if DBTYPE_SQLSERVER
16+
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
17+
#else
18+
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
19+
#endif
20+
[JsonIgnore]
21+
public virtual string AppConfig { get; init; }
22+
1223
/// <summary>
1324
/// 出生日期
1425
/// </summary>

src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetAllEntriesReq.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ public sealed record GetAllEntriesReq : DataAbstraction
88
/// <summary>
99
/// 数据库索引号
1010
/// </summary>
11-
public uint DbIndex { get; init; }
11+
public int DbIndex { get; init; }
1212
}

0 commit comments

Comments
 (0)