You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2024/11/02 10:47:04 UTC
[PR] [type:fix] namespace user rel [shenyu]
Aias00 opened a new pull request, #5746:
URL: https://github.com/apache/shenyu/pull/5746
<!-- Describe your PR here; e.g. Fixes #issueNo -->
namespace bugs fix
<!--
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
-->
Make sure that:
- [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
- [x] You submit test cases (unit or integration tests) that back your changes.
- [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind commented on code in PR #5746:
URL: https://github.com/apache/shenyu/pull/5746#discussion_r1829219862
##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/event/namespace/NamespaceCreatedEvent.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.model.event.namespace;
+
+import org.apache.shenyu.admin.model.entity.NamespaceDO;
+import org.apache.shenyu.admin.model.enums.EventTypeEnum;
+import org.apache.shenyu.admin.model.event.AdminDataModelChangedEvent;
+
+/**
+ * NamespaceCreatedEvent.
+ */
+public class NamespaceCreatedEvent extends AdminDataModelChangedEvent {
+
+ /**
+ * Create a new {@code NamespaceCreatedEvent}.operator is unknown.
+ *
+ * @param source Current namespace state
+ * @param userId operator
+ */
+ public NamespaceCreatedEvent(final NamespaceDO source, final String userId) {
+ super(source, null, EventTypeEnum.NAMESPACE_CREATE, null, userId);
+ }
+
+
+ @Override
+ public String eventName() {
+ return "namespace";
Review Comment:
you can refactor the magic value
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind commented on code in PR #5746:
URL: https://github.com/apache/shenyu/pull/5746#discussion_r1827680526
##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/event/namespace/NamespaceCreatedEvent.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.model.event.namespace;
+
+import org.apache.shenyu.admin.model.entity.NamespaceDO;
+import org.apache.shenyu.admin.model.enums.EventTypeEnum;
+import org.apache.shenyu.admin.model.event.AdminDataModelChangedEvent;
+
+/**
+ * NamespaceCreatedEvent.
+ */
+public class NamespaceCreatedEvent extends AdminDataModelChangedEvent {
+
+ /**
+ * Create a new {@code NamespaceCreatedEvent}.operator is unknown.
+ *
+ * @param source Current namespace state
+ * @param userId operator
+ */
+ public NamespaceCreatedEvent(final NamespaceDO source, final String userId) {
+ super(source, null, EventTypeEnum.NAMESPACE_CREATE, null, userId);
+ }
+
+
+ @Override
+ public String eventName() {
+ return "namespace";
Review Comment:
not use magic value
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #5746:
URL: https://github.com/apache/shenyu/pull/5746#discussion_r1829234921
##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/event/namespace/NamespaceCreatedEvent.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.model.event.namespace;
+
+import org.apache.shenyu.admin.model.entity.NamespaceDO;
+import org.apache.shenyu.admin.model.enums.EventTypeEnum;
+import org.apache.shenyu.admin.model.event.AdminDataModelChangedEvent;
+
+/**
+ * NamespaceCreatedEvent.
+ */
+public class NamespaceCreatedEvent extends AdminDataModelChangedEvent {
+
+ /**
+ * Create a new {@code NamespaceCreatedEvent}.operator is unknown.
+ *
+ * @param source Current namespace state
+ * @param userId operator
+ */
+ public NamespaceCreatedEvent(final NamespaceDO source, final String userId) {
+ super(source, null, EventTypeEnum.NAMESPACE_CREATE, null, userId);
+ }
+
+
+ @Override
+ public String eventName() {
+ return "namespace";
Review Comment:
ok, i will do that
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind merged PR #5746:
URL: https://github.com/apache/shenyu/pull/5746
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #5746:
URL: https://github.com/apache/shenyu/pull/5746#discussion_r1828624650
##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/event/namespace/NamespaceCreatedEvent.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.admin.model.event.namespace;
+
+import org.apache.shenyu.admin.model.entity.NamespaceDO;
+import org.apache.shenyu.admin.model.enums.EventTypeEnum;
+import org.apache.shenyu.admin.model.event.AdminDataModelChangedEvent;
+
+/**
+ * NamespaceCreatedEvent.
+ */
+public class NamespaceCreatedEvent extends AdminDataModelChangedEvent {
+
+ /**
+ * Create a new {@code NamespaceCreatedEvent}.operator is unknown.
+ *
+ * @param source Current namespace state
+ * @param userId operator
+ */
+ public NamespaceCreatedEvent(final NamespaceDO source, final String userId) {
+ super(source, null, EventTypeEnum.NAMESPACE_CREATE, null, userId);
+ }
+
+
+ @Override
+ public String eventName() {
+ return "namespace";
Review Comment:
but all event class like this:
<img width="585" alt="image" src="https://github.com/user-attachments/assets/10cd3609-b9b8-429f-8406-77ebf3c69e3a">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind commented on code in PR #5746:
URL: https://github.com/apache/shenyu/pull/5746#discussion_r1829232709
##########
db/init/oracle/schema.sql:
##########
@@ -2997,4 +2997,27 @@ comment on column SCALE_HISTORY.msg
comment on column SCALE_HISTORY.date_created
is 'create time';
comment on column SCALE_HISTORY.date_updated
- is 'update time';
\ No newline at end of file
+ is 'update time';
+
+
+create table namespace_user_rel
+(
+ id varchar(128) not null,
+ namespace_id varchar(50) NOT NULL,
+ user_id varchar(128) NOT NULL,
+ date_created timestamp(3) default SYSDATE not null,
+ date_updated timestamp(3) default SYSDATE not null,
+ PRIMARY KEY (id)
+);
Review Comment:
you shoud add the script to upgrade script and you should add this to h2 sql
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [type:fix] namespace user rel [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #5746:
URL: https://github.com/apache/shenyu/pull/5746#discussion_r1829235237
##########
db/init/oracle/schema.sql:
##########
@@ -2997,4 +2997,27 @@ comment on column SCALE_HISTORY.msg
comment on column SCALE_HISTORY.date_created
is 'create time';
comment on column SCALE_HISTORY.date_updated
- is 'update time';
\ No newline at end of file
+ is 'update time';
+
+
+create table namespace_user_rel
+(
+ id varchar(128) not null,
+ namespace_id varchar(50) NOT NULL,
+ user_id varchar(128) NOT NULL,
+ date_created timestamp(3) default SYSDATE not null,
+ date_updated timestamp(3) default SYSDATE not null,
+ PRIMARY KEY (id)
+);
Review Comment:
oh, i missed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org