feat(ops): cache接口增加DELETE删除key

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-07-06 15:52:46 +08:00
parent 60cd157a40
commit 0705b72859
1 changed files with 5 additions and 0 deletions

View File

@ -250,6 +250,11 @@ class CacheView(APIView):
cache.set(key, vdata['value'], timeout=vdata["timeout"]) cache.set(key, vdata['value'], timeout=vdata["timeout"])
return Response() return Response()
@swagger_auto_schema(operation_summary="删除key", responses={200: None})
def delete(self, request, key):
cache.delete(key)
return Response()
class DrfRequestLogViewSet(ListModelMixin, CustomGenericViewSet): class DrfRequestLogViewSet(ListModelMixin, CustomGenericViewSet):
"""list:请求日志 """list:请求日志