parent
9cd06ce62b
commit
7bdb89ff4a
|
|
@ -7,6 +7,8 @@ import com.xjs.translation.domain.qo.translation.BaiDuTranslationQo;
|
|||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import static com.xjs.common.consts.ApiConst.BAIDU_FY;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc 百度翻译接口api调用
|
||||
|
|
@ -16,7 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
public interface BaiduFeignClient {
|
||||
|
||||
@PostMapping(headers = {"Content-Type=application/x-www-form-urlencoded"})
|
||||
@ApiLog(name = "baidu",
|
||||
@ApiLog(name = BAIDU_FY,
|
||||
url = "http://api.fanyi.baidu.com/api/trans/vip/translate",
|
||||
method = "Post")
|
||||
JSONObject translationApi(BaiDuTranslationQo qo);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import org.springframework.cloud.openfeign.FeignClient;
|
|||
import org.springframework.cloud.openfeign.SpringQueryMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import static com.xjs.common.consts.ApiConst.TIANXING_PYQ;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc 天行数据朋友圈文案接口api调用
|
||||
|
|
@ -18,7 +20,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
public interface TianXingPYQFeignClient {
|
||||
|
||||
@GetMapping
|
||||
@ApiLog(name = "tianXing",
|
||||
@ApiLog(name = TIANXING_PYQ,
|
||||
url = "http://api.tianapi.com/pyqwenan/index",
|
||||
method = "Get")
|
||||
JSONObject copyWritingApi(@SpringQueryMap RequestBody requestBody);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import org.springframework.cloud.openfeign.FeignClient;
|
|||
import org.springframework.cloud.openfeign.SpringQueryMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import static com.xjs.common.consts.ApiConst.TIANXING_WYY;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc 天行数据网易云热评接口api调用
|
||||
|
|
@ -17,7 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
@FeignClient(name = "tianXingWYY",url = "http://api.tianapi.com/hotreview/index",fallbackFactory = TianXingWYYFeignFactory.class)
|
||||
public interface TianXingWYYFeignClient {
|
||||
@GetMapping
|
||||
@ApiLog(name = "tianXing",
|
||||
@ApiLog(name = TIANXING_WYY,
|
||||
url = "http://api.tianapi.com/hotreview/index",
|
||||
method = "Get")
|
||||
JSONObject copyWritingApi(@SpringQueryMap RequestBody requestBody);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import org.springframework.cloud.openfeign.FeignClient;
|
|||
import org.springframework.cloud.openfeign.SpringQueryMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import static com.xjs.common.consts.ApiConst.YOUDAO_FY;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc 有道翻译接口api调用
|
||||
|
|
@ -17,7 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
public interface YouDaoFeignClient {
|
||||
|
||||
@GetMapping( headers ={ "Accept-Encoding=''"})
|
||||
@ApiLog(name = "youdao",
|
||||
@ApiLog(name = YOUDAO_FY,
|
||||
url = "http://fanyi.youdao.com/translate",
|
||||
method = "Get")
|
||||
JSONObject translationApi(@SpringQueryMap YouDaoTranslationQo qo);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.xjs.common.consts;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc api名称常量类
|
||||
* @create 2021-12-28
|
||||
*/
|
||||
public class ApiConst {
|
||||
public static final String YOUDAO_FY= "有道翻译";
|
||||
|
||||
public static final String BAIDU_FY= "百度翻译";
|
||||
|
||||
public static final String TIANXING_PYQ= "天行-朋友圈";
|
||||
|
||||
public static final String TIANXING_WYY= "天行-网易云";
|
||||
}
|
||||
|
|
@ -42,9 +42,6 @@ public class CopyWritingController extends BaseController {
|
|||
@Autowired
|
||||
private CopyWritingService copyWritingService;
|
||||
|
||||
//todo 文案管理前端页面,
|
||||
// 实现其他天行数据接口,
|
||||
// 实现其他朋友圈文案api,
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("文案接口")
|
||||
|
|
|
|||
Loading…
Reference in New Issue