# 视频版权区块链 **Repository Path**: daonna/video-copyright-blockchain ## Basic Information - **Project Name**: 视频版权区块链 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-05 - **Last Updated**: 2025-02-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 视频版权区块链系统 ./ ├── api │ └── swagger.yaml ├── cmd │ └── server │ └── server.go ├── config │ └── config.yaml ├── go.mod ├── internal │ ├── blockchain │ │ └── blockchain.go │ ├── handlers │ │ └── video_handler.go │ ├── models │ │ └── video.go │ └── services │ └── video_service.go ├── main.go ├── pkg ├── README.md ├── scripts └── test ##创建视频 curl -X POST http://localhost:8080/api/v1/videos \ > -H "Content-Type: application/json" \ > -d '{"hash": "1234567890abcdef1234567890abcdef"}' {"message":"Video hash added to blockchain"} ##创建视频(添加视频哈希到区块链 2025/02/05 10:35:31 main.go:46: Starting server on :8080 [GIN] 2025/02/05 - 10:36:17 | 200 | 290.952µs | ::1 | POST "/api/v1/videos" ##验证视频哈希: curl "http://localhost:8080/api/v1/videos/verify?hash=1234567890abcdef1234567890abcdef" {"verified":true} ##尝试验证一个不存在的视频哈希 curl "http://localhost:8080/api/v1/videos/verify?hash=nonexistenthash" ##尝试创建一个没有哈希的视频 ://localhost:8080/api/v1/videos \ > -H "Content-Type: application/json" \ > -d '{}' {"error":"Key: 'Hash' Error:Field validation for 'Hash' failed on the 'required' tag"} ##尝试验证视频但不提供哈希参数 {"rameter is required"} bash: {error:Hash parameter is required}: command not found