提交代码
This commit is contained in:
parent
418d9f8e5d
commit
50999c7f5d
|
|
@ -51,11 +51,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
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
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuanMeng.PaymentTest", "src\5-console\HuanMeng.PaymentTest\HuanMeng.PaymentTest.csproj", "{AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}"
|
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
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuanMeng.MiaoYu.WebPayApi", "src\2-api\HuanMeng.MiaoYu.WebPayApi\HuanMeng.MiaoYu.WebPayApi.csproj", "{A7AFE67D-5206-4393-BD98-F180ECD5F447}"
|
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
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}.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.ActiveCfg = Release|Any CPU
|
||||||
{CF7FEDBA-FC1A-4D6D-92F1-6882B5143E0A}.Release|Any CPU.Build.0 = 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.ActiveCfg = Debug|Any CPU
|
||||||
{AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B}.Debug|Any CPU.Build.0 = 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
|
{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}
|
{6E79742F-1E56-4B7D-94E8-B509D43561FA} = {DD14191F-22CE-48D8-A944-B8A41C97ACD4}
|
||||||
{729950F2-71EE-42C0-8B46-295740DE20BA} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3}
|
{729950F2-71EE-42C0-8B46-295740DE20BA} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3}
|
||||||
{CF7FEDBA-FC1A-4D6D-92F1-6882B5143E0A} = {8D39E84B-2810-41D7-AFE6-0A58E09E34C3}
|
{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}
|
{AC40ED0F-5DF0-4C50-9F71-47CA39A6C84B} = {F34C5BC4-8810-4D6A-B003-AFE12D7ED4BA}
|
||||||
{A7AFE67D-5206-4393-BD98-F180ECD5F447} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3}
|
{A7AFE67D-5206-4393-BD98-F180ECD5F447} = {0C0B6EB5-E41D-46D9-9F60-90D320A2EEF3}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,6 @@
|
||||||
using HuanMeng.DotNetCore.Base;
|
|
||||||
using HuanMeng.MiaoYu.Code.AppExtend;
|
using HuanMeng.MiaoYu.Code.AppExtend;
|
||||||
using HuanMeng.MiaoYu.Code.DataAccess;
|
|
||||||
using HuanMeng.MiaoYu.Code.TencentUtile;
|
using HuanMeng.MiaoYu.Code.TencentUtile;
|
||||||
using HuanMeng.MiaoYu.Code.Users.UserAccount.Contract;
|
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
|
namespace HuanMeng.MiaoYu.Code.Users.UserAccount.PhoneAccount
|
||||||
{
|
{
|
||||||
|
|
@ -20,7 +8,9 @@ namespace HuanMeng.MiaoYu.Code.Users.UserAccount.PhoneAccount
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 手机号登录
|
/// 手机号登录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="phone">手机号</param>
|
/// <param name="memoryVerificationCodeManager"></param>
|
||||||
|
/// <param name="tencentConfig"></param>
|
||||||
|
/// <param name="dao"></param>
|
||||||
public class PhoneAccountLogin(IVerificationCodeManager memoryVerificationCodeManager, TencentConfig tencentConfig, DAO dao) : IUserAccount
|
public class PhoneAccountLogin(IVerificationCodeManager memoryVerificationCodeManager, TencentConfig tencentConfig, DAO dao) : IUserAccount
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
|
||||||
<PublishAot>true</PublishAot>
|
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
|
||||||
<DockerfileContext>..\..\..</DockerfileContext>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
@ -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
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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"
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Microsoft.AspNetCore": "Warning"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Microsoft.AspNetCore": "Warning"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"AllowedHosts": "*"
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user