fix app update bug
This commit is contained in:
parent
498605fce0
commit
fe2b26c76c
@ -134,7 +134,7 @@ public class AppsService : ApplicationService
|
|||||||
var res = await _appRepository.AsQueryable()
|
var res = await _appRepository.AsQueryable()
|
||||||
.Select(x => new AppOutput { Id = x.Id.SelectAll() })
|
.Select(x => new AppOutput { Id = x.Id.SelectAll() })
|
||||||
.SingleAsync(x => x.Id == id);
|
.SingleAsync(x => x.Id == id);
|
||||||
_ = res ?? throw new BusinessException(message:"在指定的编号下找不到数据");
|
_ = res ?? throw new BusinessException(message: "在指定的编号下找不到数据");
|
||||||
|
|
||||||
// if (res.LogoKey != null) res.LogoUrl = OSSHelper.GetUrlByKey(res.LogoKey);
|
// if (res.LogoKey != null) res.LogoUrl = OSSHelper.GetUrlByKey(res.LogoKey);
|
||||||
res.AppScope = await _appScopeRepository.AsQueryable()
|
res.AppScope = await _appScopeRepository.AsQueryable()
|
||||||
@ -221,8 +221,8 @@ public class AppsService : ApplicationService
|
|||||||
item.InterfaceCode = interfaceDic[item.InterfaceId];
|
item.InterfaceCode = interfaceDic[item.InterfaceId];
|
||||||
});
|
});
|
||||||
|
|
||||||
await _appScopeRepository.UpdateAsync(x => new AppScopeEntity { IsDeleted = true },
|
await _appScopeRepository.AsUpdateable().SetColumns(x => x.IsDeleted == true)
|
||||||
x => x.AppId == input.Id);
|
.Where(x => x.AppId == input.Id).ExecuteCommandAsync();
|
||||||
await _appScopeRepository.InsertRangeAsync(appScopeEntitys);
|
await _appScopeRepository.InsertRangeAsync(appScopeEntitys);
|
||||||
|
|
||||||
ts.Complete();
|
ts.Complete();
|
||||||
|
|||||||
@ -9,11 +9,6 @@ namespace InterfaceForward.Repositories.App.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class AppScopeRepository : BasicRepository<AppScopeEntity>, IAppScopeRepository, IScopedDependency
|
public class AppScopeRepository : BasicRepository<AppScopeEntity>, IAppScopeRepository, IScopedDependency
|
||||||
{
|
{
|
||||||
public Task<bool> UpdateAsync(Expression<Func<AppScopeEntity, object>> columns, Expression<Func<AppScopeEntity, bool>> whereExpression)
|
|
||||||
{
|
|
||||||
return Context.Updateable<AppScopeEntity>().Where(whereExpression).UpdateColumns(columns).ExecuteCommandHasChangeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IUpdateable<AppScopeEntity> AsUpdateable()
|
public IUpdateable<AppScopeEntity> AsUpdateable()
|
||||||
{
|
{
|
||||||
return Context.Updateable<AppScopeEntity>();
|
return Context.Updateable<AppScopeEntity>();
|
||||||
|
|||||||
@ -8,8 +8,6 @@ namespace InterfaceForward.Repositories.App.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAppScopeRepository
|
public interface IAppScopeRepository
|
||||||
{
|
{
|
||||||
Task<bool> UpdateAsync(Expression<Func<AppScopeEntity, object>> columns, Expression<Func<AppScopeEntity, bool>> whereExpression);
|
|
||||||
|
|
||||||
ISugarQueryable<AppScopeEntity> AsQueryable();
|
ISugarQueryable<AppScopeEntity> AsQueryable();
|
||||||
|
|
||||||
Task<bool> InsertRangeAsync(List<AppScopeEntity> insertObjs);
|
Task<bool> InsertRangeAsync(List<AppScopeEntity> insertObjs);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user