| | |
| | | package com.zy.ai.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.ai.entity.LlmCallLog; |
| | |
| | | @RequestParam(required = false) Integer success, |
| | | @RequestParam(required = false) Long routeId, |
| | | @RequestParam(required = false) String traceId) { |
| | | EntityWrapper<LlmCallLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LlmCallLog> wrapper = new QueryWrapper<>(); |
| | | if (!isBlank(scene)) { |
| | | wrapper.eq("scene", scene.trim()); |
| | | } |
| | |
| | | if (!isBlank(traceId)) { |
| | | wrapper.eq("trace_id", traceId.trim()); |
| | | } |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(llmCallLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(llmCallLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @PostMapping("/delete/auth") |
| | |
| | | if (id == null) { |
| | | return R.error("id不能为空"); |
| | | } |
| | | llmCallLogService.deleteById(id); |
| | | llmCallLogService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/clear/auth") |
| | | @ManagerAuth |
| | | public R clear() { |
| | | llmCallLogService.delete(new EntityWrapper<LlmCallLog>()); |
| | | llmCallLogService.remove(new QueryWrapper<LlmCallLog>()); |
| | | return R.ok(); |
| | | } |
| | | |