@Summary create file @Produce application/json @Accept application/json @Tags file @Security ApiKeyAuth @Param path body string true "path of folder (path need to url encode)" @Success 200 {string} string "ok" @Router /file/create [post]
(ctx echo.Context)
| 428 | // @Success 200 {string} string "ok" |
| 429 | // @Router /file/create [post] |
| 430 | func PostCreateFile(ctx echo.Context) error { |
| 431 | json := make(map[string]string) |
| 432 | ctx.Bind(&json) |
| 433 | path := json["path"] |
| 434 | var code int |
| 435 | if len(path) == 0 { |
| 436 | return ctx.JSON(common_err.CLIENT_ERROR, model.Result{Success: common_err.INVALID_PARAMS, Message: common_err.GetMsg(common_err.INVALID_PARAMS)}) |
| 437 | } |
| 438 | // decodedPath, err := url.QueryUnescape(path) |
| 439 | // if err != nil { |
| 440 | // return ctx.JSON(http.StatusOK, model.Result{Success: common_err.INVALID_PARAMS, Message: common_err.GetMsg(common_err.INVALID_PARAMS)}) |
| 441 | // return |
| 442 | // } |
| 443 | code, _ = service.MyService.System().CreateFile(path) |
| 444 | return ctx.JSON(common_err.SUCCESS, model.Result{Success: code, Message: common_err.GetMsg(code)}) |
| 445 | } |
| 446 | |
| 447 | // @Summary upload file |
| 448 | // @Produce application/json |
nothing calls this directly
no test coverage detected