feat: 添加短信服务和用户消息通知

This commit is contained in:
xinwen
2021-08-24 14:20:54 +08:00
parent d49d1e1414
commit b1fceca8a6
57 changed files with 1442 additions and 296 deletions

22
apps/settings/api/sms.py Normal file
View File

@@ -0,0 +1,22 @@
from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from common.permissions import IsSuperUser
from common.message.backends.sms import BACKENDS
from settings.serializers.sms import SMSBackendSerializer
class SMSBackendAPI(ListAPIView):
permission_classes = (IsSuperUser,)
serializer_class = SMSBackendSerializer
def list(self, request, *args, **kwargs):
data = [
{
'name': b,
'label': b.label
}
for b in BACKENDS
]
return Response(data)