MCPcopy
hub / github.com/IceWhaleTech/CasaOS / DeleteOperateFileOrDir

Function DeleteOperateFileOrDir

route/v1/file.go:793–813  ·  view source on GitHub ↗
(ctx echo.Context)

Source from the content-addressed store, hash-verified

791}
792
793func DeleteOperateFileOrDir(ctx echo.Context) error {
794 id := ctx.Param("id")
795 if id == "0" {
796 service.FileQueue = sync.Map{}
797 service.OpStrArr = []string{}
798 } else {
799
800 service.FileQueue.Delete(id)
801 tempList := []string{}
802 for _, v := range service.OpStrArr {
803 if v != id {
804 tempList = append(tempList, v)
805 }
806 }
807 service.OpStrArr = tempList
808
809 }
810
811 go service.MyService.Notify().SendFileOperateNotify(true)
812 return ctx.JSON(common_err.SUCCESS, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS)})
813}
814
815func GetSize(ctx echo.Context) error {
816 json := make(map[string]string)

Callers

nothing calls this directly

Calls 4

GetMsgFunction · 0.92
DeleteMethod · 0.65
SendFileOperateNotifyMethod · 0.65
NotifyMethod · 0.65

Tested by

no test coverage detected