2021-08-12 08:44:06 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
2021-10-21 08:50:11 +00:00
|
|
|
from common.sdk.im.feishu import FeiShu as Client
|
2021-08-12 08:44:06 +00:00
|
|
|
from .base import BackendBase
|
|
|
|
|
|
|
|
|
|
|
|
class FeiShu(BackendBase):
|
|
|
|
account_field = 'feishu_id'
|
|
|
|
is_enable_field_in_settings = 'AUTH_FEISHU'
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
self.client = Client(
|
|
|
|
app_id=settings.FEISHU_APP_ID,
|
|
|
|
app_secret=settings.FEISHU_APP_SECRET
|
|
|
|
)
|
|
|
|
|
2021-08-24 06:20:54 +00:00
|
|
|
def send_msg(self, users, message, subject=None):
|
2021-08-12 08:44:06 +00:00
|
|
|
accounts, __, __ = self.get_accounts(users)
|
2021-08-24 06:20:54 +00:00
|
|
|
return self.client.send_text(accounts, message)
|
|
|
|
|
|
|
|
|
|
|
|
backend = FeiShu
|