first commit

This commit is contained in:
2026-06-25 17:41:06 +08:00
commit b2f23a933b
370 changed files with 30526 additions and 0 deletions
+95
View File
@@ -0,0 +1,95 @@
# app/api/wechat.py
from fastapi import APIRouter, Query
# from app.controllers import wechat_sdk
# from app.controllers.weixin_script import WeixinUser_controller
from some_sdk.services.binder import xy_client
from some_sdk.wk_weixin_sdk import auth
from some_sdk.wk_weixin_sdk.apis import corp_group, extern_user
from app.http_base import unified_resp
import logging
logger = logging.getLogger(__name__)
router = APIRouter()
# @router.get("/app-config")
# @unified_resp
# def get_config():
# return wechat_sdk.get_base_config()
# 获取企业身份签名
@router.get("/jssdk-config", summary="获取企业微信 企业身份 JS-SDK 配置")
@unified_resp
async def jssdk_config(type: str = Query(..., description="类型"), url: str = Query(..., description="前端当前页面 URL(不含 #")):
return await auth.get_jssdk_config(type, url)
@router.get("/get_access_user_info", summary="获取访问用户身份")
@unified_resp
async def get_access_user_info(code: str = Query(..., description="code为企业成员点击了构造链接之后附加在url中参数")):
return await auth.get_access_user_info(code)
@router.get("/get_external_group_chat_info", summary="获取外部群聊详细信息")
@unified_resp
async def get_external_group_chat_info(chat_id: str = Query(..., description="群对话ID")):
return await corp_group.get_external_group_chat_info(xy_client, chat_id)
@router.get("/get_external_user_chat_info", summary="获取外部客户详细信息")
@unified_resp
async def get_external_user_chat_info(user_id: str = Query(..., description="为外部客户的userid")):
return await extern_user.get_external_user_chat_info(user_id)
# @router.get("/get_external_user_list", summary="获取指定用户的所有外部客户")
# @unified_resp
# async def get_external_user_list(user_id: str = Query(..., description="企业成员的userid")):
# return await wechat_sdk.get_external_user_list(user_id)
# @router.get("/get_corp_user_id_list", summary="获取指公司所有员工")
# @unified_resp
# async def get_corp_user_id_list():
# return await wechat_sdk.get_corp_user_id_list()
# @router.get("/get_follow_user_list", summary="获取配置了客户联系功能的成员列表")
# @unified_resp
# async def get_follow_user_list():
# return await wechat_sdk.get_follow_user_list()
# @router.get("/get_follow_user_list", summary="获取配置了客户联系功能的成员列表")
# @unified_resp
# async def get_follow_user_list():
# return await wechat_sdk.get_follow_user_list()
# @router.get("/get_groupchat_list", summary="获取指定用户的客户群列表")
# @unified_resp
# async def get_groupchat_list():
# return await wechat_sdk.get_groupchat_list(['XiYinShuo'])
# @router.get("/update_all_user", summary="同步所有用户信息")
# @unified_resp
# async def update_all_user():
# return await WeixinUser_controller.update_all_user()
# @router.get("/update_all_user_by_group_chat", summary="通过群聊同步用户信息")
# @unified_resp
# async def update_all_user_by_group_chat():
# return await WeixinUser_controller.update_all_user_by_group_chat()
# @router.get("/convert_extenal_userid", summary="通过群聊同步用户信息")
# @unified_resp
# async def convert_extenal_userid():
# return await wechat_sdk.convert_extenal_userid('wmKgOaDQAA37oxGfhBFCAFPqmICXNAZA')
# @router.get("/update_all_user_by_xingyun", summary="通过外部系统同步用户信息")
# @unified_resp
# async def update_all_user_by_xingyun():
# return await WeixinUser_controller.update_all_user_by_xingyun()
# @router.get("/convert_extenal_userid", summary="转换三方应用的extenal_userid")
# @unified_resp
# async def convert_extenal_userid(user_id: str = Query(..., description="客户的userid")):
# return await wechat_sdk.convert_extenal_userid(user_id)
# @router.get("/get_external_contact_list", summary="获取已服务的外部联系人")
# @unified_resp
# async def get_external_contact_list(cursor: Optional[str] = Query(None, description="客户的userid")):
# return await wechat_sdk.get_external_contact_list(cursor)