新增接口给大模型调用,推送资讯到全量库
This commit is contained in:
parent
e76ad82a95
commit
df83e8418c
|
|
@ -34,6 +34,7 @@ public class CommonController {
|
|||
private final String endPoint;
|
||||
private final String region;
|
||||
private final String bucketName;
|
||||
private final String apiKey;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final NewsInfoService newsInfoService;
|
||||
|
||||
|
|
@ -44,6 +45,7 @@ public class CommonController {
|
|||
@Value("${oss.endPoint}") String endPoint,
|
||||
@Value("${oss.region}") String region,
|
||||
@Value("${oss.bucketName}") String bucketName,
|
||||
@Value("${api.key}") String apiKey,
|
||||
ObjectMapper objectMapper,
|
||||
NewsInfoService newsInfoService) {
|
||||
this.stsEndPoint = stsEndPoint;
|
||||
|
|
@ -53,6 +55,7 @@ public class CommonController {
|
|||
this.endPoint = endPoint;
|
||||
this.region = region;
|
||||
this.bucketName = bucketName;
|
||||
this.apiKey = apiKey;
|
||||
this.objectMapper = objectMapper;
|
||||
this.newsInfoService = newsInfoService;
|
||||
}
|
||||
|
|
@ -121,9 +124,18 @@ public class CommonController {
|
|||
return ossVO;
|
||||
}
|
||||
|
||||
@GetMapping("/sync/{id}")
|
||||
public ResultObject<Void> sync(@PathVariable("id") String id) {
|
||||
@GetMapping("/sync/{id}/{code}")
|
||||
public ResultObject<Void> sync(@PathVariable("id") String id, @PathVariable("code") String code) {
|
||||
try {
|
||||
if (!StringUtils.hasText(id)) {
|
||||
return ResultObject.failed("参数有误!");
|
||||
}
|
||||
if (!StringUtils.hasText(code)) {
|
||||
return ResultObject.failed("参数有误!");
|
||||
}
|
||||
if (!code.equals(apiKey)) {
|
||||
return ResultObject.failed("参数有误!");
|
||||
}
|
||||
log.info("path: /sync/sync, method: GET, request news id: {}", id);
|
||||
return newsInfoService.publish(id, 1L);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -40,4 +40,6 @@ elasticsearch:
|
|||
username: elastic
|
||||
password: ZxE,3VM@Thk0
|
||||
mybatis:
|
||||
type-handlers-package:com.jinrui.reference.core.typehandler
|
||||
type-handlers-package:com.jinrui.reference.core.typehandler
|
||||
api:
|
||||
key: WBysu6N1z26AbA12l
|
||||
Loading…
Reference in New Issue