Exemplo n.º 1
0
        private string FromatRosterKey(RosterType rosterType, string api, Policy policy, string policyKey)
        {
            var key = $"apithrottle:cache:{rosterType.ToString().ToLower()}:{policy.ToString().ToLower()}";

            if (!string.IsNullOrEmpty(policyKey))
            {
                key += ":" + MD5Util.EncryptMD5Short(policyKey);
            }
            key += ":" + api.ToLower();
            return(key);
        }
Exemplo n.º 2
0
        private string FromatApiRecordKey(string api, Policy policy, string policyKey, string policyValue)
        {
            var key = $"apithrottle:cache:record:{policy.ToString().ToLower()}";

            if (!string.IsNullOrEmpty(policyKey))
            {
                key += ":" + MD5Util.EncryptMD5Short(policyKey);
            }
            if (!string.IsNullOrEmpty(policyValue))
            {
                key += ":" + MD5Util.EncryptMD5Short(policyValue);
            }
            key += ":" + api.ToLower();
            return(key);
        }