MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / share_local_file

Function share_local_file

apps/admin/views.py:546–562  ·  view source on GitHub ↗
(
    item: ShareItem,
    file_service: FileService = Depends(get_file_service),
)

Source from the content-addressed store, hash-verified

544
545@admin_api.post("/local/share")
546async def share_local_file(
547 item: ShareItem,
548 file_service: FileService = Depends(get_file_service),
549):
550 share_info = await file_service.share_local_file(item)
551 await file_service.record_admin_activity(
552 action="local_file.share",
553 target_type="file",
554 target_id=share_info.get("id") if isinstance(share_info, dict) else None,
555 target_name=item.filename,
556 count=1,
557 meta={
558 "expireValue": item.expire_value,
559 "expireStyle": item.expire_style,
560 },
561 )
562 return APIResponse(detail=share_info)
563
564
565@admin_api.patch("/file/update")

Callers

nothing calls this directly

Calls 3

APIResponseClass · 0.90
share_local_fileMethod · 0.80
record_admin_activityMethod · 0.80

Tested by

no test coverage detected