| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @PostMapping("/api/v1/whitelist/add") |
| | | @ResponseBody |
| | | @ApiOperation(value = "新增白名单") |
| | | @Transactional |
| | | public R add(@Validated @RequestBody WhitelistAddDto dto) { |
| | | if (!StringUtils.hasLength(dto.getAccount())) { |
| | | return R.fail("请输入账号"); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @Log(title = "白名单导入", businessType = BusinessType.IMPORT) |
| | | @ApiOperation(value = "白名单导入") |
| | | @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) |
| | | @PostMapping("/base/v1/whitelist/importExcel") |
| | | public AjaxResult<String> importExcel(@RequestParam("file") MultipartFile file) { |
| | | |