步步为盈
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.

32 lines
1.1 KiB

2 years ago
using BBWY.Common.Models;
using BBWY.Server.Model;
using System.Collections.Generic;
using System.Linq;
using Yitter.IdGenerator;
3 years ago
namespace BBWY.Server.Business
{
public class BaseBusiness
{
protected IFreeSql fsql;
protected NLogManager nLogManager;
3 years ago
protected IIdGenerator idGenerator;
2 years ago
protected IEnumerable<PlatformSDKBusiness> platformSDKBusinessList;
3 years ago
2 years ago
public BaseBusiness(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator, IEnumerable<PlatformSDKBusiness> platformSDKBusinessList)
3 years ago
{
this.fsql = fsql;
this.nLogManager = nLogManager;
3 years ago
this.idGenerator = idGenerator;
2 years ago
this.platformSDKBusinessList = platformSDKBusinessList;
}
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
}
}
}