| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import com.ruoyi.demo.service.ITestDemoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Api(value = "测试批量方法", tags = {"测试批量方法"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/demo/batch") |
| | |
| | | /** |
| | | * 新增批量方法 ( 全量覆盖填充 ) |
| | | */ |
| | | @ApiOperation(value = "新增批量方法") |
| | | @PostMapping() |
| | | // @DataSource(DataSourceType.SLAVE) |
| | | public AjaxResult<Void> add() { |
| | | List<TestDemo> list = new ArrayList<>(); |
| | | for (int i = 0; i < 1000; i++) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改批量方法 |
| | | * 删除批量方法 |
| | | */ |
| | | @ApiOperation(value = "删除批量方法") |
| | | @DeleteMapping() |
| | | public AjaxResult<Void> edit() { |
| | | // @DataSource(DataSourceType.SLAVE) |
| | | public AjaxResult<Void> remove() { |
| | | return toAjax(iTestDemoService.remove(new LambdaQueryWrapper<TestDemo>() |
| | | .eq(TestDemo::getOrderNum, -1L)) ? 1 : 0); |
| | | } |