步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

2 years ago
using BBWY.Common.Models;
3 years ago
using BBWY.Server.Model;
2 years ago
using System.Collections.Generic;
using System.Linq;
3 years ago
using Yitter.IdGenerator;
namespace BBWY.Server.Business
{
2 years ago
public class BaseSyncBusiness : IDenpendency
3 years ago
{
protected NLogManager nLogManager;
3 years ago
protected IFreeSql fsql;
protected IIdGenerator idGenerator;
protected TaskSchedulerManager taskSchedulerManager;
2 years ago
protected IEnumerable<PlatformSDKBusiness> platformSDKBusinessList;
3 years ago
protected VenderBusiness venderBusiness;
2 years ago
public BaseSyncBusiness(NLogManager nLogManager,
3 years ago
IFreeSql fsql,
IIdGenerator idGenerator,
TaskSchedulerManager taskSchedulerManager,
2 years ago
IEnumerable<PlatformSDKBusiness> platformSDKBusinessList,
VenderBusiness venderBusiness)
3 years ago
{
3 years ago
this.nLogManager = nLogManager;
3 years ago
this.fsql = fsql;
this.idGenerator = idGenerator;
3 years ago
this.taskSchedulerManager = taskSchedulerManager;
2 years ago
this.platformSDKBusinessList = platformSDKBusinessList;
this.venderBusiness = venderBusiness;
}
public PlatformSDKBusiness GetPlatformSDKBusiness(Enums.Platform platofrm)
{
var pb = platformSDKBusinessList.FirstOrDefault(p => p.Platform == platofrm);
if (pb == null)
throw new BusinessException($"不支持平台{platofrm}");
return pb;
3 years ago
}
}
}