From 49b9074711b2ca28c0457146dcdf4437d8af9f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=A9=89=E5=A9=B7?= <1029854305@qq.com> Date: Thu, 18 Jul 2024 20:45:57 +0800 Subject: [PATCH] .. --- ...23\344\270\212\344\270\213\346\226\207.md" | 3 +- .../20240704.md" | 0 ...50\345\206\214\346\216\245\345\217\243.md" | 26 ++++++++++++ .../20240705.md" | 0 ...36\344\275\223\346\250\241\345\236\213.md" | 21 ++++++++++ .../20240708.md" | 0 ...50\345\206\214\347\231\273\345\275\225.md" | 40 +++++++++++++++++++ 7 files changed, 89 insertions(+), 1 deletion(-) rename "\347\231\275\345\251\211\345\251\267/20240703.md" => "\347\231\275\345\251\211\345\251\267/20240703\346\225\260\346\215\256\345\272\223\344\270\212\344\270\213\346\226\207.md" (91%) delete mode 100644 "\347\231\275\345\251\211\345\251\267/20240704.md" create mode 100644 "\347\231\275\345\251\211\345\251\267/20240704\345\256\236\347\216\260\346\263\250\345\206\214\346\216\245\345\217\243.md" delete mode 100644 "\347\231\275\345\251\211\345\251\267/20240705.md" create mode 100644 "\347\231\275\345\251\211\345\251\267/20240705\351\205\215\347\275\256\345\256\236\344\275\223\346\250\241\345\236\213.md" delete mode 100644 "\347\231\275\345\251\211\345\251\267/20240708.md" create mode 100644 "\347\231\275\345\251\211\345\251\267/20240708\344\270\232\345\212\241\345\210\206\346\225\243\344\272\216\344\270\215\345\220\214\345\261\202\347\272\247\346\263\250\345\206\214\347\231\273\345\275\225.md" diff --git "a/\347\231\275\345\251\211\345\251\267/20240703.md" "b/\347\231\275\345\251\211\345\251\267/20240703\346\225\260\346\215\256\345\272\223\344\270\212\344\270\213\346\226\207.md" similarity index 91% rename from "\347\231\275\345\251\211\345\251\267/20240703.md" rename to "\347\231\275\345\251\211\345\251\267/20240703\346\225\260\346\215\256\345\272\223\344\270\212\344\270\213\346\226\207.md" index 9f964c5..f4f6482 100644 --- "a/\347\231\275\345\251\211\345\251\267/20240703.md" +++ "b/\347\231\275\345\251\211\345\251\267/20240703\346\225\260\346\215\256\345\272\223\344\270\212\344\270\213\346\226\207.md" @@ -7,6 +7,7 @@ dotnet add package Npgsql.EntityFrameworkCore.PostgreSQl 添加 PostgreSQL 数 - Admin2024.Api - Admin2024.Api.csproj false + ## 数据库联系上下文 - Admin2024.EntityFrameworkCore @@ -18,7 +19,7 @@ dotnet add package Npgsql.EntityFrameworkCore.PostgreSQl 添加 PostgreSQL 数 - dotnet build 初始化命令 - dotnet add reference ..\Admin2024.Domain\ 引入命令 - dotnet add package Microsoft.EntityFrameworkCore.Design - - dotnet ef migrations add Init_Rbac -p .\Admin2024.EntityFrameworkCore -s .\Admin2024.Api 数据迁移 + - dotnet ef migrations add name -p .\Admin2024.EntityFrameworkCore -s .\Admin2024.Api 数据迁移 - dotnet ef database update -p .\admin2024.entityframeworkcore -s .\admin2024.api - Admin2024.Api 启动项目 diff --git "a/\347\231\275\345\251\211\345\251\267/20240704.md" "b/\347\231\275\345\251\211\345\251\267/20240704.md" deleted file mode 100644 index e69de29..0000000 diff --git "a/\347\231\275\345\251\211\345\251\267/20240704\345\256\236\347\216\260\346\263\250\345\206\214\346\216\245\345\217\243.md" "b/\347\231\275\345\251\211\345\251\267/20240704\345\256\236\347\216\260\346\263\250\345\206\214\346\216\245\345\217\243.md" new file mode 100644 index 0000000..80bfcf0 --- /dev/null +++ "b/\347\231\275\345\251\211\345\251\267/20240704\345\256\236\347\216\260\346\263\250\345\206\214\346\216\245\345\217\243.md" @@ -0,0 +1,26 @@ +## +- Admin2024.Domain + - Entity + - System + - ApuuUser.cs //注册 +- Admin2024.Application.Contracts + - AppUser + - AppUserDto.cs + - CreateAppUserDto.cs + - IAppUserAppService.cs //接口 + - UpdateAppUseDto.cs +- Admin2024.Application //实现Admin2024.Application.Contracts + - dotnet add .\back_end\src\Admin2024.Application\ reference .\back_end\src\Admin2024.Application.Contracts\ //引用其他文件命令 + - dotnet add .\back_end\src\Admin2024.Application\ reference .\back_end\src\Admin2024.Domain\ //引用其他文件命令 + - AppUser + - AppUserAppService.cs //注册实现 +- Admin2024.EntityFrameworkCore //实现 Admain2024.Application-AppUser-AppUserAppService.cs + - Repository + - EfRepositoty.cs +- Admain2024.Api //注册以上 +- dotnet add .\back_end\src\Admin2024.Api\ reference .\back_end\src\Admin2024.Domain\ //引用其他文件命令 +- dotnet add .\back_end\src\Admin2024.Api\ reference .\back_end\src\Admin2024.Application.Contracts\ +- dotnet add .\back_end\src\Admin2024.Api\ reference .\back_end\src\Admin2024.Application\ + - Startup.cs + - Controllers + - UserController.cs \ No newline at end of file diff --git "a/\347\231\275\345\251\211\345\251\267/20240705.md" "b/\347\231\275\345\251\211\345\251\267/20240705.md" deleted file mode 100644 index e69de29..0000000 diff --git "a/\347\231\275\345\251\211\345\251\267/20240705\351\205\215\347\275\256\345\256\236\344\275\223\346\250\241\345\236\213.md" "b/\347\231\275\345\251\211\345\251\267/20240705\351\205\215\347\275\256\345\256\236\344\275\223\346\250\241\345\236\213.md" new file mode 100644 index 0000000..f3f5e02 --- /dev/null +++ "b/\347\231\275\345\251\211\345\251\267/20240705\351\205\215\347\275\256\345\256\236\344\275\223\346\250\241\345\236\213.md" @@ -0,0 +1,21 @@ +配置实体 +## 创建并配置模型 +- IEntityTypeConfiguration 如何实现 + 1. - Admin2024.EntityFrameworkCore + - EntityConfiguration + - AppUserConfiguration.cs //配置表名 + - BaseEntityConfiguration.cs //公共部分 + - Admin2024DbContext.cs + protected override void OnModelCreating(ModelBuilder builder) + { + builder.ApplyConfigurationsFromAssembly(typeof (AppUserConfiguration).Assembly); + } + +## 生成迁移文件 同步到数据库 + - dotnet ef migrations add name -p .\src\Admin2024.EntityFrameworkCore -s .\src\Admin2024.api + - dotnet ef database update -p .\src\Admin2024.EntityFrameworkCore -s .\src\Admin2024.api +SELECT * FROM app_user; +## 生成jwt token + +## 自动获取时间 + GETDATE() 是 SQL Server 的函数,用于获取当前数据库系统的日期和时间。如果您使用的是其他数据库系统,可能需要使用不同的函数,例如 MySQL 使用 CURRENT_TIMESTAMP,PostgreSQL 使用 now() \ No newline at end of file diff --git "a/\347\231\275\345\251\211\345\251\267/20240708.md" "b/\347\231\275\345\251\211\345\251\267/20240708.md" deleted file mode 100644 index e69de29..0000000 diff --git "a/\347\231\275\345\251\211\345\251\267/20240708\344\270\232\345\212\241\345\210\206\346\225\243\344\272\216\344\270\215\345\220\214\345\261\202\347\272\247\346\263\250\345\206\214\347\231\273\345\275\225.md" "b/\347\231\275\345\251\211\345\251\267/20240708\344\270\232\345\212\241\345\210\206\346\225\243\344\272\216\344\270\215\345\220\214\345\261\202\347\272\247\346\263\250\345\206\214\347\231\273\345\275\225.md" new file mode 100644 index 0000000..61fb39f --- /dev/null +++ "b/\347\231\275\345\251\211\345\251\267/20240708\344\270\232\345\212\241\345\210\206\346\225\243\344\272\216\344\270\215\345\220\214\345\261\202\347\272\247\346\263\250\345\206\214\347\231\273\345\275\225.md" @@ -0,0 +1,40 @@ +查杀服务器病毒 +--- 服务器 + +dotnet ef database update -p .\back_end\src\admin2024.Domain -s .\back_end\src\admin2024.api + +关于业务分散在不同层级 + +- Admin2024.Domain + - DomainService + - IAppUserDomainService.cs + - ModifyPassword + - Login + - Create + - AppUserDomainService.cs 实现 + -ModifyPassword 修改密码 + //修改密码的操作大部分在领域类型中完成 + //领域服务中,只完成持久化 + - Login //登录 + - Create //修改注册 + +- Admin2024.Application.Contracts + - AppUser + - LoginDto.cs + - IAppUserAppSerivice.cs + +- Admin2024.Application + - AppUser + - AppUserAppService.cs 调用LoginDto.cs/IAppUserAppSerivice.cs + +- Admain2024.Domain + - Interface + - IRepository.cs + IQueryable Table{ get; } + +- Admain2024.EntityFarmeworkCore + - Repository + - EfRepository.cs 实现IRepository.cs + +- Admin2024.Api + - startup.cs //注册 \ No newline at end of file -- Gitee