From d4e4ea6405756d495806a609e24ae85ebd7345ef Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期二, 17 十二月 2024 09:30:12 +0800 Subject: [PATCH] 代码更新 --- src/main/java/com/yb/controller/THistoryController.java | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/yb/controller/THistoryController.java b/src/main/java/com/yb/controller/THistoryController.java index 6606470..a5baefb 100644 --- a/src/main/java/com/yb/controller/THistoryController.java +++ b/src/main/java/com/yb/controller/THistoryController.java @@ -4,10 +4,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; -import com.alibaba.fastjson.JSON; import com.yb.dao.THistoryDao; +import com.yb.service.ThistoriesServices; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -31,6 +32,8 @@ private THistoryService tHistoryService; @Autowired private THistoryDao tHistoryDao; + @Autowired + private ThistoriesServices thistoriesServices; /** * 鍒楄〃 @@ -83,10 +86,10 @@ @PostMapping("/save") @ApiOperation(value = "save", notes = "") public R save(@RequestBody THistoryEntity tHistory) { - int id = tHistoryDao.insert(tHistory); + int id = tHistoryDao.insert(tHistory); // tHistory.getId().toString() - HashMap<String,Object> hashMap= new HashMap<>(); - hashMap.put("id",tHistory.getId().toString()); + HashMap<String, Object> hashMap = new HashMap<>(); + hashMap.put("id", tHistory.getId().toString()); return R.ok(hashMap); } @@ -130,4 +133,23 @@ } return R.ok(list); } + + @GetMapping("/getSessionById") + @ApiOperation(value = "getSessionById", notes = "") + public R getSessionById(@RequestParam(name = "sessionid", defaultValue = " ") String sessionid) { + List<THistoryEntity> list = thistoriesServices.getSessionId(sessionid); +// List<HashMap<Object, Object>> sList = new ArrayList<>(); +// for (int i = 0; i < list.size(); i++) { +// THistoryEntity th = list.get(i); +// HashMap<Object, Object> hashMap = new HashMap<>(); +// hashMap.put("id", th.getId()); +// hashMap.put("human", th.getHuman()); +// hashMap.put("ai", th.getAi()); +// sList.add(hashMap); +// } + PageUtils page = new PageUtils(list,0,0,0); + return R.ok() .put("page", page); + } + + } -- Gitblit v1.9.3