【修改】 修改windows网络设置传值由List改成对象

This commit is contained in:
MSI\letre
2025-07-07 19:53:59 +08:00
parent 925d4c2ad2
commit 454625ec26
3 changed files with 15 additions and 19 deletions

View File

@@ -122,7 +122,7 @@ public class AutoController {
* @return String * @return String
*/ */
@PostMapping("/judgementForEdgeDummyToJson") @PostMapping("/judgementForEdgeDummyToJson")
public Result<String> judgementForEdgeDummyToJson(@RequestBody List<StuInfoVo> stuInfoVo){ public Result<String> judgementForEdgeDummyToJson(@RequestBody StuInfoVo stuInfoVo){
return Result.success(autoForWinEdgeSettingService.autoForEdgeToJson(stuInfoVo)); return Result.success(autoForWinEdgeSettingService.autoForEdgeToJson(stuInfoVo));
} }
/** /**

View File

@@ -11,7 +11,7 @@ import java.util.List;
*/ */
public interface AutoForWinEdgeSettingService { public interface AutoForWinEdgeSettingService {
String autoForEdgeToJson(List<StuInfoVo> stuInfoVo); String autoForEdgeToJson(StuInfoVo stuInfoVo);
BigDecimal autoForEdge(StuInfoVo stuInfoVo) throws IOException; BigDecimal autoForEdge(StuInfoVo stuInfoVo) throws IOException;
} }

View File

@@ -48,25 +48,21 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
* @return 是否通过 * @return 是否通过
*/ */
@Override @Override
public String autoForEdgeToJson(List<StuInfoVo> stuInfoVo) { public String autoForEdgeToJson(StuInfoVo stuInfoVo) {
// 写入到文件夹 // 写入到文件夹
for (StuInfoVo infoVo : stuInfoVo) { // 试题ID
// 试题ID String quId = stuInfoVo.getQuestionId();
String quId = infoVo.getQuestionId(); String edgeAnswerKey = stuInfoVo.getEdgeAnswerKeys();
String edgeAnswerKey = infoVo.getEdgeAnswerKeys(); String edgeAnswerValue = stuInfoVo.getEdgeAnswerValues();
String edgeAnswerValue = infoVo.getEdgeAnswerValues(); // 保存ID路径
// 保存ID路径 String filePath = stuInfoVo.getFilePath();
String filePath = infoVo.getFilePath(); File file = new File(filePath + "/"+ quId +"@EdgeDummy.json");
File file = new File(filePath + "/"+ quId +"@EdgeDummy.json"); if (!file.exists()) {
if (!file.exists()) { LogFileUtils.createFile(filePath + "/"+ quId +"@EdgeDummy.json");
LogFileUtils.createFile(filePath + "/"+ quId +"@EdgeDummy.json");
}
Map<String, String> map = new HashMap<>();
map.put(edgeAnswerKey, edgeAnswerValue);
writeMapToJson(map, filePath + "/"+ quId +"@EdgeDummy.json");
} }
Map<String, String> map = new HashMap<>();
return "成功"; map.put(edgeAnswerKey, edgeAnswerValue);
return writeMapToJson(map, filePath + "/"+ quId +"@EdgeDummy.json");
} }
@Override @Override