5 changed files with 86 additions and 2 deletions
			
			
		@ -1,15 +1,41 @@ | 
				
			|||||||
package com.hnac.hzims.bigmodel.maintenance.service.impl; | 
					package com.hnac.hzims.bigmodel.maintenance.service.impl; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import cn.hutool.http.HttpRequest; | 
				
			||||||
 | 
					import cn.hutool.http.HttpResponse; | 
				
			||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
					import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
				
			||||||
import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; | 
					import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; | 
				
			||||||
import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper; | 
					import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper; | 
				
			||||||
import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService; | 
					import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService; | 
				
			||||||
 | 
					import org.springblade.core.tool.jackson.JsonUtil; | 
				
			||||||
import org.springframework.stereotype.Service; | 
					import org.springframework.stereotype.Service; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javax.servlet.http.HttpServletResponse; | 
				
			||||||
 | 
					import java.nio.charset.StandardCharsets; | 
				
			||||||
 | 
					import java.util.Base64; | 
				
			||||||
 | 
					import java.util.Map; | 
				
			||||||
 | 
					
 | 
				
			||||||
/** | 
					/** | 
				
			||||||
 * @Author: ypj | 
					 * @Author: ypj | 
				
			||||||
 * @Date: 2024/9/2 16:14 | 
					 * @Date: 2024/9/2 16:14 | 
				
			||||||
 */ | 
					 */ | 
				
			||||||
@Service | 
					@Service | 
				
			||||||
public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService { | 
					public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private static final String CLIENT_SIGN = "vector_param"; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    public String getAuthorization() { | 
				
			||||||
 | 
					        return "Basic " + Base64.getEncoder().encodeToString(CLIENT_SIGN.getBytes(StandardCharsets.UTF_8)); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    public Map getUrlResponse(String url, String token) { | 
				
			||||||
 | 
					        HttpResponse response = HttpRequest.get(url) | 
				
			||||||
 | 
					                .header("Authorization", getAuthorization()) | 
				
			||||||
 | 
					                .header("Blade-Auth", token).execute(); | 
				
			||||||
 | 
					        if (response.getStatus() == HttpServletResponse.SC_OK) { | 
				
			||||||
 | 
					            return JsonUtil.toMap(response.body()); | 
				
			||||||
 | 
					        } | 
				
			||||||
 | 
					        return null; | 
				
			||||||
 | 
					    } | 
				
			||||||
} | 
					} | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,17 @@ | 
				
			|||||||
 | 
					CREATE TABLE `HZIMS_VECTOR_PARAM`  ( | 
				
			||||||
 | 
					   `ID` bigint(20) NOT NULL COMMENT '主键ID', | 
				
			||||||
 | 
					   `NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称', | 
				
			||||||
 | 
					   `URL` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'URL', | 
				
			||||||
 | 
					   `PROJECT_PREFIX` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目前缀', | 
				
			||||||
 | 
					   `TABLE_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '数据库表名', | 
				
			||||||
 | 
					   `ATTRIBUTE_MAP` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '向量键值对', | 
				
			||||||
 | 
					   `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', | 
				
			||||||
 | 
					   `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', | 
				
			||||||
 | 
					   `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', | 
				
			||||||
 | 
					   `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', | 
				
			||||||
 | 
					   `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', | 
				
			||||||
 | 
					   `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', | 
				
			||||||
 | 
					   `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', | 
				
			||||||
 | 
					   `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', | 
				
			||||||
 | 
					   PRIMARY KEY (`ID`) USING BTREE | 
				
			||||||
 | 
					) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量键值对信息' ROW_FORMAT = Dynamic; | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue