Browse Source

优化代码

DESKTOP-0GD05B0\Administrator 2 năm trước cách đây
mục cha
commit
0955cd8e75

+ 34 - 9
src/main/java/thyyxxk/webserver/service/externalhttp/emr/EmrEditor.java

@@ -5,33 +5,58 @@ import com.alibaba.fastjson.JSONObject;
 import com.dtflys.forest.annotation.*;
 
 
+@BaseRequest(baseURL = "http://172.16.32.125:8001/emr/runtime/api/v1")
 public interface EmrEditor {
-    @Get("http://172.16.32.125:8001/emr/runtime/api/v1/category/list/dept")
+
+    /**
+     * 获取全院模板
+     *
+     * @return json
+     */
+    @Get("/category/list/dept")
     JSONArray getEmrTree();
 
-    @Get("http://172.16.32.125:8001/emr/runtime/api/v1/snippet/list/tree")
+    /**
+     * 获取片段模板
+     *
+     * @return js
+     */
+    @Get("/snippet/list/tree")
     JSONArray getSnippetTree();
 
-    @Get("http://172.16.32.125:8001/emr/runtime/api/v1/document/docs/data/${id}?keyType=business")
+    /**
+     * 获取指定模板中的数据元
+     *
+     * @param id 文档id
+     * @return js
+     */
+    @Get("/document/docs/data/${id}?keyType=business")
     JSONObject getEditorJsonDataByDocumentId(@Query("id") String id);
 
-    @Put("http://172.16.32.125:8001/emr/runtime/api/v1/document/recover/{id}")
+    /**
+     * 恢复电子病历
+     *
+     * @param id         文档id
+     * @param jsonObject 值
+     * @return js
+     */
+    @Put("/document/recover/{id}")
     JSONObject resumeMedicalRecords(@Var("id") String id,
                                     @JSONBody JSONObject jsonObject);
 
-    @Get("http://172.16.32.125:8001/emr/runtime/api/v1/document/invalid/{id}")
+    @Get("/document/invalid/{id}")
     JSONObject getInvalidByDocumentIdApi(@Var("id") String id);
 
-    @Post("http://172.16.32.125:8001/emr/runtime/api/v1/document?history=1")
+    @Post("/document?history=1")
     JSONObject saveDocument(@JSONBody JSONObject jsonObject);
 
-    @Delete("http://172.16.32.125:8001/emr/runtime/api/v1/document/{id}")
+    @Delete("/document/{id}")
     JSONObject deleteEmr(@Var("id") String id);
 
-    @Get("http://172.16.32.125:8001/emr/runtime/api/v1/document/history/{id}")
+    @Get("/document/history/{id}")
     Object getHistory(@Var("id") String id);
 
-    @Get("http://172.16.32.125:8001/emr/runtime/api/v1/category/list/dept?code={deptCode}")
+    @Get("/category/list/dept?code={deptCode}")
     JSONArray getDeptList(@Var("deptCode") String deptCode);
 
 }