ComplianceServer/code/Hg.Complaint.Domain/Config/SystemConfig.cs

132 lines
3.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hg.Complaint.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 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; }
/// <summary>
/// 客户端密钥
/// </summary>
public List<ClientKey>? ClientKey { get; set; }
public List<Company> CompanyList { get; set; }
public string ZxdUrl { get; set; }
public string ZxdCoreUrl { get; set; }
public string CrmUrl { get; set; }
public string[] ClearCacheUrls { get; set; }
public string GetAccessKey(string id)
{
return ClientKey?.First(x => x.Id == id).AccessKey ?? "";
}
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 GetBusinessLineByDeptMentIds(string? groupIds, string? deptId)
{
return $"{CrmUrl}/Api/Customer/BusinessLineByDeptMentIds?GroupIds={groupIds}&DeptId={deptId}";
}
public string GetEidsByDeptMentIds(string? groupIds, string? deptId)
{
return $"{CrmUrl}/Api/Customer/EidsByDeptMentIds?GroupIds={groupIds}&DeptId={deptId}";
}
public string GetUserInfoByEIds(string? eids)
{
return $"{CrmUrl}/Api/Customer/GetUserInfoByEIds?eids={eids}";
}
}
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; }
}
}