Commit a8d6fa2e authored by 曲欣亮's avatar 曲欣亮

修改翻译API

parent a33f3d52
......@@ -193,13 +193,29 @@ public class LanguageController {
}
@ResponseBody
@PostMapping("getTree")
@PostMapping("getDocumentsByLink")
@ApiOperation("查询翻译文档")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "appid", dataType = "string", required = false, value = "appid"),
@ApiImplicitParam(paramType = "query", name = "sig", dataType = "string", required = false, value = "sig"),
@ApiImplicitParam(paramType = "query", name = "sLink", dataType = "string", required = true, value = "要查询文档树的目录")
})
public Object getTree(String sTopLink) {
public Object getDocumentsByLink(String sLink) {
String sNodeID = service.getNodeIDByLink(sLink);
Map<String, Object> map = service.getNodeMapByID(sNodeID);
String sContentText = (String)map.get("sContentText");
return Rjx.jsonOk().setData(GsonUtil.toList(sContentText));
}
@ResponseBody
@PostMapping("getTreeByLink")
@ApiOperation("查询翻译文档树")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "appid", dataType = "string", required = false, value = "appid"),
@ApiImplicitParam(paramType = "query", name = "sig", dataType = "string", required = false, value = "sig"),
@ApiImplicitParam(paramType = "query", name = "sTopLink", dataType = "string", required = true, value = "要查询文档树的根[最上层]目录")
})
public Object getTreeByLink(String sTopLink) {
String sTopID = service.getNodeIDByLink(sTopLink);
List<Map<String, Object>> list = null;
if(sTopID == null) {
......@@ -240,6 +256,7 @@ public class LanguageController {
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "appid", dataType = "string", required = false, value = "appid"),
@ApiImplicitParam(paramType = "query", name = "sig", dataType = "string", required = false, value = "sig"),
@ApiImplicitParam(paramType = "query", name = "sDocument", dataType = "string", required = true, value = "翻译文档对象[JSON]结构")
})
public Object translate(String sLink, String sDocument) {
String sNodeID = service.getNodeIDByLink(sLink, true);
......@@ -277,6 +294,19 @@ public class LanguageController {
return Rjx.jsonOk().setData(dst);
}
// @ResponseBody
// @PostMapping("translate")
// @ApiOperation("翻译文档")
// @ApiImplicitParams({
// @ApiImplicitParam(paramType = "query", name = "appid", dataType = "string", required = false, value = "appid"),
// @ApiImplicitParam(paramType = "query", name = "sig", dataType = "string", required = false, value = "sig"),
// })
// public Object translate(String sLink, String json) {
// String sNodeID = service.getNodeIDByLink(sLink, true);
//
// return Rjx.jsonOk();
// }
public LanguageService getService() {
return service;
}
......
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