mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-07 13:55:21 +00:00
feat: useable
This commit is contained in:
16
apis/file_delete.go
Normal file
16
apis/file_delete.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package apis
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/abc950309/tapewriter/entity"
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
)
|
||||
|
||||
func (api *API) FileDelete(ctx context.Context, req *entity.FileDeleteRequest) (*entity.FileDeleteReply, error) {
|
||||
ids := mapset.NewThreadUnsafeSet(req.Ids...)
|
||||
if err := api.lib.Delete(ctx, ids.ToSlice()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return new(entity.FileDeleteReply), nil
|
||||
}
|
||||
Reference in New Issue
Block a user