mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 18:31:04 +00:00
feat: 拆分 feishu lark
This commit is contained in:
23
apps/notifications/backends/lark.py
Normal file
23
apps/notifications/backends/lark.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from django.conf import settings
|
||||
|
||||
from common.sdk.im.lark import Lark as Client
|
||||
from .base import BackendBase
|
||||
|
||||
|
||||
class Lark(BackendBase):
|
||||
account_field = 'lark_id'
|
||||
is_enable_field_in_settings = 'AUTH_LARK'
|
||||
|
||||
def __init__(self):
|
||||
self.client = Client(
|
||||
app_id=settings.LARK_APP_ID,
|
||||
app_secret=settings.LARK_APP_SECRET
|
||||
)
|
||||
|
||||
def send_msg(self, users, message, subject=None):
|
||||
accounts, __, __ = self.get_accounts(users)
|
||||
print('lark', message)
|
||||
return self.client.send_text(accounts, message)
|
||||
|
||||
|
||||
backend = Lark
|
Reference in New Issue
Block a user