swagger生成错误
Closed this issue · 1 comments
771185858 commented
产生原因:继承仓储服务
/// <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 : SimpleClient where T : class, new()
{
public BaseRepository(ISqlSugarClient? context = null) : base(context)
{
base.Context=context;
}
}
只要继承BaseRepository swagger就出不来了,难道只能构造注入一下?
771185858 commented
改DynamicWebApiConvention源码,原因是读取了SqlSugar里的内容