BUGFIX:数据传输过程中long精度发生丢失

This commit is contained in:
2024-01-22 16:21:32 +08:00
parent 404172e5f2
commit 164454b5b2
3 changed files with 16 additions and 14 deletions

View File

@@ -55,12 +55,14 @@ public class GenerateController {
@ApiOperation(value = "发起生成请求,异步获取结果")
@PostMapping("/prepare")
public Response<Long> prepareForGenerate(@Valid @RequestBody GenerateThroughImageTextDTO generateThroughImageTextDTO){
return Response.success(generateService.prepareForGenerate(generateThroughImageTextDTO));
public Response<String> prepareForGenerate(@Valid @RequestBody GenerateThroughImageTextDTO generateThroughImageTextDTO){
Long l = generateService.prepareForGenerate(generateThroughImageTextDTO);
// 防止long精度丢失这里转为String类型进行传输
return Response.success(String.valueOf(l));
}
@ApiOperation(value = "取消继续生成")
@PostMapping("/stopWaiting")
@GetMapping("/stopWaiting")
public Response<String> stopWaiting(@RequestParam("uniqueId") Long uniqueId){
generateService.cancelGenerate(uniqueId);
return Response.success("stop waiting successfully");