6 changed files with 79 additions and 3 deletions
			
			
		@ -0,0 +1,20 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.bigmodel.api.dto; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import io.swagger.annotations.ApiModel; | 
				
			||||||
 | 
					import io.swagger.annotations.ApiModelProperty; | 
				
			||||||
 | 
					import lombok.Data; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @Author: ypj | 
				
			||||||
 | 
					 * @Date: 2024/8/12 16:02 | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@Data | 
				
			||||||
 | 
					@ApiModel(value = "大模型分析",description = "大模型分析参数") | 
				
			||||||
 | 
					public class BigModelAnalysisDTO { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty("策略编码") | 
				
			||||||
 | 
					    private String code; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiModelProperty("文件地址") | 
				
			||||||
 | 
					    private String url; | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,20 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.bigmodel.api.feign; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.hnac.hzims.bigmodel.BigModelConstants; | 
				
			||||||
 | 
					import com.hnac.hzims.bigmodel.api.dto.BigModelAnalysisDTO; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					import org.springframework.cloud.openfeign.FeignClient; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.PostMapping; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RequestBody; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @Author: ypj | 
				
			||||||
 | 
					 * @Date: 2024/8/12 15:57 | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@FeignClient(name = BigModelConstants.APP_NAME) | 
				
			||||||
 | 
					public interface IBigModelAnalysisClient { | 
				
			||||||
 | 
					    String PREFIX_API = "feign/bigModel"; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @PostMapping(PREFIX_API + "/analysis") | 
				
			||||||
 | 
					    R analysis(@RequestBody BigModelAnalysisDTO analysisInfo); | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,26 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.bigmodel.api.feign; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.hnac.hzims.bigmodel.api.dto.BigModelAnalysisDTO; | 
				
			||||||
 | 
					import com.hnac.hzims.bigmodel.zhipuai.service.ZhipuAnalysisService; | 
				
			||||||
 | 
					import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisRequest; | 
				
			||||||
 | 
					import lombok.AllArgsConstructor; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.PostMapping; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RestController; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @Author: ypj | 
				
			||||||
 | 
					 * @Date: 2024/8/12 16:10 | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@RestController | 
				
			||||||
 | 
					@AllArgsConstructor | 
				
			||||||
 | 
					public class BigModelAnalysisClient implements IBigModelAnalysisClient { | 
				
			||||||
 | 
					    private final ZhipuAnalysisService analysisService; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    @PostMapping(PREFIX_API + "/analysis") | 
				
			||||||
 | 
					    public R analysis(BigModelAnalysisDTO analysisInfo) { | 
				
			||||||
 | 
					        return R.data(analysisService.analysis(ZhipuAnalysisRequest.of(analysisInfo))); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					} | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue