From 9a6f106059bfe6577df7715adccebd2a4016d763 Mon Sep 17 00:00:00 2001
From: "1437892690@qq.com" <1437892690@qq.com>
Date: Tue, 30 Jul 2024 12:07:45 +0800
Subject: [PATCH 1/4] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?=
=?UTF-8?q?=E5=85=A8=E5=B1=80=E6=8E=A7=E5=88=B6=E7=94=A8=E6=88=B7=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E9=A6=96=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
关联 #[1209375258017792]后端-全局控制用户默认首页 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1209375258017792
---
.../java/neatlogic/module/tenant/api/user/UserDataSaveApi.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java b/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
index a2c17ecc..bb0eac1f 100644
--- a/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
+++ b/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
@@ -15,15 +15,14 @@ along with this program. If not, see .*/
package neatlogic.module.tenant.api.user;
+import com.alibaba.fastjson.JSONObject;
import neatlogic.framework.asynchronization.threadlocal.UserContext;
-import neatlogic.framework.auth.core.AuthAction;
import neatlogic.framework.common.constvalue.ApiParamType;
import neatlogic.framework.dao.mapper.UserMapper;
import neatlogic.framework.dto.UserDataVo;
import neatlogic.framework.restful.annotation.*;
import neatlogic.framework.restful.constvalue.OperationTypeEnum;
import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
-import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
--
Gitee
From 42090077c73059679b6f66dd2835db89c756bacb Mon Sep 17 00:00:00 2001
From: "1437892690@qq.com" <1437892690@qq.com>
Date: Tue, 30 Jul 2024 12:08:45 +0800
Subject: [PATCH 2/4] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?=
=?UTF-8?q?=E5=85=A8=E5=B1=80=E6=8E=A7=E5=88=B6=E7=94=A8=E6=88=B7=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E9=A6=96=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
关联 #[1209375258017792]后端-全局控制用户默认首页 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1209375258017792
---
.../tenant/api/user/DeleteUserDataApi.java | 63 ++++++++++++++++++
.../tenant/api/user/GetUserDataApi.java | 65 +++++++++++++++++++
2 files changed, 128 insertions(+)
create mode 100644 src/main/java/neatlogic/module/tenant/api/user/DeleteUserDataApi.java
create mode 100644 src/main/java/neatlogic/module/tenant/api/user/GetUserDataApi.java
diff --git a/src/main/java/neatlogic/module/tenant/api/user/DeleteUserDataApi.java b/src/main/java/neatlogic/module/tenant/api/user/DeleteUserDataApi.java
new file mode 100644
index 00000000..56179cf4
--- /dev/null
+++ b/src/main/java/neatlogic/module/tenant/api/user/DeleteUserDataApi.java
@@ -0,0 +1,63 @@
+/*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .*/
+
+package neatlogic.module.tenant.api.user;
+
+import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.asynchronization.threadlocal.UserContext;
+import neatlogic.framework.common.constvalue.ApiParamType;
+import neatlogic.framework.dao.mapper.UserMapper;
+import neatlogic.framework.restful.annotation.*;
+import neatlogic.framework.restful.constvalue.OperationTypeEnum;
+import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+
+@OperationType(type = OperationTypeEnum.DELETE)
+public class DeleteUserDataApi extends PrivateApiComponentBase {
+
+ @Autowired
+ UserMapper userMapper;
+
+
+ @Override
+ public String getToken() {
+ return "user/data/delete";
+ }
+
+ @Override
+ public String getName() {
+ return "nmtau.deleteuserdataapi.getname";
+ }
+
+ @Override
+ public String getConfig() {
+ return null;
+ }
+
+ @Input({
+ @Param(name = "type", type = ApiParamType.STRING, isRequired = true, desc = "common.type", help = "如果是用户默认模块数据,则应指定为defaultModulePage")
+ })
+ @Output({})
+ @Description(desc = "nmtau.deleteuserdataapi.getname")
+ @Override
+ public Object myDoService(JSONObject jsonObj) throws Exception {
+ String type = jsonObj.getString("type");
+ userMapper.deleteUserDataByUserUuidAndType(UserContext.get().getUserUuid(true), type);
+ return null;
+ }
+}
diff --git a/src/main/java/neatlogic/module/tenant/api/user/GetUserDataApi.java b/src/main/java/neatlogic/module/tenant/api/user/GetUserDataApi.java
new file mode 100644
index 00000000..605a757e
--- /dev/null
+++ b/src/main/java/neatlogic/module/tenant/api/user/GetUserDataApi.java
@@ -0,0 +1,65 @@
+/*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .*/
+
+package neatlogic.module.tenant.api.user;
+
+import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.asynchronization.threadlocal.UserContext;
+import neatlogic.framework.common.constvalue.ApiParamType;
+import neatlogic.framework.dao.mapper.UserMapper;
+import neatlogic.framework.dto.UserDataVo;
+import neatlogic.framework.restful.annotation.*;
+import neatlogic.framework.restful.constvalue.OperationTypeEnum;
+import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+
+@OperationType(type = OperationTypeEnum.SEARCH)
+public class GetUserDataApi extends PrivateApiComponentBase {
+
+ @Autowired
+ UserMapper userMapper;
+
+ @Override
+ public String getToken() {
+ return "user/data/get";
+ }
+
+ @Override
+ public String getName() {
+ return "nmtau.getuserdataapi.getname";
+ }
+
+ @Override
+ public String getConfig() {
+ return null;
+ }
+
+ @Input({
+ @Param(name = "type", type = ApiParamType.STRING, isRequired = true, desc = "common.type", help = "如果是用户默认模块数据,则应指定为defaultModulePage")
+ })
+ @Output({
+ @Param(explode = UserDataVo.class)
+ })
+ @Description(desc = "nmtau.getuserdataapi.getname")
+ @Override
+ public Object myDoService(JSONObject jsonObj) throws Exception {
+ String userUuid = UserContext.get().getUserUuid(true);
+ String type = jsonObj.getString("type");
+ return userMapper.getUserDataByUserUuidAndType(userUuid, type);
+ }
+}
--
Gitee
From 09b64df34225a171985151ee9abd6e8d0008ab61 Mon Sep 17 00:00:00 2001
From: "1437892690@qq.com" <1437892690@qq.com>
Date: Tue, 30 Jul 2024 15:14:54 +0800
Subject: [PATCH 3/4] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?=
=?UTF-8?q?=E5=85=A8=E5=B1=80=E6=8E=A7=E5=88=B6=E7=94=A8=E6=88=B7=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E9=A6=96=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
关联 #[1209375258017792]后端-全局控制用户默认首页 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1209375258017792
---
.../neatlogic/module/tenant/api/auth/AuthModuleGetApi.java | 5 ++---
.../neatlogic/module/tenant/api/user/UserDataSaveApi.java | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/main/java/neatlogic/module/tenant/api/auth/AuthModuleGetApi.java b/src/main/java/neatlogic/module/tenant/api/auth/AuthModuleGetApi.java
index f22537eb..ade73eda 100644
--- a/src/main/java/neatlogic/module/tenant/api/auth/AuthModuleGetApi.java
+++ b/src/main/java/neatlogic/module/tenant/api/auth/AuthModuleGetApi.java
@@ -132,13 +132,12 @@ public class AuthModuleGetApi extends PrivateApiComponentBase {
if (CollectionUtils.isNotEmpty(homePageIdList)) {
HomePageVo homePage = homePageMapper.getMinSortHomePageByIdList(homePageIdList);
if (homePage != null) {
- userDataVo = new UserDataVo(UserContext.get().getUserUuid(), homePage.getConfigStr(), "defaultModulePage");
+ userDataVo = new UserDataVo(UserContext.get().getUserUuid(), homePage.getConfig(), "defaultModulePage");
}
}
}
if (userDataVo != null) {
- String data = userDataVo.getData();
- JSONObject dataJson = JSONObject.parseObject(data);
+ JSONObject dataJson = userDataVo.getData();
JSONArray defaultModulePageList = dataJson.getJSONArray("defaultModulePageList");
for (int i = 0; i < defaultModulePageList.size(); i++) {
JSONObject o = defaultModulePageList.getJSONObject(i);
diff --git a/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java b/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
index bb0eac1f..b43c272d 100644
--- a/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
+++ b/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
@@ -61,7 +61,7 @@ public class UserDataSaveApi extends PrivateApiComponentBase {
String userUuid = UserContext.get().getUserUuid(true);
String type = jsonObj.getString("type");
userDataVo.setUserUuid(userUuid);
- userDataVo.setData(jsonObj.toJSONString());
+ userDataVo.setData(jsonObj);
userDataVo.setType(type);
if(userMapper.getUserDataByUserUuidAndType(userUuid,type) == null){
--
Gitee
From ed985e2c421edc2394b73045193596379d1e7d73 Mon Sep 17 00:00:00 2001
From: "1437892690@qq.com" <1437892690@qq.com>
Date: Tue, 30 Jul 2024 15:16:16 +0800
Subject: [PATCH 4/4] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?=
=?UTF-8?q?=E5=85=A8=E5=B1=80=E6=8E=A7=E5=88=B6=E7=94=A8=E6=88=B7=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E9=A6=96=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
关联 #[1209375258017792]后端-全局控制用户默认首页 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1209375258017792
---
.../neatlogic/module/tenant/api/user/UserDataSaveApi.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java b/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
index b43c272d..5c41cdb2 100644
--- a/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
+++ b/src/main/java/neatlogic/module/tenant/api/user/UserDataSaveApi.java
@@ -42,7 +42,7 @@ public class UserDataSaveApi extends PrivateApiComponentBase {
@Override
public String getName() {
- return "保存用户数据";
+ return "nmtau.userdatasaveapi.getname";
}
@Override
@@ -50,11 +50,11 @@ public class UserDataSaveApi extends PrivateApiComponentBase {
return null;
}
- @Input({@Param(name = "type", type = ApiParamType.STRING, desc = "功能类型,如果是用户默认模块数据,则应指定为defaultModulePage",
- isRequired = true)
+ @Input({
+ @Param(name = "type", type = ApiParamType.STRING, isRequired = true, desc = "common.type", help = "如果是用户默认模块数据,则应指定为defaultModulePage")
})
@Output({})
- @Description(desc = "保存用户数据")
+ @Description(desc = "nmtau.userdatasaveapi.getname")
@Override
public Object myDoService(JSONObject jsonObj) throws Exception {
UserDataVo userDataVo = new UserDataVo();
--
Gitee