rework on route
This commit is contained in:
parent
41f4062d1b
commit
c36c2d6c60
@ -36,7 +36,6 @@ func (s *Service) UploadCreate(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, gin.H{
|
||||
"status": "success",
|
||||
"upload_id": sha.String(),
|
||||
})
|
||||
}
|
||||
@ -108,7 +107,6 @@ func (s *Service) UploadPart(c *gin.Context) {
|
||||
"part": uploadPart.Part,
|
||||
"size": w,
|
||||
"sha256": uploadPart.PartSha256,
|
||||
"status": "success",
|
||||
})
|
||||
}
|
||||
|
||||
@ -123,9 +121,7 @@ func (s *Service) UploadCancel(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"status": "success",
|
||||
})
|
||||
c.Status(http.StatusNoContent)
|
||||
}
|
||||
|
||||
type UploadCompleteRequest struct {
|
||||
@ -148,8 +144,14 @@ func (s *Service) UploadComplete(c *gin.Context) {
|
||||
|
||||
func (s *Service) UploadInit() {
|
||||
upload := s.Gin.Group("/upload")
|
||||
upload.GET("/create", s.UploadCreate)
|
||||
upload.POST("/part/:upload_id", s.UploadPart)
|
||||
upload.GET("/cancel/:upload_id", s.UploadCancel)
|
||||
upload.POST("/complete/:upload_id", s.UploadComplete)
|
||||
|
||||
// upload.GET("/create", s.UploadCreate)
|
||||
// upload.POST("/part/:upload_id", s.UploadPart)
|
||||
// upload.GET("/cancel/:upload_id", s.UploadCancel)
|
||||
// upload.POST("/complete/:upload_id", s.UploadComplete)
|
||||
|
||||
upload.POST("", s.UploadCreate)
|
||||
upload.DELETE("/:upload_id", s.UploadCancel)
|
||||
upload.PUT("/:upload_id", s.UploadPart)
|
||||
upload.POST("/:upload_id", s.UploadComplete)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user