139 lines
4.0 KiB
C#
139 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Hg.Core.Domain.Config
|
|
{
|
|
public class SystemConfig
|
|
{
|
|
public SystemConfig(string appid, string appSecret, string ssoUrl, string ssoOrganizationUrl, string[] clearCacheUrls, string userCenterRiaServiceUrl, string previewUrl, List<ClientKey>? clientKey)
|
|
{
|
|
Appid = appid;
|
|
AppSecret = appSecret;
|
|
SsoUrl = ssoUrl;
|
|
SsoOrganizationUrl = ssoOrganizationUrl;
|
|
ClearCacheUrls = clearCacheUrls;
|
|
UserCenterRiaServiceUrl = userCenterRiaServiceUrl;
|
|
PreviewUrl = previewUrl;
|
|
ClientKey = clientKey;
|
|
}
|
|
|
|
public SystemConfig()
|
|
{
|
|
}
|
|
|
|
public string cmsHost { get; set; }
|
|
public string cmsUrl { get; set; }
|
|
public string softUrl { get; set; }
|
|
public string imgUrl { get; set; }
|
|
public string app_cms_url { get; set; }
|
|
public string Appid { get; set; }
|
|
|
|
public string AppSecret { get; set; }
|
|
|
|
public string SsoUrl { get; set; }
|
|
|
|
public string SsoOrganizationUrl { get; set; }
|
|
|
|
public string UserCenterRiaServiceUrl { get; set; }
|
|
|
|
public string PreviewUrl { get; set; }
|
|
|
|
public string AuditUrl { get; set; }
|
|
|
|
public string? Riskinfo { get; set; }
|
|
|
|
public string? ContractStatus { get; set; }
|
|
|
|
public string ZxdUrl { get; set; }
|
|
public string ZxdCoreUrl { get; set; }
|
|
|
|
public string DataSyncApiUrl { get; set; }
|
|
|
|
public string CrmCore { get; set; }
|
|
public string CrmCoreSendMessage { get; set; }
|
|
public string StockUrl { get; set; }
|
|
public string StockPoolAuthorization { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客户端密钥
|
|
/// </summary>
|
|
public List<ClientKey>? ClientKey { get; set; }
|
|
|
|
public List<Company> CompanyList { get; set; }
|
|
|
|
public string[] ClearCacheUrls { get; set; }
|
|
|
|
public string GetAccessKey(string id)
|
|
{
|
|
return ClientKey?.First(x => x.Id == id).AccessKey ?? "";
|
|
}
|
|
|
|
public string UpdateOrderRealName()
|
|
{
|
|
return $"{CrmCore}/api/order/realName";
|
|
}
|
|
|
|
public string GetRiskinfo()
|
|
{
|
|
return UserCenterRiaServiceUrl + Riskinfo;
|
|
}
|
|
|
|
public string PostContractStatus(string content, string sign, string clientId)
|
|
{
|
|
return $"{UserCenterRiaServiceUrl}{ContractStatus}?content={content}&sign={sign}&clientId={clientId}";
|
|
}
|
|
|
|
public string? GetCompanyVideoUrl(CompanyList company)
|
|
{
|
|
return CompanyList.Where(x => x.Code == company.GetDescription()).Select(x => x.VideoUrl).FirstOrDefault();
|
|
}
|
|
|
|
public string? GetCompanyWxMessageUrl(CompanyList company)
|
|
{
|
|
return CompanyList.Where(x => x.Code == company.GetDescription()).Select(x => x.WxMessageUrl).FirstOrDefault();
|
|
}
|
|
|
|
public string? GetCompanyName(CompanyList company)
|
|
{
|
|
return CompanyList.Where(x => x.Code == company.GetDescription()).Select(x => x.Name).FirstOrDefault();
|
|
}
|
|
|
|
public string? GetCompanyCode(CompanyList company)
|
|
{
|
|
return CompanyList.Where(x => x.Code == company.GetDescription()).Select(x => x.Code).FirstOrDefault();
|
|
}
|
|
|
|
public string GetZxdDepts()
|
|
{
|
|
return ZxdCoreUrl + "/api/deptment/Depts?IsDept=true";
|
|
}
|
|
|
|
public string GetCrmCoreSendMessage()
|
|
{
|
|
return $"{CrmCore}{CrmCoreSendMessage}";
|
|
}
|
|
}
|
|
|
|
public class ClientKey
|
|
{
|
|
public string Id { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string AccessKey { get; set; }
|
|
}
|
|
|
|
public class Company
|
|
{
|
|
public string? Code { get; set; }
|
|
|
|
public string? Name { get; set; }
|
|
|
|
public string? VideoUrl { get; set; }
|
|
|
|
public string? WxMessageUrl { get; set; }
|
|
}
|
|
} |