4 changed files with 123 additions and 0 deletions
			
			
		@ -0,0 +1,52 @@ | 
				
			|||||||
 | 
					package com.hnac.gglm.bigmodel.business.controller; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; | 
				
			||||||
 | 
					import com.hnac.gglm.bigmodel.business.service.VectorDataService; | 
				
			||||||
 | 
					import com.hnac.hzinfo.api.annotation.ApiInterface; | 
				
			||||||
 | 
					import io.swagger.annotations.Api; | 
				
			||||||
 | 
					import io.swagger.annotations.ApiOperation; | 
				
			||||||
 | 
					import lombok.AllArgsConstructor; | 
				
			||||||
 | 
					import lombok.extern.slf4j.Slf4j; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.GetMapping; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RequestMapping; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RestController; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @Author: ypj | 
				
			||||||
 | 
					 * @Date: 2024/9/18 10:17 | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@RestController | 
				
			||||||
 | 
					@RequestMapping("/data") | 
				
			||||||
 | 
					@Api(value = "向量数据", tags = "向量数据") | 
				
			||||||
 | 
					@AllArgsConstructor | 
				
			||||||
 | 
					@Slf4j | 
				
			||||||
 | 
					public class VectorDataController { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final VectorDataService vectorDataService; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @GetMapping("/getModelAttributeData") | 
				
			||||||
 | 
					    @ApiOperation(value = "获取模型属性数据") | 
				
			||||||
 | 
					    @ApiOperationSupport(order = 11) | 
				
			||||||
 | 
					    @ApiInterface | 
				
			||||||
 | 
					    public R getModelAttributeData() { | 
				
			||||||
 | 
					        return R.data(vectorDataService.getModelAttributeData()); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @GetMapping("/getModelEventData") | 
				
			||||||
 | 
					    @ApiOperation(value = "获取模型事件数据") | 
				
			||||||
 | 
					    @ApiOperationSupport(order = 12) | 
				
			||||||
 | 
					    @ApiInterface | 
				
			||||||
 | 
					    public R getModelEventData() { | 
				
			||||||
 | 
					        return R.data(vectorDataService.getModelEventData()); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @GetMapping("/getModelFunctionData") | 
				
			||||||
 | 
					    @ApiOperation(value = "获取模型功能数据") | 
				
			||||||
 | 
					    @ApiOperationSupport(order = 13) | 
				
			||||||
 | 
					    @ApiInterface | 
				
			||||||
 | 
					    public R getModelFunctionData() { | 
				
			||||||
 | 
					        return R.data(vectorDataService.getModelFunctionData()); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,20 @@ | 
				
			|||||||
 | 
					package com.hnac.gglm.bigmodel.business.service; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @Author: ypj | 
				
			||||||
 | 
					 * @Date: 2024/9/16 18:16 | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					public interface VectorDataService { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    List<ModelAttrVO> getModelAttributeData(); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    List<ModelFuncVO> getModelFunctionData(); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    List<ModelEventVO> getModelEventData(); | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,43 @@ | 
				
			|||||||
 | 
					package com.hnac.gglm.bigmodel.business.service.impl; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.hnac.gglm.bigmodel.business.service.VectorDataService; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.ModelClient; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; | 
				
			||||||
 | 
					import lombok.AllArgsConstructor; | 
				
			||||||
 | 
					import lombok.extern.slf4j.Slf4j; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					import org.springframework.stereotype.Service; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @Author: ypj | 
				
			||||||
 | 
					 * @Date: 2024/9/16 18:17 | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@Service | 
				
			||||||
 | 
					@Slf4j | 
				
			||||||
 | 
					@AllArgsConstructor | 
				
			||||||
 | 
					public class VectorDataServiceImpl implements VectorDataService { | 
				
			||||||
 | 
					    private final ModelClient modelClient; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    public List<ModelAttrVO> getModelAttributeData() { | 
				
			||||||
 | 
					        R<List<ModelAttrVO>> response = modelClient.listAttribute(); | 
				
			||||||
 | 
					        return response.getData(); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    public List<ModelFuncVO> getModelFunctionData() { | 
				
			||||||
 | 
					        R<List<ModelFuncVO>> response = modelClient.listFunction(); | 
				
			||||||
 | 
					        return response.getData(); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    public List<ModelEventVO> getModelEventData() { | 
				
			||||||
 | 
					        R<List<ModelEventVO>> response = modelClient.listEvent(); | 
				
			||||||
 | 
					        return response.getData(); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					} | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue