diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java index 86b9031..13b0475 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java @@ -17,6 +17,7 @@ import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -76,8 +77,10 @@ public class VectorParamController { @GetMapping("/getUrlResponse") @ApiOperation(value = "通过url获取向量参数数据") @ApiOperationSupport(order = 7) - public R getUrlResponse(@RequestParam String url, @RequestHeader("Blade-Auth") String token) { - return R.data(vectorParamService.getUrlResponse(url, token)); + public R getUrlResponse(@RequestParam String url, + @RequestHeader(name = "Blade-Auth", value = "Blade-Auth", required = false) String bladeToken, + @RequestHeader(name = "Hzinfo-Auth", value = "Hzinfo-Auth", required = false) String hzinfoToken) { + return R.data(vectorParamService.getUrlResponse(url, bladeToken, hzinfoToken)); } @GetMapping("/getTestData") @@ -91,4 +94,13 @@ public class VectorParamController { data.put("data", "data"); return R.data(data); } + + @GetMapping("/getUrlResponseKeyList") + @ApiOperation(value = "获取url返回的key列表") + @ApiOperationSupport(order = 9) + public R> getUrlResponseKeyList(@RequestParam String url, + @RequestHeader(name = "Blade-Auth", value = "Blade-Auth", required = false) String bladeToken, + @RequestHeader(name = "Hzinfo-Auth", value = "Hzinfo-Auth", required = false) String hzinfoToken) { + return R.data(vectorParamService.getUrlResponseKeyList(url, bladeToken, hzinfoToken)); + } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java index c1f6ed6..f38826f 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.tenant.mp.TenantEntity; import java.io.Serializable; @@ -21,6 +23,7 @@ public class VectorParamEntity extends TenantEntity implements Serializable { @ApiModelProperty("参数名称") @TableField("NAME") + @QueryField(condition = SqlCondition.LIKE) private String name; @ApiModelProperty("url") diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java index 392a877..4fac0be 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java @@ -3,6 +3,7 @@ package com.hnac.hzims.bigmodel.maintenance.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; +import java.util.List; import java.util.Map; /** @@ -13,5 +14,7 @@ import java.util.Map; public interface VectorParamService extends IService { String getAuthorization(); - Map getUrlResponse(String url, String token); + Map getUrlResponse(String url, String bladeToken ,String hzinfoToken); + + List getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java index 65e2545..0878002 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java @@ -6,12 +6,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper; import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.jackson.JsonUtil; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.Base64; +import java.util.List; import java.util.Map; /** @@ -19,6 +22,7 @@ import java.util.Map; * @Date: 2024/9/2 16:14 */ @Service +@Slf4j public class VectorParamServiceImpl extends ServiceImpl implements VectorParamService { private static final String CLIENT_SIGN = "vector_param"; @@ -29,13 +33,27 @@ public class VectorParamServiceImpl extends ServiceImpl getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken) { + List result = new ArrayList<>(); + Map map = getUrlResponse(url, bladeToken, hzinfoToken); + Map data = ((Map) map.get("data")); + if (data != null) { + result.addAll(data.keySet()); + } else { + result.addAll(map.keySet()); + } + return result; + } }