From 50999c7f5d27c606c144a77eb75bcfc867d619b3 Mon Sep 17 00:00:00 2001 From: zpc Date: Sun, 8 Sep 2024 22:19:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HuanMengProject.sln | 11 ++---- .../PhoneAccount/PhoneAccountLogin.cs | 18 +++------- .../HuanMeng.MiaoYu.WebApiAOT/Dockerfile | 29 --------------- .../HuanMeng.MiaoYu.WebApiAOT.csproj | 17 --------- .../HuanMeng.MiaoYu.WebApiAOT.http | 11 ------ .../HuanMeng.MiaoYu.WebApiAOT/Program.cs | 35 ------------------- .../Properties/launchSettings.json | 24 ------------- .../appsettings.Development.json | 8 ----- .../appsettings.json | 9 ----- 9 files changed, 6 insertions(+), 156 deletions(-) delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/Dockerfile delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.csproj delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.http delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/Program.cs delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/Properties/launchSettings.json delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.Development.json delete mode 100644 src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.json diff --git a/HuanMengProject.sln b/HuanMengProject.sln index 744faef..a5c77ca 100644 --- a/HuanMengProject.sln +++ b/HuanMengProject.sln @@ -51,11 +51,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决 README.md = README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HuanMeng.MiaoYu.WebApiAOT", "src\2-api\HuanMeng.MiaoYu.WebApiAOT\HuanMeng.MiaoYu.WebApiAOT.csproj", "{4EEC3C12-633D-431C-9C92-73C00D8CACBB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HuanMeng.PaymentTest", "src\5-console\HuanMeng.PaymentTest\HuanMeng.PaymentTest.csproj", "{AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuanMeng.PaymentTest", "src\5-console\HuanMeng.PaymentTest\HuanMeng.PaymentTest.csproj", "{AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuanMeng.MiaoYu.WebPayApi", "src\2-api\HuanMeng.MiaoYu.WebPayApi\HuanMeng.MiaoYu.WebPayApi.csproj", "{A7AFE67D-5206-4393-BD98-F180ECD5F447}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HuanMeng.MiaoYu.WebPayApi", "src\2-api\HuanMeng.MiaoYu.WebPayApi\HuanMeng.MiaoYu.WebPayApi.csproj", "{A7AFE67D-5206-4393-BD98-F180ECD5F447}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -107,10 +105,6 @@ Global {CF7FEDBA-FC1A-4D6D-92F1-6882B5143E0A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF7FEDBA-FC1A-4D6D-92F1-6882B5143E0A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF7FEDBA-FC1A-4D6D-92F1-6882B5143E0A}.Release|Any CPU.Build.0 = Release|Any CPU - {4EEC3C12-633D-431C-9C92-73C00D8CACBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4EEC3C12-633D-431C-9C92-73C00D8CACBB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4EEC3C12-633D-431C-9C92-73C00D8CACBB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4EEC3C12-633D-431C-9C92-73C00D8CACBB}.Release|Any CPU.Build.0 = Release|Any CPU {AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -142,7 +136,6 @@ Global {6E79742F-1E56-4B7D-94E8-B509D43561FA} = {DD14191F-22CE-48D8-A944-B8A41C97ACD4} {729950F2-71EE-42C0-8B46-295740DE20BA} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3} {CF7FEDBA-FC1A-4D6D-92F1-6882B5143E0A} = {8D39E84B-2810-41D7-AFE6-0A58E09E34C3} - {4EEC3C12-633D-431C-9C92-73C00D8CACBB} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3} {AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B} = {F34C5BC4-8810-4D6A-B003-AFE12D7ED4BA} {A7AFE67D-5206-4393-BD98-F180ECD5F447} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3} EndGlobalSection diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Users/UserAccount/PhoneAccount/PhoneAccountLogin.cs b/src/0-core/HuanMeng.MiaoYu.Code/Users/UserAccount/PhoneAccount/PhoneAccountLogin.cs index 0f935d9..fdd5e3c 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Users/UserAccount/PhoneAccount/PhoneAccountLogin.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Users/UserAccount/PhoneAccount/PhoneAccountLogin.cs @@ -1,26 +1,16 @@ -using HuanMeng.DotNetCore.Base; using HuanMeng.MiaoYu.Code.AppExtend; -using HuanMeng.MiaoYu.Code.DataAccess; using HuanMeng.MiaoYu.Code.TencentUtile; using HuanMeng.MiaoYu.Code.Users.UserAccount.Contract; -using HuanMeng.MiaoYu.Code.Users.UserAccount.VerificationCodeManager; -using HuanMeng.MiaoYu.Model.DbSqlServer.Db_MiaoYu; - -using Microsoft.EntityFrameworkCore; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace HuanMeng.MiaoYu.Code.Users.UserAccount.PhoneAccount { /// - /// 手机号登录 + /// 手机号登录 /// - /// 手机号 + /// + /// + /// public class PhoneAccountLogin(IVerificationCodeManager memoryVerificationCodeManager, TencentConfig tencentConfig, DAO dao) : IUserAccount { /// diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Dockerfile b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Dockerfile deleted file mode 100644 index fdedf50..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base -USER app -WORKDIR /app -EXPOSE 8080 - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -# Install clang/zlib1g-dev dependencies for publishing to native -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - clang zlib1g-dev -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.csproj", "src/2-api/HuanMeng.MiaoYu.WebApiAOT/"] -RUN dotnet restore "./src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.csproj" -COPY . . -WORKDIR "/src/src/2-api/HuanMeng.MiaoYu.WebApiAOT" -RUN dotnet build "./HuanMeng.MiaoYu.WebApiAOT.csproj" -c $BUILD_CONFIGURATION -o /app/build - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./HuanMeng.MiaoYu.WebApiAOT.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=true - -FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS final -WORKDIR /app -EXPOSE 8080 -COPY --from=publish /app/publish . -ENTRYPOINT ["./HuanMeng.MiaoYu.WebApiAOT"] \ No newline at end of file diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.csproj b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.csproj deleted file mode 100644 index b1511ae..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net8.0 - enable - enable - true - true - Linux - ..\..\.. - - - - - - - diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.http b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.http deleted file mode 100644 index fc964b0..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/HuanMeng.MiaoYu.WebApiAOT.http +++ /dev/null @@ -1,11 +0,0 @@ -@HuanMeng.MiaoYu.WebApiAOT_HostAddress = http://localhost:5233 - -GET {{HuanMeng.MiaoYu.WebApiAOT_HostAddress}}/todos/ -Accept: application/json - -### - -GET {{HuanMeng.MiaoYu.WebApiAOT_HostAddress}}/todos/1 -Accept: application/json - -### diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Program.cs b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Program.cs deleted file mode 100644 index d3b48c9..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Program.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Text.Json.Serialization; - -var builder = WebApplication.CreateSlimBuilder(args); - -builder.Services.ConfigureHttpJsonOptions(options => -{ - options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default); -}); - -var app = builder.Build(); - -var sampleTodos = new Todo[] { - new(1, "Walk the dog"), - new(2, "Do the dishes", DateOnly.FromDateTime(DateTime.Now)), - new(3, "Do the laundry", DateOnly.FromDateTime(DateTime.Now.AddDays(1))), - new(4, "Clean the bathroom"), - new(5, "Clean the car", DateOnly.FromDateTime(DateTime.Now.AddDays(2))) -}; - -var todosApi = app.MapGroup("/todos"); -todosApi.MapGet("/", () => sampleTodos); -todosApi.MapGet("/{id}", (int id) => - sampleTodos.FirstOrDefault(a => a.Id == id) is { } todo - ? Results.Ok(todo) - : Results.NotFound()); - -app.Run(); - -public record Todo(int Id, string? Title, DateOnly? DueBy = null, bool IsComplete = false); - -[JsonSerializable(typeof(Todo[]))] -internal partial class AppJsonSerializerContext : JsonSerializerContext -{ - -} diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Properties/launchSettings.json b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Properties/launchSettings.json deleted file mode 100644 index b1faefb..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/Properties/launchSettings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "profiles": { - "http": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "todos", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5233" - }, - "Container (Dockerfile)": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/todos", - "environmentVariables": { - "ASPNETCORE_HTTP_PORTS": "8080" - }, - "publishAllPorts": true - } - }, - "$schema": "http://json.schemastore.org/launchsettings.json" -} \ No newline at end of file diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.Development.json b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.json b/src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.json deleted file mode 100644 index 10f68b8..0000000 --- a/src/2-api/HuanMeng.MiaoYu.WebApiAOT/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -}