| | |
| | | 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.*;
|
| | |
| | | private THistoryService tHistoryService;
|
| | | @Autowired
|
| | | private THistoryDao tHistoryDao;
|
| | | @Autowired
|
| | | private ThistoriesServices thistoriesServices;
|
| | |
|
| | | /**
|
| | | * 列表
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | 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(sList,0,0,0);
|
| | | return R.ok() .put("page", page);
|
| | | }
|
| | |
|
| | |
|
| | | }
|