| | |
| | | import org.springblade.modules.directive.vo.DirectiveVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-07-21 |
| | |
| | | @PostMapping("/saveDirectiveAndFile") |
| | | public R saveDirectiveAndFile(@RequestBody DirectiveVo directive) { |
| | | //新增指令信息 |
| | | boolean save = directiveService.save(directive); |
| | | boolean status = false; |
| | | if (save){ |
| | | directive.setSendTime(new Date()); |
| | | status = directiveService.save(directive); |
| | | if (status){ |
| | | //新增图片 |
| | | if (null!=directive.getUrl() && directive.getUrl()!=""){ |
| | | String[] directiveUrl = directive.getUrl().split(","); |
| | |
| | | directiveFile.setUrl(url); |
| | | status = directiveService.saveDirectiveFile(directiveFile); |
| | | if (!status){ |
| | | R.status(false); |
| | | return R.status(false); |
| | | } |
| | | } |
| | | } |