22 changed files with 481 additions and 7222 deletions
-
16src/Shentun.WebPeis.Application.Contracts/WebApiOutDto.cs
-
95src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
-
47src/Shentun.WebPeis.Application/WeChatHelper.cs
-
5src/Shentun.WebPeis.DbMigrator/appsettings.json
-
29src/Shentun.WebPeis.Domain/OpenIddict/OpenIddictDataSeedContributor.cs
-
2src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/数据库模型代码生成.txt
-
6856src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.Designer.cs
-
228src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.cs
-
34src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs
-
170src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs
-
11src/Shentun.WebPeis.HttpApi.Host/Filters/CustomerActionFilterAttribute.cs
-
43src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs
-
6src/Shentun.WebPeis.HttpApi.Host/appsettings.json
-
41test/Shentun.WebPeis.Application.Tests/PersonAppServiceTest.cs
-
24test/Shentun.WebPeis.Application.Tests/Shentun.WebPeis.Application.Tests.csproj
-
5test/Shentun.WebPeis.Application.Tests/WebPeisApplicationTestBase.cs
-
2test/Shentun.WebPeis.Application.Tests/appsettings.Development.json
-
43test/Shentun.WebPeis.Application.Tests/appsettings.json
-
2test/Shentun.WebPeis.Application.Tests/appsettings.secrets.json
-
12test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCorePersonAppServiceTest.cs
-
18test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/WebPeisEntityFrameworkCoreTestModule.cs
-
2test/Shentun.WebPeis.TestBase/WebPeisTestBaseModule.cs
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Shentun.WebPeis |
||||
|
{ |
||||
|
public class WebApiOutDto<T> |
||||
|
{ |
||||
|
public int Code { get; set; } |
||||
|
public string Message { get; set; } |
||||
|
public T? Data { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
||||
6856
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,228 +0,0 @@ |
|||||
using System; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
|
|
||||
#nullable disable |
|
||||
|
|
||||
namespace Shentun.WebPeis.Migrations |
|
||||
{ |
|
||||
/// <inheritdoc />
|
|
||||
public partial class updatePerson : Migration |
|
||||
{ |
|
||||
/// <inheritdoc />
|
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropIndex( |
|
||||
name: "ix_person_name", |
|
||||
table: "person"); |
|
||||
|
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "email", |
|
||||
table: "person"); |
|
||||
|
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "is_active", |
|
||||
table: "person"); |
|
||||
|
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "mobile_telephone", |
|
||||
table: "person"); |
|
||||
|
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "password_hash", |
|
||||
table: "person"); |
|
||||
|
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "person_name", |
|
||||
table: "person"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "nation_id", |
|
||||
table: "person", |
|
||||
type: "text", |
|
||||
nullable: false, |
|
||||
defaultValue: "", |
|
||||
comment: "民族编号", |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "text", |
|
||||
oldNullable: true, |
|
||||
oldComment: "民族编号"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<char>( |
|
||||
name: "is_allow_bind", |
|
||||
table: "person", |
|
||||
type: "character(1)", |
|
||||
maxLength: 1, |
|
||||
nullable: false, |
|
||||
defaultValue: '\0', |
|
||||
oldClrType: typeof(char), |
|
||||
oldType: "character(1)", |
|
||||
oldMaxLength: 1, |
|
||||
oldNullable: true); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "id_type_id", |
|
||||
table: "person", |
|
||||
type: "character(2)", |
|
||||
fixedLength: true, |
|
||||
maxLength: 2, |
|
||||
nullable: false, |
|
||||
defaultValue: "", |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "character(2)", |
|
||||
oldFixedLength: true, |
|
||||
oldMaxLength: 2, |
|
||||
oldNullable: true); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "id_no", |
|
||||
table: "person", |
|
||||
type: "character varying(18)", |
|
||||
maxLength: 18, |
|
||||
nullable: false, |
|
||||
defaultValue: "", |
|
||||
comment: "身份证号", |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "character varying(18)", |
|
||||
oldMaxLength: 18, |
|
||||
oldNullable: true, |
|
||||
oldComment: "身份证号"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "country_code", |
|
||||
table: "person", |
|
||||
type: "character varying(3)", |
|
||||
maxLength: 3, |
|
||||
nullable: false, |
|
||||
defaultValue: "", |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "character varying(3)", |
|
||||
oldMaxLength: 3, |
|
||||
oldNullable: true); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<DateTime>( |
|
||||
name: "birth_date", |
|
||||
table: "person", |
|
||||
type: "timestamp(6) without time zone", |
|
||||
nullable: false, |
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), |
|
||||
comment: "出生日期", |
|
||||
oldClrType: typeof(DateTime), |
|
||||
oldType: "timestamp(6) without time zone", |
|
||||
oldNullable: true, |
|
||||
oldComment: "出生日期"); |
|
||||
} |
|
||||
|
|
||||
/// <inheritdoc />
|
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "nation_id", |
|
||||
table: "person", |
|
||||
type: "text", |
|
||||
nullable: true, |
|
||||
comment: "民族编号", |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "text", |
|
||||
oldComment: "民族编号"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<char>( |
|
||||
name: "is_allow_bind", |
|
||||
table: "person", |
|
||||
type: "character(1)", |
|
||||
maxLength: 1, |
|
||||
nullable: true, |
|
||||
oldClrType: typeof(char), |
|
||||
oldType: "character(1)", |
|
||||
oldMaxLength: 1); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "id_type_id", |
|
||||
table: "person", |
|
||||
type: "character(2)", |
|
||||
fixedLength: true, |
|
||||
maxLength: 2, |
|
||||
nullable: true, |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "character(2)", |
|
||||
oldFixedLength: true, |
|
||||
oldMaxLength: 2); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "id_no", |
|
||||
table: "person", |
|
||||
type: "character varying(18)", |
|
||||
maxLength: 18, |
|
||||
nullable: true, |
|
||||
comment: "身份证号", |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "character varying(18)", |
|
||||
oldMaxLength: 18, |
|
||||
oldComment: "身份证号"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "country_code", |
|
||||
table: "person", |
|
||||
type: "character varying(3)", |
|
||||
maxLength: 3, |
|
||||
nullable: true, |
|
||||
oldClrType: typeof(string), |
|
||||
oldType: "character varying(3)", |
|
||||
oldMaxLength: 3); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<DateTime>( |
|
||||
name: "birth_date", |
|
||||
table: "person", |
|
||||
type: "timestamp(6) without time zone", |
|
||||
nullable: true, |
|
||||
comment: "出生日期", |
|
||||
oldClrType: typeof(DateTime), |
|
||||
oldType: "timestamp(6) without time zone", |
|
||||
oldComment: "出生日期"); |
|
||||
|
|
||||
migrationBuilder.AddColumn<string>( |
|
||||
name: "email", |
|
||||
table: "person", |
|
||||
type: "character varying(50)", |
|
||||
maxLength: 50, |
|
||||
nullable: true, |
|
||||
comment: "email"); |
|
||||
|
|
||||
migrationBuilder.AddColumn<char>( |
|
||||
name: "is_active", |
|
||||
table: "person", |
|
||||
type: "character(1)", |
|
||||
maxLength: 1, |
|
||||
nullable: true); |
|
||||
|
|
||||
migrationBuilder.AddColumn<string>( |
|
||||
name: "mobile_telephone", |
|
||||
table: "person", |
|
||||
type: "character varying(50)", |
|
||||
maxLength: 50, |
|
||||
nullable: true, |
|
||||
comment: "手机号"); |
|
||||
|
|
||||
migrationBuilder.AddColumn<string>( |
|
||||
name: "password_hash", |
|
||||
table: "person", |
|
||||
type: "character varying(10)", |
|
||||
maxLength: 10, |
|
||||
nullable: true, |
|
||||
comment: "登录密码"); |
|
||||
|
|
||||
migrationBuilder.AddColumn<string>( |
|
||||
name: "person_name", |
|
||||
table: "person", |
|
||||
type: "character varying(30)", |
|
||||
maxLength: 30, |
|
||||
nullable: false, |
|
||||
defaultValue: "", |
|
||||
comment: "姓名"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "ix_person_name", |
|
||||
table: "person", |
|
||||
column: "person_name"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,12 +1,49 @@ |
|||||
using System; |
|
||||
|
using Shentun.WebPeis.Models; |
||||
|
using Shentun.WebPeis.Persons; |
||||
|
using Shentun.WebPeis.Wechats; |
||||
|
using System; |
||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.Linq; |
using System.Linq; |
||||
using System.Text; |
using System.Text; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Modularity; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Xunit; |
||||
|
using Xunit.Abstractions; |
||||
|
|
||||
namespace Shentun.WebPeis |
namespace Shentun.WebPeis |
||||
{ |
{ |
||||
internal class PersonAppServiceTest |
|
||||
|
public abstract class PersonAppServiceTest<TStartupModule> : WebPeisApplicationTestBase<TStartupModule> |
||||
|
where TStartupModule : IAbpModule |
||||
{ |
{ |
||||
|
private readonly IRepository<Person> _repository; |
||||
|
private readonly PersonAppService _appService; |
||||
|
//private readonly ITestOutputHelper _output;
|
||||
|
private readonly IUnitOfWorkManager _unitOfWorkManager; |
||||
|
public PersonAppServiceTest() |
||||
|
{ |
||||
|
//ITestOutputHelper testOutputHelper
|
||||
|
//_output = testOutputHelper;
|
||||
|
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); |
||||
|
_repository = GetRequiredService<IRepository<Person>>(); |
||||
|
_appService = GetRequiredService<PersonAppService>(); |
||||
|
//_output = GetRequiredService<ITestOutputHelper>();
|
||||
|
} |
||||
|
[Fact] |
||||
|
public async Task GetWechatUserTokenAsync() |
||||
|
{ |
||||
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
||||
|
{ |
||||
|
|
||||
|
var entity = new WechatUserJsCodeInputDto() |
||||
|
{ |
||||
|
JsCode = "0c1yTa0w3mErQ23eot3w3ocsxw4yTa0P" |
||||
|
}; |
||||
|
|
||||
|
var newEntity = await _appService.GetWechatUserTokenAsync(entity); |
||||
|
await unitOfWork.CompleteAsync(); |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
{ |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
{ |
||||
|
//"Kestrel": { |
||||
|
// "Endpoints": { |
||||
|
// "Http": { |
||||
|
// "Url": "http://localhost:44382" |
||||
|
// }, |
||||
|
// "Https": { |
||||
|
// "Url": "https://localhost:44382" |
||||
|
// } |
||||
|
// } |
||||
|
//}, |
||||
|
"App": { |
||||
|
"SelfUrl": "https://localhost:44382", |
||||
|
"CorsOrigins": "https://*.WebPeis.com", |
||||
|
"RedirectAllowedUrls": "" |
||||
|
}, |
||||
|
|
||||
|
"ConnectionStrings": { |
||||
|
"Default": "Host=10.1.12.140;Port=5432;Database=WebPeis0520;User ID=postgres;Password=st123;" |
||||
|
}, |
||||
|
"AuthServer": { |
||||
|
"Authority": "https://localhost:44382", |
||||
|
"RequireHttpsMetadata": false, |
||||
|
"SwaggerClientId": "WebPeis_Swagger", |
||||
|
"WeChatClientId": "WeChatApp", |
||||
|
"WeChatClientSecret": "1234*^@" |
||||
|
}, |
||||
|
"StringEncryption": { |
||||
|
"DefaultPassPhrase": "rBfozS7zkeTYat2k" |
||||
|
}, |
||||
|
"WeChat": { |
||||
|
"SessionUrl": "https://api.weixin.qq.com/sns/jscode2session?", //微信小程序访问用户信息URL |
||||
|
"AppID": "wx6a8a4440a42c9466", //微信小程序要求的AppID |
||||
|
"AppSecret": "aae34bfef498906290a92318d0f7183d" //微信小程序要求的AppSecret |
||||
|
}, |
||||
|
"VirtualPaths": [ |
||||
|
{ |
||||
|
"PhysicsPath": "F:\\testimg", //体检报告物理路径 |
||||
|
"RequestPath": "/Report", //体检报告请求路径 |
||||
|
"Alias": "Report" //体检报告别名 |
||||
|
} |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
{ |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Shentun.WebPeis.EntityFrameworkCore.Applications |
||||
|
{ |
||||
|
public class EfCorePersonAppServiceTest:PersonAppServiceTest<WebPeisEntityFrameworkCoreTestModule> |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue