diff --git a/api/src/main/java/com/wx/application/adapter/controller/GorseController.java b/api/src/main/java/com/wx/application/adapter/controller/GorseController.java index e25d16a..62d2be0 100644 --- a/api/src/main/java/com/wx/application/adapter/controller/GorseController.java +++ b/api/src/main/java/com/wx/application/adapter/controller/GorseController.java @@ -134,11 +134,11 @@ public class GorseController extends BaseController { @GetMapping(value = "/query_users") public ResponseData queryUsers(@RequestParam("cursor") String cursor) throws Exception { GorsePage page = gorseService.getUserPageByCursor(cursor); - if(page.getUsers() == null || page.getUsers().size() == 0) { + if (page.getUsers() == null || page.getUsers().size() == 0) { return success(page); } List ids = new ArrayList<>(); - for(User user : page.getUsers()) { + for (User user : page.getUsers()) { ids.add(user.getUserId()); } Map mQ = new HashMap<>(); @@ -150,14 +150,31 @@ public class GorseController extends BaseController { return success(obj); } + @GetMapping(value = "/query_user/{id}") + public ResponseData queryUser(@PathVariable("id") String id) { + User user = null; + try { + user = gorseService.getUserById(id); + } catch (Exception e) { + + } + + if (user == null) { + return success(); + } + Map mQ = new HashMap<>(); + mQ.put("EQS_fid", user.getUserId()); + return success(riskUserService.queryUnique(mQ)); + } + @GetMapping(value = "/query_items") public ResponseData queryItems(@RequestParam("cursor") String cursor) throws Exception { GorsePage page = gorseService.getItemPageByCursor(cursor); - if(page.getItems() == null || page.getItems().size() == 0) { + if (page.getItems() == null || page.getItems().size() == 0) { return success(page); } List ids = new ArrayList<>(); - for(Item item : page.getItems()) { + for (Item item : page.getItems()) { ids.add(item.getItemId()); } Map mQ = new HashMap<>(); @@ -169,4 +186,22 @@ public class GorseController extends BaseController { return success(obj); } + @GetMapping(value = "/query_item/{id}") + public ResponseData queryItem(@PathVariable("id") String id) { + Item item = null; + try { + item = gorseService.getItemById(id); + } catch (Exception e) { + + } + + if (item == null) { + return success(); + } + Map mQ = new HashMap<>(); + mQ.put("EQS_fid", item.getItemId()); + return success(entrysService.queryUnique(mQ)); + } + + } diff --git a/api/src/main/java/com/wx/application/gorse4j/GorseService.java b/api/src/main/java/com/wx/application/gorse4j/GorseService.java index 43b4031..bb00737 100644 --- a/api/src/main/java/com/wx/application/gorse4j/GorseService.java +++ b/api/src/main/java/com/wx/application/gorse4j/GorseService.java @@ -101,6 +101,13 @@ public class GorseService { return this.request("GET", baseUrl, null, GorsePage.class); } + /** + * 查询用户 + */ + public User getUserById(String id) throws IOException { + return this.request("GET", this.endpoint + "/api/dashboard/user/" + id, null, User.class); + } + /** * 分页查询物品 */ @@ -112,6 +119,13 @@ public class GorseService { return this.request("GET", baseUrl, null, GorsePage.class); } + /** + * 查询物品 + */ + public Item getItemById(String id) throws IOException { + return this.request("GET", this.endpoint + "/api/item/" + id, null, Item.class); + } + /** * 洞悉(根据用户获取推荐) */ diff --git a/web/src/components/dialog/TagModify.vue b/web/src/components/dialog/TagModify.vue index 1e8e820..1efd575 100644 --- a/web/src/components/dialog/TagModify.vue +++ b/web/src/components/dialog/TagModify.vue @@ -15,7 +15,7 @@ height="550" border style="width: 100%"> - + diff --git a/web/src/components/menus/EntrysManage.vue b/web/src/components/menus/EntrysManage.vue index 13181aa..2f4aeb2 100644 --- a/web/src/components/menus/EntrysManage.vue +++ b/web/src/components/menus/EntrysManage.vue @@ -6,14 +6,17 @@ 0) { + this.loading = true; + request({ + url: '/gorse/query_item/' + this.qo.LIKES_fid, + method: 'get', + }).then(res => { + let user = res.data; + if (!user) { + _this.result.records = []; + } else { + if (user.categories) { + user.categoriesArr = user.categories.split(','); + } else { + user.categoriesArr = []; + } + if (user.labels) { + user.labelsArr = user.labels.split(','); + } else { + user.labelsArr = []; + } + _this.result.records = [user]; + } + + this.loading = false; + }); + } else { + this.cursorArr = ['']; + this.queryData(1); + } + }, queryData(index) { this.loading = true; if (index < 0 && this.cursorArr.length >= 2) { @@ -258,7 +293,7 @@ export default { createRow() { _this.dialogName = '新建'; _this.cmdDialogVisible = true; - _this.$nextTick(_=> { + _this.$nextTick(_ => { _this.$refs['cmd'].clearValidate(); _this.cmd = { fid: '', @@ -272,7 +307,7 @@ export default { modifyRow(item) { _this.dialogName = '编辑'; _this.cmdDialogVisible = true; - _this.$nextTick(_=> { + _this.$nextTick(_ => { _this.$refs['cmd'].clearValidate(); _this.cmd = JSON.parse(JSON.stringify(item)); }) @@ -280,10 +315,10 @@ export default { submitModify() { this.$refs.cmd.validate((valid) => { if (valid) { - if(_this.cmd.categoriesArr) { + if (_this.cmd.categoriesArr) { _this.cmd.categories = _this.cmd.categoriesArr.toString(); } - if(_this.cmd.labelsArr) { + if (_this.cmd.labelsArr) { _this.cmd.labels = _this.cmd.labelsArr.toString(); } @@ -328,7 +363,7 @@ export default { }, handleInputConfirm(typeName) { let inputValue = _this[typeName + "InputValue"]; - if(inputValue) { + if (inputValue) { _this.cmd[typeName + "Arr"].push(inputValue); } _this[typeName + "InputVisible"] = false; diff --git a/web/src/components/menus/UserManage.vue b/web/src/components/menus/UserManage.vue index e6dcf4e..fce3a63 100644 --- a/web/src/components/menus/UserManage.vue +++ b/web/src/components/menus/UserManage.vue @@ -10,7 +10,7 @@ - 搜 索 + 搜 索 上一页 @@ -41,13 +41,13 @@