Skip to content

Commit

Permalink
demo
Browse files Browse the repository at this point in the history
  • Loading branch information
vipwan committed Nov 4, 2023
1 parent db4c0e8 commit 1a88a90
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
<ProjectReference Include="..\Biwen.AutoClassGen.Gen\Biwen.AutoClassGen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

</Project>
27 changes: 13 additions & 14 deletions Biwen.AutoClassGen.TestConsole/Classes.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using Biwen.AutoClassGen.TestConsole.Interfaces;

namespace Biwen.AutoClassGen.Models
{
/// <summary>
/// 分页请求
/// </summary>
[AutoGen("QueryRequest", "Biwen.AutoClassGen.Models")]
[AutoGen("Query2Request", "Biwen.AutoClassGen.Models")]
public interface IQueryRequest : IPager, IQuery
{
}
namespace Biwen.AutoClassGen.Models;

/// <summary>
/// 分页请求
/// </summary>
[AutoGen("QueryRequest", "Biwen.AutoClassGen.Models")]
[AutoGen("Query2Request", "Biwen.AutoClassGen.Models")]
public interface IQueryRequest : IPager, IQuery
{
}

public interface ITenantRealRequest : ITenantRequest
{
[AutoGen("TenantRealRequest", "Biwen.AutoClassGen.Models")]
public interface ITenantRealRequest : ITenantRequest
{

}
}
}
101 changes: 49 additions & 52 deletions Biwen.AutoClassGen.TestConsole/Interfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,67 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Biwen.AutoClassGen.TestConsole.Interfaces
{
namespace Biwen.AutoClassGen.TestConsole.Interfaces;

/// <summary>
/// 分页
/// </summary>
public interface IPager
{
/// <summary>
/// 分页
/// 页码
/// </summary>
public interface IPager
{
/// <summary>
/// 页码
/// </summary>
[DefaultValue(0), Description("页码,从0开始")]
[Range(0, int.MaxValue)]
int? CurrentPage { get; set; }
[DefaultValue(0), Description("页码,从0开始")]
[Range(0, int.MaxValue)]
int? CurrentPage { get; set; }

/// <summary>
/// 分页项数
/// </summary>
[DefaultValue(10), Description("每页项数,10-30之间")]
[Range(10, 30)]
int? PageLen { get; set; }
/// <summary>
/// 分页项数
/// </summary>
[DefaultValue(10), Description("每页项数,10-30之间")]
[Range(10, 30)]
int? PageLen { get; set; }

}
}

/// <summary>
/// 查询
/// </summary>
public interface IQuery
{
/// <summary>
/// 查询
/// 关键字
/// </summary>
public interface IQuery
{
/// <summary>
/// 关键字
/// </summary>
[StringLength(100), Description("查询关键字")]
string? KeyWord { get; set; }
}

[StringLength(100), Description("查询关键字")]
string? KeyWord { get; set; }
}

/// <summary>
/// 多租户请求
/// </summary>
public interface ITenantRequest : IExtend
{
/// <summary>
/// 多租户请求
/// 租户ID
/// </summary>
public interface ITenantRequest : IExtend
{
/// <summary>
/// 租户ID
/// </summary>
[Required, Description("租户ID"), DefaultValue("default")]
[FromHeader(Name = "tenant-id")]
string? TenantId { get; set; }
}
[Required, Description("租户ID"), DefaultValue("default")]
[FromHeader(Name = "tenant-id")]
string? TenantId { get; set; }
}

/// <summary>
/// 测试多重继承
/// </summary>
public interface IExtend : IExtend2
{
/// <summary>
/// 测试多重继承
/// 扩展
/// </summary>
public interface IExtend : IExtend2
{
/// <summary>
/// 扩展
/// </summary>
[Description("扩展")]
string? Extend { get; set; }
}
[Description("扩展")]
string? Extend { get; set; }
}

public interface IExtend2
{
string? Extend2 { get; set; }
}
}
public interface IExtend2
{
string? Extend2 { get; set; }
}

0 comments on commit 1a88a90

Please sign in to comment.