Panda.DynamicWebApi
Panda.DynamicWebApi copied to clipboard
swagger生成错误
产生原因:继承仓储服务
/// <summary>
/// 用户服务
/// </summary>
[ApiExplorerSettings(GroupName = "user")]
[DynamicWebApi]
public class UserService : BaseRepository<User>, IDynamicWebApi
{
/// <summary>
/// 添加用户
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task AddUser(UserRegisterRequestDto dto)
{
var user = new User()
{
Account = dto.Account,
UserName = dto.UserName,
Password = dto.Password,
};
await InsertAsync(user);
}
}
public class BaseRepository<T> : SimpleClient<T> where T : class, new() { public BaseRepository(ISqlSugarClient? context = null) : base(context) { base.Context=context; } }
只要继承BaseRepository swagger就出不来了,难道只能构造注入一下?
改DynamicWebApiConvention源码,原因是读取了SqlSugar里的内容