| | |
| | | import com.fasterxml.jackson.databind.util.BeanUtil; |
| | | import com.linghu.model.common.ResponseResult; |
| | | import com.linghu.model.entity.Orders; |
| | | import com.linghu.model.dto.KeywordDto; |
| | | import com.linghu.model.dto.OrderDto; |
| | | import com.linghu.service.OrderService; |
| | | |
| | |
| | | order.setCreate_time(LocalDateTime.now()); |
| | | boolean save = orderService.save(order); |
| | | // 保存关键词 |
| | | boolean saveOrderWithKeywords = orderService.saveOrderWithKeywords(orderDto,order.getOrder_id()); |
| | | boolean saveOrderWithKeywords = orderService.saveOrderWithKeywords(orderDto, order.getOrder_id()); |
| | | if (!saveOrderWithKeywords) { |
| | | return ResponseResult.error("添加关键词失败"); |
| | | } |
| | |
| | | List<Orders> list = orderService.list(queryWrapper); |
| | | return ResponseResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/{orderId}/keywordList") |
| | | @ApiOperation("获取订单关联的关键词及提问词") |
| | | public ResponseResult<List<KeywordDto>> getKeywordList(@PathVariable String orderId) { |
| | | List<KeywordDto> result = orderService.getKeywordListByOrderId(orderId); |
| | | return ResponseResult.success(result); |
| | | } |
| | | } |