ConfigFromDb.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. using Dapper;
  2. using JiaZhiQuan.Common.ClassEnum;
  3. using MathNet.Numerics.Statistics.Mcmc;
  4. using Microsoft.Extensions.Logging;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using Wicture.DbRESTFul.Infrastructure.Repository;
  10. namespace JiaZhiQuan.Common.Config
  11. {
  12. public class ConfigFromDb
  13. {
  14. private readonly IConnectionManager _connectionManager;
  15. private readonly ILogger _logger;
  16. /// <summary>
  17. /// 主分类
  18. /// </summary>
  19. public static List<KeyValuePair<int, string>> PrimaryTypes { get; set; } = new List<KeyValuePair<int, string>>();
  20. /// <summary>
  21. /// 在App展示的主分类
  22. /// </summary>
  23. public static List<KeyValuePair<int, string>> PrimaryTypesVisibleInApp { get; set; } = new List<KeyValuePair<int, string>>();
  24. /// <summary>
  25. /// 在App展示的主分类(仅用于审核)
  26. /// </summary>
  27. public static List<KeyValuePair<int, string>> PrimaryTypesVisibleInAppPreview { get; set; } = new List<KeyValuePair<int, string>>();
  28. /// <summary>
  29. /// APP 版本Preview配置,配置之后,接口会返回用于审核的测试数据。数据格式为“channel,os_version”
  30. /// </summary>
  31. public static List<string> AppPreviewTypeList { get; set; } = new List<string>();
  32. /// <summary>
  33. /// 资源所属的市场
  34. /// </summary>
  35. public static List<KeyValuePair<int, string>> ResourceMarkets { get; set; } = new List<KeyValuePair<int, string>>()
  36. {
  37. new KeyValuePair<int, string>(1, "A股"),
  38. new KeyValuePair<int, string>(2, "港股"),
  39. new KeyValuePair<int, string>(4, "美股")
  40. };
  41. /// <summary>
  42. /// 社区
  43. /// </summary>
  44. public static List<AppIndexCusTabItem> AppIndexCusTabList = new List<AppIndexCusTabItem>();
  45. /// <summary>
  46. /// 商城
  47. /// </summary>
  48. public static List<AppIndexCusTabItem> MallAppIndexCusTabList = new List<AppIndexCusTabItem>();
  49. /// <summary>
  50. /// 不同天数的随机概率,2~15天
  51. /// </summary>
  52. public static List<List<int>> RandomProbabilities = new List<List<int>>
  53. {
  54. new List<int>{67, 33 },
  55. new List<int>{50, 33, 17 },
  56. new List<int>{40, 30, 20, 10 },
  57. new List<int>{35, 26, 20, 13, 6 },
  58. new List<int>{31, 23, 19, 14, 9, 4 },
  59. new List<int>{28, 21, 17, 14, 10, 7, 3 },
  60. new List<int>{26, 19, 16, 13, 11, 8, 5, 2 },
  61. new List<int>{24, 17, 15, 13, 11, 8, 6, 4, 2 },
  62. new List<int>{23, 16, 14, 12, 10, 9, 7, 5, 3, 1 },
  63. new List<int>{20, 15, 13, 12, 10, 9, 7, 6, 4, 3, 1 },
  64. new List<int>{21, 14, 12, 11, 10, 8, 7, 6, 5, 3, 2, 1 },
  65. new List<int>{20, 13, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 },
  66. new List<int>{21, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1 },
  67. new List<int>{18, 11, 10, 10, 9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1 },
  68. };
  69. public ConfigFromDb(IConnectionManager manager, ILoggerFactory loggerFactory)
  70. {
  71. _connectionManager = manager;
  72. _logger = loggerFactory.CreateLogger("DbRESTFul");
  73. try
  74. {
  75. Resolve();
  76. }
  77. catch (Exception ex)
  78. {
  79. _logger.LogError(ex, "ConfigFromDb 读取失败");
  80. }
  81. }
  82. public ConfigFromDb Resolve()
  83. {
  84. using (var conn = _connectionManager.GetConnection())
  85. {
  86. conn.Open();
  87. InitModel(SqlMapper.Query(conn, "select * from s_config"));
  88. // 初始化主分类
  89. var types = SqlMapper.Query(conn, "select id, name, hiddenInApp, previewable from s_types_main where state<>-1 order by displayOrder desc");
  90. PrimaryTypes = types.Select(e => new KeyValuePair<int, string>(e.id, e.name)).ToList();
  91. PrimaryTypesVisibleInApp = types.Where(e => e.hiddenInApp == 0).Select(e => new KeyValuePair<int, string>(e.id, e.name)).ToList();
  92. PrimaryTypesVisibleInAppPreview = types.Where(e => e.hiddenInApp == 0 && e.previewable > 0).Select(e => new KeyValuePair<int, string>(e.id, e.name)).ToList();
  93. AppPreviewTypeList = SqlMapper.Query(conn, "select channel, version from s_app_preview").Select(e => (e.channel + "," + e.version) as string).ToList();
  94. var custab= SqlMapper.Query<AppIndexCusTabItem>(conn,
  95. "select category,type, label, activeImg, deactiveImg, data from n_app_index_custab where state=0")
  96. .ToList();
  97. //社区
  98. AppIndexCusTabList = custab.Where(x => x.category == AppIndexTabEnum.COMMUNITY.category).ToList();
  99. //商品
  100. MallAppIndexCusTabList = custab.Where(x => x.category == AppIndexTabEnum.MALL.category).ToList();
  101. }
  102. return this;
  103. }
  104. public string SMSignName { get; set; }
  105. public string SMRsetMobileTemplateCode { get; set; }
  106. public string SMNormalValidationTemplateCode { get; set; }
  107. public string SMLoginTemplateCode { get; set; }
  108. public string WXGZAppID { get; set; }
  109. public string WXGZAppSecret { get; set; }
  110. public string WXAppID { get; set; }
  111. public string WXAppSecret { get; set; }
  112. public string QQAppID { get; set; }
  113. public string QQAppKey { get; set; }
  114. public string WeiboAppID { get; set; }
  115. public string WeiboAppSecret { get; set; }
  116. public string AliVisionAccessKeyId { get; set; }
  117. public string AliVisionAccessSecret { get; set; }
  118. public string AliOssAccessKeyId { get; set; }
  119. public string AliOssAccessSecret { get; set; }
  120. public string AliSMAccessKeyId { get; set; }
  121. public string AliSMAccessSecret { get; set; }
  122. public string AliDytnsAccessKeyId { get; set; }
  123. public string AliDytnsAccessSecret { get; set; }
  124. public string AliVodAccessKeyId { get; set; }
  125. public string AliVodAccessSecret { get; set; }
  126. public string AliVodCallbackUrl { get; set; }
  127. public string AliVodCallbackKey { get; set; }
  128. public string AliFaceVerifyAccessKeyId { get; set; }
  129. public string AliFaceVerifyAccessSecret { get; set; }
  130. public string AliPhoneNumberAuthCode { get; set; }
  131. public string AliPhoneNumberAccessKeyId { get; set; }
  132. public string AliPhoneNumberAccessSecret { get; set; }
  133. public string AliCaptchaAccessKeyId { get; set; }
  134. public string AliCaptchaAccessKeySecret { get; set; }
  135. public int PostPublishFirst { get; set; }
  136. public string UmengAppKeyAndroid { get; set; }
  137. public string UmengAppMasterSecretAndroid { get; set; }
  138. public string UmengAppKeyIOS { get; set; }
  139. public string UmengAppMasterSecretIOS { get; set; }
  140. public string SystemAdministratorPassword { get; set; }
  141. public string PointsName { get; set; }
  142. /// <summary>
  143. /// 用户签到赠送价值币数量列表,里面包含的即为一个周期
  144. /// </summary>
  145. public string UserSignInPointsCountList { get; set; }
  146. /// <summary>
  147. /// 用户发送请求时,参数MD5加密时的混淆串
  148. /// </summary>
  149. public string UserRequestParameterMD5Salt { get; set; }
  150. /// <summary>
  151. /// 用户默认头像地址,逗号分隔,路径为 olscdn.olssglobal.com/common/images/member/hdi/xxxxxx
  152. /// </summary>
  153. public string DefaultUserHeadImages { get; set; }
  154. /// <summary>
  155. /// 用户个人中心默认背景地址,逗号分隔,路径为 olscdn.olssglobal.com/common/images/member/hdi/xxxxxx
  156. /// </summary>
  157. public string DefaultUserHeadBackgroundImages { get; set; }
  158. /// <summary>
  159. /// Apple第三方登录私钥
  160. /// </summary>
  161. public string AppleSignInPrivateKey { get; set; }
  162. public string AppleTeamID { get; set; }
  163. public string AppleBundleID { get; set; }
  164. /// <summary>
  165. /// 短链地址
  166. /// </summary>
  167. public string ShorLinkPrefix { get; set; }
  168. /// <summary>
  169. /// H5 URL地址,无Http和/。如m.olssglobal.com
  170. /// </summary>
  171. public string H5UrlAddress { get; set; }
  172. /// <summary>
  173. /// 邀请好友注册短信模板
  174. /// </summary>
  175. public string ShareShortMessageTemplate { get; set; }
  176. /// <summary>
  177. /// 用户发动态任务获取的金币
  178. /// </summary>
  179. public int UserPointsPublishPost { get; set; }
  180. /// <summary>
  181. /// 发动态任务能够获取金币一天最多发放的数量
  182. /// </summary>
  183. public int UserPointsPublishPostMaxCount { get; set; }
  184. /// <summary>
  185. /// 用户评论任务获取的金币
  186. /// </summary>
  187. public int UserPointsComment { get; set; }
  188. /// <summary>
  189. /// 评论任务能够获取金币一天最多发放的数量
  190. /// </summary>
  191. public int UserPointsCommentMaxCount { get; set; }
  192. /// <summary>
  193. /// 用户点赞任务获取的金币
  194. /// </summary>
  195. public int UserPointsThumbsup { get; set; }
  196. /// <summary>
  197. /// 点赞任务能够获取金币需要达到的数量
  198. /// </summary>
  199. public int UserPointsThumbsupCount { get; set; }
  200. /// <summary>
  201. /// 用户分享任务获取的金币
  202. /// </summary>
  203. public int UserPointsShare { get; set; }
  204. /// <summary>
  205. /// 分享任务能够获取金币需要达到的数量
  206. /// </summary>
  207. public int UserPointsShareCount { get; set; }
  208. /// <summary>
  209. /// 用户被评论任务获取的金币
  210. /// </summary>
  211. public int UserPointsPassiveComment { get; set; }
  212. /// <summary>
  213. /// 被评论任务能够获取金币需要达到的数量
  214. /// </summary>
  215. public int UserPointsPassiveCommentCount { get; set; }
  216. /// <summary>
  217. /// 用户被点赞任务获取的金币
  218. /// </summary>
  219. public int UserPointsPassiveThumbsup { get; set; }
  220. /// <summary>
  221. /// 被点赞任务能够获取金币需要达到的数量
  222. /// </summary>
  223. public int UserPointsPassiveThumbsupCount { get; set; }
  224. /// <summary>
  225. /// 用户被分享任务获取的金币
  226. /// </summary>
  227. public int UserPointsPassiveShare { get; set; }
  228. /// <summary>
  229. /// 被分享任务能够获取金币需要达到的数量
  230. /// </summary>
  231. public int UserPointsPassiveShareCount { get; set; }
  232. /// <summary>
  233. /// 用户评级时,动态质量最小要达到的值,1-5
  234. /// </summary>
  235. public int UserLevelPostMinQuality { get; set; }
  236. /// <summary>
  237. /// 客服电话
  238. /// </summary>
  239. public string ConfigCSPhone { get; set; }
  240. /// <summary>
  241. /// 客服邮箱
  242. /// </summary>
  243. public string ConfigCSEmail { get; set; }
  244. /// <summary>
  245. /// QQ邮件发送邮件账户
  246. /// </summary>
  247. public string MailAccount { get; set; }
  248. /// <summary>
  249. /// QQ邮件发送邮件的授权码
  250. /// </summary>
  251. public string MailAuthCode { get; set; }
  252. /// <summary>
  253. /// 模拟文章用户列表
  254. /// </summary>
  255. public string MockPostUser { get; set; }
  256. /// <summary>
  257. /// 模拟评论用户列表
  258. /// </summary>
  259. public string MockCommentUser { get; set; }
  260. /// <summary>
  261. /// 是否禁用模拟评论文本AI审核,默认未禁用
  262. /// </summary>
  263. public int MockCommentDisableTextAiAuth { get; set; }
  264. /// <summary>
  265. /// 是否关闭文章自动点赞
  266. /// </summary>
  267. public int MockPostAutoThumbsupDisabled { get; set; }
  268. /// <summary>
  269. /// 是否关闭用户的自动关注
  270. /// </summary>
  271. public int MockUserAutoFocusDisabled { get; set; }
  272. /// <summary>
  273. /// 文章是否启用文本AI审核,大于0表示true, 等于0表示false
  274. /// </summary>
  275. public int EnablePostTextAiAuth { get; set; }
  276. /// <summary>
  277. /// 文章阅读统计同一用户每天最大有效阅读数量(有效阅读)
  278. /// </summary>
  279. public int PostReadStatisticMaxCountPerDayPerUser { get; set; }
  280. /// <summary>
  281. /// 文章阅读最小有效秒数
  282. /// </summary>
  283. public int PostReadStatisticMinSecs { get; set; }
  284. /// <summary>
  285. /// 文章阅读统计同一IP针对同一笔记(未登录),最多可统计的有效次数(有效阅读)
  286. /// </summary>
  287. public int PostReadStatisticMaxCountPerDayPerIP { get; set; }
  288. /// <summary>
  289. /// 文章阅读统计同一IP针对同一笔记(未登录),最多可统计的有效次数(非有效阅读)
  290. /// </summary>
  291. public int PostReadStatisticMaxCountPerDayPerIP_Normal { get; set; }
  292. /// <summary>
  293. /// 文章分享统计同一用户每天最大有效分享数量(有效分享)
  294. /// </summary>
  295. public int PostShareStatisticMaxCountPerDayPerUser { get; set; }
  296. /// <summary>
  297. /// 文章分享统计同一用户每天最大有效分享数量(非有效分享)
  298. /// </summary>
  299. public int PostShareStatisticMaxCountPerDayPerUser_Normal { get; set; }
  300. /// <summary>
  301. /// 同一用户同一文章最大有效分享数量(有效分享)
  302. /// </summary>
  303. public int PostShareStatisticMaxCountPerDayPerUserPerPost { get; set; }
  304. /// <summary>
  305. /// 同一用户同一文章最大有效分享数量(非有效分享)
  306. /// </summary>
  307. public int PostShareStatisticMaxCountPerDayPerUserPerPost_Normal { get; set; }
  308. /// <summary>
  309. /// 每天同一用户同一作者主页访问次数(非有效次数)
  310. /// </summary>
  311. public int PersonalPageVisitMaxCountPerDayPerUser2User_Normal { get; set; }
  312. /// <summary>
  313. /// 研报百次有效阅读单价(分为单位)
  314. /// </summary>
  315. public int PostStandpointSettlementPrice { get; set; }
  316. /// <summary>
  317. /// 价格变动提醒
  318. /// </summary>
  319. public string PostStandpointPriceChangeTip { get; set; }
  320. /// <summary>
  321. /// 视频笔记百次有效阅读单价(分为单位)
  322. /// </summary>
  323. public int PostDiaryHasVideoSettlementPrice { get; set; }
  324. /// <summary>
  325. /// 图文笔记百次有效阅读单价(分为单位)
  326. /// </summary>
  327. public int PostDiaryNoVideoSettlementPrice { get; set; }
  328. /// <summary>
  329. /// 价格变动提醒
  330. /// </summary>
  331. public string PostDiaryPriceChangeTip { get; set; }
  332. /// <summary>
  333. /// 创作者平台统计预警发送邮箱,多个用逗号分隔
  334. /// </summary>
  335. public string MPPostStatWarningMailTo { get; set; }
  336. /// <summary>
  337. /// 创作者平台统计预警配置,如{ diary: { read: { hours: 1, max: 5 }, thumbsup: { hours: 1, max: 5 }, share: { hours: 1, max: 5 }, totalRead: { hours: 1, max: 5 } }, standpoint: { ... } }
  338. /// </summary>
  339. public MPStatisticWarningConfig MPStatisticWarningConfig { get; set; }
  340. /// <summary>
  341. /// 文章最大推荐的天数,超过后,热度置0
  342. /// </summary>
  343. public int PostMaxRecommendDays { get; set; }
  344. /// <summary>
  345. /// 如果配置了此日期值,文章推荐则优先使用此值,而非PostMaxRecommendDays
  346. /// </summary>
  347. public string PostStartRecommendDate { get; set; }
  348. /// <summary>
  349. /// 文章距离当前时间多少小时内忽略热度值
  350. /// </summary>
  351. public int PostIgnoreHotRecentHours { get; set; }
  352. /// <summary>
  353. /// 文章冷却小时数,即在文章发布多久内计算冷却系数
  354. /// </summary>
  355. public int PostCoolingPeriodHours { get; set; }
  356. /// <summary>
  357. /// 文章在冷却周期内,小于等于此值时,冷却系数为1
  358. /// </summary>
  359. public int PostIgnoreCoolingMaxCountPerPeriod { get; set; }
  360. /// <summary>
  361. /// 用户主页默认背景图片地址
  362. /// </summary>
  363. public string UserPersonalPageBGImage { get; set; }
  364. /// <summary>
  365. /// 提现最小金额(含),单位为分
  366. /// </summary>
  367. public int CashoutMinAmount { get; set; }
  368. /// <summary>
  369. /// 提现最大金额(含),单位为分
  370. /// </summary>
  371. public int CashoutMaxAmount { get; set; }
  372. /// <summary>
  373. /// 提现每个自然月提现最大次数(含)
  374. /// </summary>
  375. public int CashoutMaxTimesPerMonth { get; set; }
  376. /// <summary>
  377. /// 用户邀请海报版本
  378. /// </summary>
  379. public int LastestInvitationPosterVersion { get; set; }
  380. /// <summary>
  381. /// 用户邀请海报生成参数
  382. /// </summary>
  383. public InvitationPosterParams InvitationPosterParams { get; set; }
  384. /// <summary>
  385. /// 邀请激活报警参数
  386. /// </summary>
  387. public InvitationAlarm InvitationAlarm { get; set; }
  388. /// <summary>
  389. /// 活动任务奖励兑换过期天数
  390. /// </summary>
  391. public int ActivityRewardExchangeExpireDays { get; set; }
  392. /// <summary>
  393. /// 价值币图标URL
  394. /// </summary>
  395. public string PointsIconUrl { get; set; }
  396. /// <summary>
  397. /// 平台微信客服二维码URL
  398. /// </summary>
  399. public string WXCSQRCodeUrl { get; set; }
  400. /// <summary>
  401. /// App社区Tab顺序及默认显示配置, 如:FOCUS,RECOMMEND,IMGPOST,VIDEOPOST|RECOMMEND
  402. /// </summary>
  403. public string AppIndexPageTabConfig { get; set; }
  404. /// <summary>
  405. /// App商城Tab顺序及默认显示配置, 如:FOCUS,RECOMMEND,IMGPOST,VIDEOPOST|RECOMMEND
  406. /// </summary>
  407. public string MallAppIndexPageTabConfig { get; set; } = "FOCUS,RECOMMEND,VIDEOPOST|RECOMMEND";
  408. /// <summary>
  409. /// App活动板块的火图标是否显示
  410. /// </summary>
  411. public int ActivityHotIconInAppVisible { get; set; }
  412. /// <summary>
  413. /// 内容推荐中每页包含的研报数量
  414. /// </summary>
  415. public int StandPointCountPerPageInRecommendation { get; set; }
  416. /// <summary>
  417. /// App中置顶资讯编号
  418. /// </summary>
  419. public long AppTopNewsId { get; set; }
  420. /// <summary>
  421. /// App中热门讨论出现的位置
  422. /// </summary>
  423. public int AppHotDiscussPosition { get; set; }
  424. /// <summary>
  425. /// App中推荐列表热门活动出现的位置,如果配置为-1表示不显示
  426. /// </summary>
  427. public int AppHotActivityPosition { get; set; }
  428. /// <summary>
  429. /// App活跃Tick接口调用间隔(秒)
  430. /// </summary>
  431. public int AppAliveTickInterval { get; set; } = 5;
  432. /// <summary>
  433. /// App同步行为数据时间间隔(秒)
  434. /// </summary>
  435. public int AppSyncActionDataInterval { get; set; } = 30;
  436. /// <summary>
  437. /// App一次同步行为数据量最大值
  438. /// </summary>
  439. public int AppSyncActionDataMaxSize { get; set; } = 100;
  440. /// <summary>
  441. /// VIVO商业开放平台AccessToken
  442. /// </summary>
  443. public string AdVivoAccessToken { get; set; }
  444. /// <summary>
  445. /// VIVO商业开放平台AccessToken过期时间
  446. /// </summary>
  447. public DateTime? AdVivoAccessTokenExpireAt { get; set; }
  448. /// <summary>
  449. /// VIVO商业开放平台refreshToken
  450. /// </summary>
  451. public string AdVivoRefreshToken { get; set; }
  452. /// <summary>
  453. /// 模拟评论时间随机因子1
  454. /// </summary>
  455. public int MockCommentRandomTimeFactor01 { get; set; } = 45;
  456. /// <summary>
  457. /// 模拟评论时间随机因子2
  458. /// </summary>
  459. public int MockCommentRandomTimeFactor02 { get; set; } = 120;
  460. /// <summary>
  461. /// 是否显示活动历史的按钮, 0 显示, 1 不显示
  462. /// </summary>
  463. public int AppActivityHistoryRecordsBtnVisible { get; set; }
  464. /// <summary>
  465. /// 商务邮箱
  466. /// </summary>
  467. public string CompanyEmail { get; set; }
  468. /// <summary>
  469. /// 无效评论关键词配置,正则表达式
  470. /// </summary>
  471. public string InvalidCommentReg { get; set; }
  472. /// <summary>
  473. /// Api中Sign检查是否禁用
  474. /// </summary>
  475. public int ApiSignCheckingDisabled { get; set; }
  476. /// <summary>
  477. /// Api中Sign每分钟最大验证错误次数,超过此次数,则禁止访问1个小时,如果配置0,则无最大错误次数
  478. /// </summary>
  479. public int ApiSignCheckingFailedMaxCountPerMin { get; set; }
  480. /// <summary>
  481. /// Api验签URL忽略正规
  482. /// </summary>
  483. public string ApiSignCheckingUrlIgnoreReg { get; set; }
  484. /// <summary>
  485. /// Api验签密钥
  486. /// </summary>
  487. public string ApiSignKey { get; set; }
  488. /// <summary>
  489. /// api加密白名单ip
  490. /// </summary>
  491. public string EncryptWhiteIPList { get; set; }
  492. /// <summary>
  493. /// 第元人民币相当于多少价值币
  494. /// </summary>
  495. public int PointsCountPerYuan { get; set; } = 500;
  496. /// <summary>
  497. /// 支付超时时间(分钟)
  498. /// </summary>
  499. public int PaymentTimeoutMinutes { get; set; } = 10;
  500. /// <summary>
  501. /// 卖家发货超时时间(小时)
  502. /// </summary>
  503. public int MallDeliveryTimeoutHours { get; set; } = 72;
  504. /// <summary>
  505. /// 买卖双方订单评论超时时间(小时)
  506. /// </summary>
  507. public int MallOrderRatingTimeoutHours { get; set; } = 15 * 24;
  508. /// <summary>
  509. /// 买家确认收货超时间(小时)
  510. /// </summary>
  511. public int MallReceiptTimeoutHours { get; set; } = 24 * 10;
  512. /// <summary>
  513. /// 买家操作延长确认收货时间的天数
  514. /// </summary>
  515. public int MallOrderConfirmReceiptExtendDays { get; set; } = 3;
  516. /// <summary>
  517. /// 快递鸟用户id
  518. /// </summary>
  519. public string KDNiaoEBusinessID { get; set; }
  520. /// <summary>
  521. /// 快递鸟用户apikey
  522. /// </summary>
  523. public string KDNiaoApiKey { get; set; }
  524. /// <summary>
  525. /// 于初科技代理商id
  526. /// </summary>
  527. public string YCTechAgentId { get; set; }
  528. /// <summary>
  529. /// 于初科技代理商key
  530. /// </summary>
  531. public string YCTechSignKey { get; set; }
  532. /// <summary>
  533. /// 于初科技接口host
  534. /// </summary>
  535. public string YCTechHost { get; set; }
  536. /// <summary>
  537. /// 于初科技订单结果回调接口url
  538. /// </summary>
  539. public string YCTechOrderCallBackUrl { get; set; }
  540. /// <summary>
  541. /// 于初科技平台id
  542. /// </summary>
  543. public int YCTechSupplierId { get; set; }
  544. /// <summary>
  545. /// 商品免责声明
  546. /// </summary>
  547. public string MallGoodsDisclaimer { get; set; }
  548. public double UEActivityDisplayOrder { get; set; }
  549. /// <summary>
  550. /// 卖家超过多少天未上架,超时上架天数
  551. /// </summary>
  552. public int UEShelveTimeout { get; set; }
  553. /// <summary>
  554. /// 平台退货,卖家自动确认收货超时时间
  555. /// </summary>
  556. public int UESellerReceiveTimeout { get; set; }
  557. public PlatformShopConfig PlatformShopConfig { get; set; }
  558. public HuiFuCommonConfig HuiFuConfig { get; set; }
  559. public string HuiFuJspayCallbackUrl { get; set; }
  560. public string HuiFuChashCallbackUrl { get; set; }
  561. public string HuiFuOpenCallbackUrl { get; set; }
  562. public string HuiFuRefundCallbackUrl { get; set; }
  563. public string HuiFuYuEPayCallbackUrl { get; set; }
  564. public string RongYunIMAppKey { get; set; }
  565. public string RongYunIMAppSecret { get; set; }
  566. /// <summary>
  567. /// 融云IM分配的客服编号列表,逗号分隔
  568. /// </summary>
  569. public string RongCloudIMCSIdList { get; set; }
  570. /// <summary>
  571. /// config 为从数据库查询出来的数据集合
  572. /// </summary>
  573. /// <param name="configs"></param>
  574. public void InitModel(dynamic configs)
  575. {
  576. var props = GetType().GetProperties();
  577. foreach (var config in configs)
  578. {
  579. if (string.IsNullOrEmpty(config.value)) continue;
  580. var prop = props.FirstOrDefault(e => e.Name.Equals(config.key));
  581. if (prop != null)
  582. {
  583. if (prop.PropertyType == typeof(int))
  584. {
  585. prop.SetValue(this, int.Parse(config.value));
  586. }
  587. if (prop.PropertyType == typeof(long))
  588. {
  589. prop.SetValue(this, long.Parse(config.value));
  590. }
  591. else if (prop.PropertyType == typeof(string))
  592. {
  593. prop.SetValue(this, config.value);
  594. }
  595. else if (prop.PropertyType == typeof(float))
  596. {
  597. prop.SetValue(this, float.Parse(config.value));
  598. }
  599. else if (prop.PropertyType == typeof(double))
  600. {
  601. prop.SetValue(this, double.Parse(config.value));
  602. }
  603. else if (prop.PropertyType == typeof(DateTime) || prop.PropertyType == typeof(DateTime?))
  604. {
  605. prop.SetValue(this, DateTime.Parse(config.value));
  606. }
  607. else if (typeof(IConfigFromDbJsonModel).IsAssignableFrom(prop.PropertyType))
  608. {
  609. var value = (string)config.value;
  610. if (!string.IsNullOrEmpty(value))
  611. {
  612. prop.SetValue(this, JsonConvert.DeserializeObject(value, prop.PropertyType));
  613. }
  614. }
  615. }
  616. }
  617. }
  618. }
  619. }