Commit e3e37317 authored by zhouwei's avatar zhouwei

Merge branch 'dev' into 'master'

Dev

See merge request !10
parents bfcdbc5d 8202f94f
package com.nanyan.securitylink.controller;
import com.alibaba.fastjson.JSONObject;
import com.nanyan.securitylink.dto.AIRequestDTO;
import com.nanyan.securitylink.service.AIService;
import com.nanyan.securitylink.vo.AIResponse;
import com.nanyan.securitylink.vo.CodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -14,20 +16,30 @@ public class AIController {
@Autowired
AIService aiService;
@PostMapping("/translate")
public Response<AIResponse> translate(@RequestBody AIRequestDTO AIRequestDTO) {
public Response<AIResponse<String>> translate(@RequestBody AIRequestDTO AIRequestDTO) {
return Response.SUCCESS(aiService.translate(AIRequestDTO));
}
@PostMapping("/news/tag")
public Response<AIResponse> newsTag(@RequestBody AIRequestDTO AIRequestDTO) {
public Response<AIResponse<CodeVO>> newsTag(@RequestBody AIRequestDTO AIRequestDTO) {
return Response.SUCCESS(aiService.newsTags(AIRequestDTO));
}
@PostMapping("/natural/disaster/tag")
public Response<AIResponse> naturalDisasterTag(@RequestBody AIRequestDTO AIRequestDTO) {
public Response<AIResponse<CodeVO>> naturalDisasterTag(@RequestBody AIRequestDTO AIRequestDTO) {
return Response.SUCCESS(aiService.naturalDisasterTag(AIRequestDTO));
}
@PostMapping("/news/tag/translate")
public Response<AIResponse> newsTagAndTranslate(@RequestBody AIRequestDTO AIRequestDTO) {
public Response<AIResponse<JSONObject>> newsTagAndTranslate(@RequestBody AIRequestDTO AIRequestDTO) {
return Response.SUCCESS(aiService.newsTagAndTranslate(AIRequestDTO));
}
@PostMapping("/urgent/notice")
public Response<AIResponse<JSONObject>> dealUrgentNotice(@RequestBody AIRequestDTO AIRequestDTO) {
return Response.SUCCESS(aiService.dealUrgentNotice(AIRequestDTO));
}
@PostMapping("/news/country/city")
public Response<AIResponse<JSONObject>> collectNewsCountryAndCity(@RequestBody AIRequestDTO AIRequestDTO) {
return Response.SUCCESS(aiService.collectNewsCountryAndCity(AIRequestDTO));
}
}
......@@ -12,4 +12,8 @@ public interface AIService {
AIResponse<CodeVO> naturalDisasterTag(AIRequestDTO aiRequestDTO);
AIResponse<JSONObject> newsTagAndTranslate(AIRequestDTO aiRequestDTO);
AIResponse<JSONObject> dealUrgentNotice(AIRequestDTO aiRequestDTO);
AIResponse<JSONObject> collectNewsCountryAndCity(AIRequestDTO aiRequestDTO);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment