""" @author: luojunhui """ import pyapollos class apolloConfig(object): """ apolloConfig """ def __init__(self, env="pre"): """ :param env: """ self.apollo_connection = pyapollos.ApolloClient( app_id="LongArticlesJob", config_server_url="https://preapolloconfig-internal.piaoquantv.com/", timeout=10 ) match env: case "prod": self.apollo_connection = pyapollos.ApolloClient( app_id="LongArticlesJob", config_server_url="https://apolloconfig-internal.piaoquantv.com/", timeout=10 ) case "dev": self.apollo_connection = pyapollos.ApolloClient( app_id="LongArticlesJob", config_server_url="https://devapolloconfig-internal.piaoquantv.com/", timeout=10 ) case "pre": self.apollo_connection = pyapollos.ApolloClient( app_id="LongArticlesJob", config_server_url="http://preapolloconfig-internal.piaoquantv.com/", timeout=10 ) def getConfigValue(self, key): """ 通过 key 获取配置的 Config :param key: :return: """ response = self.apollo_connection.get_value(key) return response # aigc后台数据库连接配置 denet_config = { 'host': 'rm-t4na9qj85v7790tf84o.mysql.singapore.rds.aliyuncs.com', 'port': 3306, 'user': 'crawler_admin', 'password': 'cyber#crawler_2023', 'db': 'aigc-admin-prod', 'charset': 'utf8mb4' } # 长文数据库连接配置 long_articles_config = { 'host': 'rm-bp14529nwwcw75yr1ko.mysql.rds.aliyuncs.com', 'port': 3306, 'user': 'changwen_admin', 'password': 'changwen@123456', 'db': 'long_articles', 'charset': 'utf8mb4' } # 票圈爬虫库数据库配置 piaoquan_crawler_config = { 'host': 'rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com', 'port': 3306, 'user': 'crawler', 'password': 'crawler123456@', 'db': 'piaoquan-crawler', 'charset': 'utf8mb4' } # moonshot model config(kimi) moon_shot = { "api_key": "sk-5DqYCa88kche6nwIWjLE1p4oMm8nXrR9kQMKbBolNAWERu7q", "model": "moonshot-v1-32k", "base_url": "https://api.moonshot.cn/v1" }