增加批量删除
parent
414c304d2a
commit
e436e6644a
|
@ -19,6 +19,10 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
@ -84,13 +88,22 @@ public class GoodsController extends BaseController {
|
|||
@ApiOperation("删除商品")
|
||||
@DeleteMapping("/del")
|
||||
public ApiResult<?> remove(@RequestParam Integer id) {
|
||||
|
||||
boolean b = goodsService.removeById(id);
|
||||
return b?success():fail();
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("hasAnyAuthority('goods:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除商品")
|
||||
@DeleteMapping("/delAll")
|
||||
public ApiResult<?> removeAll(@RequestParam String arr) {
|
||||
String[] split = arr.split(",");
|
||||
ArrayList<String> list = new ArrayList<>(Arrays.asList(split));
|
||||
boolean b = goodsService.removeByIds(list);
|
||||
return b?success():fail();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue