框选适配py
This commit is contained in:
@@ -72,6 +72,8 @@ public class PythonService {
|
||||
private String accessPythonPort;
|
||||
@Value("${minio.bucketName.gradient}")
|
||||
private String gradientBucketName;
|
||||
@Value("${minio.bucketName.users}")
|
||||
private String userBucketName;
|
||||
@Value("${access.python.generate_sr_port}")
|
||||
private String srServicePort;
|
||||
|
||||
@@ -3343,7 +3345,7 @@ public class PythonService {
|
||||
throw new BusinessException("system error!");
|
||||
}
|
||||
|
||||
public Boolean generateSketchOrPrint(String params, String port, String servicePath,String taskId) {
|
||||
public Boolean generateSketchOrPrint(String params, String port, String servicePath, String taskId) {
|
||||
//限流校验
|
||||
// AccessLimitUtils.validate("generateSketchOrPrint", 5);
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
@@ -3405,7 +3407,7 @@ public class PythonService {
|
||||
if (result && jsonObject.get("code").equals(200)) {
|
||||
log.info("Generate##responseObject###{}", jsonObject);
|
||||
// return setGenerateImageList(jsonObject.getJSONObject("data"));
|
||||
if (servicePath== CommonConstant.GENERATE_PATH_FLUX2_KLEIN){
|
||||
if (servicePath == CommonConstant.GENERATE_PATH_FLUX2_KLEIN) {
|
||||
//放入结果到mq
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
String outputPath = data.getString("output_path");
|
||||
@@ -4172,6 +4174,9 @@ public class PythonService {
|
||||
.writeTimeout(60, TimeUnit.SECONDS)
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
content.put("bucket", userBucketName);
|
||||
content.put("object_name", content.get("user_id") + "/" + "segment" + "/" + UUID.randomUUID() + ".png");
|
||||
content.remove("user_id");
|
||||
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content));
|
||||
|
||||
String url = accessPythonIp + ":" + accessPythonPort + "/api/seg_anything";
|
||||
|
||||
Reference in New Issue
Block a user