perf: Replace Feishu to obtain user information interface

pull/13961/head
feng 3 months ago committed by Bryan
parent bddb1de2f8
commit 6b00ba271f

@ -151,9 +151,17 @@ class FeiShu(RequestMixin):
} }
def get_user_detail(self, user_id, **kwargs): def get_user_detail(self, user_id, **kwargs):
# get_user_id_by_code 已经返回个人信息,这里直接解析 # https://open.feishu.cn/document/server-docs/contact-v3/user/get
data = kwargs['other_info'] data = {}
data['user_id'] = user_id try:
data = self._requests.get(
self.url_instance.get_user_detail(user_id),
{'user_id_type': 'user_id'}
)
data = data['data']['user']
except Exception as e:
logger.error(f'Get user detail error: {e} data={data}')
info = flatten_dict(data) info = flatten_dict(data)
default_detail = self.default_user_detail(data, user_id) default_detail = self.default_user_detail(data, user_id)
detail = map_attributes(default_detail, info, self.attributes) detail = map_attributes(default_detail, info, self.attributes)

Loading…
Cancel
Save