mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-18 00:08:31 +00:00
feat: 站内信 (#6183)
* 添加站内信 * s * s * 添加接口 * fix * fix * 重构了一些 * 完成 * 完善 * s * s * s * s * s * s * 测试ok * 替换业务中发送消息的方式 * 修改 * s * 去掉 update 兼容 create * 添加 unread total 接口 * 调整json字段 Co-authored-by: xinwen <coderWen@126.com>
This commit is contained in:
@@ -608,6 +608,12 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, AbstractUser):
|
||||
def __str__(self):
|
||||
return '{0.name}({0.username})'.format(self)
|
||||
|
||||
@classmethod
|
||||
def get_group_ids_by_user_id(cls, user_id):
|
||||
group_ids = cls.groups.through.objects.filter(user_id=user_id).distinct().values_list('usergroup_id', flat=True)
|
||||
group_ids = list(group_ids)
|
||||
return group_ids
|
||||
|
||||
@property
|
||||
def is_wecom_bound(self):
|
||||
return bool(self.wecom_id)
|
||||
|
Reference in New Issue
Block a user