2018-04-13 17:25:49 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2020-12-17 23:04:04 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2020-10-22 14:59:36 +08:00
|
|
|
|
using OpenAuth.App.Interface;
|
2018-04-13 17:25:49 +08:00
|
|
|
|
using OpenAuth.App.Request;
|
2020-12-29 23:52:06 +08:00
|
|
|
|
using OpenAuth.Repository;
|
2018-04-13 17:25:49 +08:00
|
|
|
|
using OpenAuth.Repository.Domain;
|
2020-10-22 14:59:36 +08:00
|
|
|
|
using OpenAuth.Repository.Interface;
|
2018-04-13 17:25:49 +08:00
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分类管理
|
|
|
|
|
/// </summary>
|
2021-03-13 23:45:10 +08:00
|
|
|
|
public class AppManager : BaseStringApp<Application,OpenAuthDBContext>
|
2018-04-13 17:25:49 +08:00
|
|
|
|
{
|
|
|
|
|
public void Add(Application Application)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(Application.Id))
|
|
|
|
|
{
|
|
|
|
|
Application.Id = Guid.NewGuid().ToString();
|
|
|
|
|
}
|
|
|
|
|
Repository.Add(Application);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Update(Application Application)
|
|
|
|
|
{
|
2020-10-22 14:59:36 +08:00
|
|
|
|
Repository.Update(Application);
|
2018-04-13 17:25:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-12-17 23:04:04 +08:00
|
|
|
|
public async Task<List<Application>> GetList(QueryAppListReq request)
|
2018-04-13 17:25:49 +08:00
|
|
|
|
{
|
|
|
|
|
var applications = UnitWork.Find<Application>(null) ;
|
|
|
|
|
|
|
|
|
|
return applications.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-29 23:52:06 +08:00
|
|
|
|
public AppManager(IUnitWork<OpenAuthDBContext> unitWork, IRepository<Application,OpenAuthDBContext> repository,IAuth auth) : base(unitWork, repository, auth)
|
2020-10-22 14:59:36 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
2018-04-13 17:25:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|