You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/20 08:50:11 UTC

[GitHub] [apisix-dashboard] bzp2010 opened a new pull request #2144: feat: support proto API (entity)

bzp2010 opened a new pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144


   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   As part of the proto API support, this PR adds data entities about proto to the Manager API. And make some improvements to the data layer.
   
   **Related issues**
   
   part of #2099 
   
   **Checklist:**
   
   - [x] Did you explain what problem does this PR solve? Or what new features have been added?
   - [x] Have you added corresponding test cases?
   - [x] Have you modified the corresponding document?
   - [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-934103218


   ping @nic-chen @gxthrj @starsz @tokers 
   
   Any more review comments here?


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713497432



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       It just replaces the original `BaseInfoGetter` and `BaseInfoSetter`. Because they are all operations on the structure pointer, there is no need to implement them twice. Now use a single method to cover all the data structures, making it easier to get `BaseInfo`.
   
   




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r722811146



##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +282,10 @@ type PluginConfig struct {
 	Plugins map[string]interface{} `json:"plugins"`
 	Labels  map[string]string      `json:"labels,omitempty"`
 }
+
+// swagger:model Proto

Review comment:
       I think this can be used to generate API documents and should be retained.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c8f7da9) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f9f4b3613ff5079db736912b8cc7104477dcd4e4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f9f4b36) will **decrease** coverage by `15.15%`.
   > The diff coverage is `25.00%`.
   
   > :exclamation: Current head c8f7da9 differs from pull request most recent head d908a70. Consider uploading reports for the commit d908a70 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #2144       +/-   ##
   ===========================================
   - Coverage   67.46%   52.31%   -15.16%     
   ===========================================
     Files         126       39       -87     
     Lines        3295     2959      -336     
     Branches      802        0      -802     
   ===========================================
   - Hits         2223     1548      -675     
   - Misses       1072     1217      +145     
   - Partials        0      194      +194     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-unit-test | `52.31% <25.00%> (?)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [api/internal/core/entity/interface.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2ludGVyZmFjZS5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.68% <80.00%> (ø)` | |
   | [web/src/components/Plugin/UI/cors.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9jb3JzLnRzeA==) | | |
   | [web/src/pages/Route/components/Step1/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL2luZGV4LnRzeA==) | | |
   | [web/src/components/LabelsfDrawer/LabelsDrawer.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL0xhYmVsc2ZEcmF3ZXIvTGFiZWxzRHJhd2VyLnRzeA==) | | |
   | [web/src/pages/User/Logout.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ291dC50c3g=) | | |
   | ... and [161 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f9f4b36...d908a70](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713547280



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       `entity.BaseInfo` is the implement




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a4ac7a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/29e3084127e701d7a5b28da8cf64711f7a052f4e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (29e3084) will **decrease** coverage by `2.75%`.
   > The diff coverage is `33.33%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2144      +/-   ##
   ==========================================
   - Coverage   69.42%   66.67%   -2.76%     
   ==========================================
     Files         188       61     -127     
     Lines        7147     3814    -3333     
     Branches      823        0     -823     
   ==========================================
   - Hits         4962     2543    -2419     
   + Misses       1898      982     -916     
   - Partials      287      289       +2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `48.82% <26.66%> (-0.29%)` | :arrow_down: |
   | backend-unit-test | `52.31% <6.66%> (-0.25%)` | :arrow_down: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `68.18% <ø> (-22.73%)` | :arrow_down: |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `56.00% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `88.54% <33.33%> (+0.64%)` | :arrow_up: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `65.60% <40.00%> (-5.71%)` | :arrow_down: |
   | [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `32.11% <0.00%> (-35.41%)` | :arrow_down: |
   | [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `68.11% <0.00%> (-17.40%)` | :arrow_down: |
   | [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `60.00% <0.00%> (-13.00%)` | :arrow_down: |
   | [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `78.37% <0.00%> (-8.11%)` | :arrow_down: |
   | ... and [132 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [29e3084...7a4ac7a](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r725470216



##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +282,10 @@ type PluginConfig struct {
 	Plugins map[string]interface{} `json:"plugins"`
 	Labels  map[string]string      `json:"labels,omitempty"`
 }
+
+// swagger:model Proto

Review comment:
       we could remove it now, and add it when we really need it.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-925411036


   Hi @bzp2010 it would be better to add test cases


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r715271835



##########
File path: api/internal/core/entity/entity.go
##########
@@ -58,14 +58,6 @@ func (info *BaseInfo) KeyCompat(key string) {
 	}
 }
 
-type BaseInfoSetter interface {
-	GetBaseInfo() *BaseInfo
-}
-
-type BaseInfoGetter interface {
-	GetBaseInfo() *BaseInfo
-}

Review comment:
       ping @nic-chen Any more suggestion here?




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713558737



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       @nic-chen I have removed the implementation of `GetBaseInfo` in the data entity, and now only the implementation of `GetPlugins` is left (for plugins holder, such as Route, Service, Consumer).
   
   




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r716211270



##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +282,10 @@ type PluginConfig struct {
 	Plugins map[string]interface{} `json:"plugins"`
 	Labels  map[string]string      `json:"labels,omitempty"`
 }
+
+// swagger:model Proto

Review comment:
       I think we don't need swagger.
    cc @nic-chen 




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713526590



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       Yes, I can understand.
   But I found some problems with the previous code. Just like this,
   [https://github.com/apache/apisix-dashboard/blob/a3928d8bbcbaec089458db01eb7a380f20fb33ae/api/internal/core/store/store.go#L174-L175](https://github.com/apache/apisix-dashboard/blob/a3928d8bbcbaec089458db01eb7a380f20fb33ae/api/internal/core/store/store.go#L174-L175)
   Although type conversion is performed here, none of the data entities actually implement the getter interface. When executing list query, this will cause panic in the program, so I am very confused.
   
   
   
   




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (17a1d66) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/29e3084127e701d7a5b28da8cf64711f7a052f4e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (29e3084) will **decrease** coverage by `17.11%`.
   > The diff coverage is `6.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #2144       +/-   ##
   ===========================================
   - Coverage   69.42%   52.31%   -17.12%     
   ===========================================
     Files         188       39      -149     
     Lines        7147     2959     -4188     
     Branches      823        0      -823     
   ===========================================
   - Hits         4962     1548     -3414     
   + Misses       1898     1217      -681     
   + Partials      287      194       -93     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.31% <6.66%> (-0.25%)` | :arrow_down: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (-90.91%)` | :arrow_down: |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.31%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <ø> (-56.00%)` | :arrow_down: |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.68% <33.33%> (-8.21%)` | :arrow_down: |
   | [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [175 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [29e3084...17a1d66](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (94d883d) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f9f4b3613ff5079db736912b8cc7104477dcd4e4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f9f4b36) will **decrease** coverage by `15.15%`.
   > The diff coverage is `25.00%`.
   
   > :exclamation: Current head 94d883d differs from pull request most recent head d908a70. Consider uploading reports for the commit d908a70 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #2144       +/-   ##
   ===========================================
   - Coverage   67.46%   52.31%   -15.16%     
   ===========================================
     Files         126       39       -87     
     Lines        3295     2959      -336     
     Branches      802        0      -802     
   ===========================================
   - Hits         2223     1548      -675     
   - Misses       1072     1217      +145     
   - Partials        0      194      +194     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-unit-test | `52.31% <25.00%> (?)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [api/internal/core/entity/interface.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2ludGVyZmFjZS5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.68% <80.00%> (ø)` | |
   | [...Route/components/DebugViews/AuthenticationView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvQXV0aGVudGljYXRpb25WaWV3LnRzeA==) | | |
   | [web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==) | | |
   | [...nents/Upstream/components/ServiceDiscoveryArgs.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvU2VydmljZURpc2NvdmVyeUFyZ3MudHN4) | | |
   | [...eb/src/pages/PluginTemplate/components/Preview.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9jb21wb25lbnRzL1ByZXZpZXcudHN4) | | |
   | ... and [161 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f9f4b36...d908a70](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713558737



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       @nic-chen I have removed the implementation of `GetBaseInfo` in the data entity, and now only the implementation of `GetPlugins` is left.
   
   




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713492736



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       What are the benefits of defining a method `GetBaseInfo` for each struct?




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r714877009



##########
File path: api/internal/core/entity/entity.go
##########
@@ -58,14 +58,6 @@ func (info *BaseInfo) KeyCompat(key string) {
 	}
 }
 
-type BaseInfoSetter interface {
-	GetBaseInfo() *BaseInfo
-}
-
-type BaseInfoGetter interface {
-	GetBaseInfo() *BaseInfo
-}

Review comment:
       `BaseInfoGetter` and `BaseInfoSetter` are currently replaced by `GetBaseInfo` interface (define in `interface.go`). Their interface definitions are exactly the same. And, the lines of codes is reduced.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c49bc20) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f9f4b3613ff5079db736912b8cc7104477dcd4e4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f9f4b36) will **decrease** coverage by `15.51%`.
   > The diff coverage is `15.09%`.
   
   > :exclamation: Current head c49bc20 differs from pull request most recent head 3978519. Consider uploading reports for the commit 3978519 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #2144       +/-   ##
   ===========================================
   - Coverage   67.46%   51.94%   -15.52%     
   ===========================================
     Files         126       39       -87     
     Lines        3295     2980      -315     
     Branches      802        0      -802     
   ===========================================
   - Hits         2223     1548      -675     
   - Misses       1072     1238      +166     
   - Partials        0      194      +194     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-unit-test | `51.94% <15.09%> (?)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [api/internal/core/entity/interface.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2ludGVyZmFjZS5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.68% <80.00%> (ø)` | |
   | [web/src/pages/User/Login.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ2luLnRzeA==) | | |
   | [web/src/components/Plugin/UI/proxy-mirror.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9wcm94eS1taXJyb3IudHN4) | | |
   | [...pages/Route/components/Step1/RequestConfigView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1JlcXVlc3RDb25maWdWaWV3LnRzeA==) | | |
   | [...mponents/Upstream/components/active-check/Type.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1R5cGUudHN4) | | |
   | ... and [161 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f9f4b36...3978519](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713526590



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       Yes, I can understand.
   
   But I found some problems with the previous code. Just like this, [https://github.com/apache/apisix-dashboard/blob/a3928d8bbcbaec089458db01eb7a380f20fb33ae/api/internal/core/store/store.go#L174-L175](https://github.com/apache/apisix-dashboard/blob/a3928d8bbcbaec089458db01eb7a380f20fb33ae/api/internal/core/store/store.go#L174-L175)Although type conversion is performed here, none of the data entities actually implement the getter interface. When executing list query, this will cause panic in the program, so I am very confused.
   
   
   
   




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713549278



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       Oh, I get it. I will modify it this way.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan merged pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144


   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r714403464



##########
File path: api/internal/core/entity/entity.go
##########
@@ -58,14 +58,6 @@ func (info *BaseInfo) KeyCompat(key string) {
 	}
 }
 
-type BaseInfoSetter interface {
-	GetBaseInfo() *BaseInfo
-}
-
-type BaseInfoGetter interface {
-	GetBaseInfo() *BaseInfo
-}

Review comment:
       oh, please keep them, their responsibilities are different.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r714877009



##########
File path: api/internal/core/entity/entity.go
##########
@@ -58,14 +58,6 @@ func (info *BaseInfo) KeyCompat(key string) {
 	}
 }
 
-type BaseInfoSetter interface {
-	GetBaseInfo() *BaseInfo
-}
-
-type BaseInfoGetter interface {
-	GetBaseInfo() *BaseInfo
-}

Review comment:
       `BaseInfoGetter` and `BaseInfoSetter` are currently replaced by `GetBaseInfo` interface. Their interface definitions are exactly the same. And, the lines of codes is reduced.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r714877009



##########
File path: api/internal/core/entity/entity.go
##########
@@ -58,14 +58,6 @@ func (info *BaseInfo) KeyCompat(key string) {
 	}
 }
 
-type BaseInfoSetter interface {
-	GetBaseInfo() *BaseInfo
-}
-
-type BaseInfoGetter interface {
-	GetBaseInfo() *BaseInfo
-}

Review comment:
       `BaseInfoGetter` and `BaseInfoSetter` are currently replaced by `GetBaseInfo` interface (define in `interface.go`). Their interface definitions are exactly the same. And, the lines of codes is reduced.
   
   [https://github.com/apache/apisix-dashboard/blob/d908a70f0b81dbe65183346c16bbeb5ca2ceaeb6/api/internal/core/entity/interface.go#L17-L22](https://github.com/apache/apisix-dashboard/blob/d908a70f0b81dbe65183346c16bbeb5ca2ceaeb6/api/internal/core/entity/interface.go#L17-L22)

##########
File path: api/internal/core/entity/entity.go
##########
@@ -58,14 +58,6 @@ func (info *BaseInfo) KeyCompat(key string) {
 	}
 }
 
-type BaseInfoSetter interface {
-	GetBaseInfo() *BaseInfo
-}
-
-type BaseInfoGetter interface {
-	GetBaseInfo() *BaseInfo
-}

Review comment:
       ping @nic-chen 




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a4ac7a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/29e3084127e701d7a5b28da8cf64711f7a052f4e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (29e3084) will **decrease** coverage by `17.11%`.
   > The diff coverage is `6.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #2144       +/-   ##
   ===========================================
   - Coverage   69.42%   52.31%   -17.12%     
   ===========================================
     Files         188       39      -149     
     Lines        7147     2959     -4188     
     Branches      823        0      -823     
   ===========================================
   - Hits         4962     1548     -3414     
   + Misses       1898     1217      -681     
   + Partials      287      194       -93     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.31% <6.66%> (-0.25%)` | :arrow_down: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (-90.91%)` | :arrow_down: |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.31%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <ø> (-56.00%)` | :arrow_down: |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.68% <33.33%> (-8.21%)` | :arrow_down: |
   | [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [177 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [29e3084...7a4ac7a](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#issuecomment-922740461


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2144](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a4ac7a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/29e3084127e701d7a5b28da8cf64711f7a052f4e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (29e3084) will **increase** coverage by `0.97%`.
   > The diff coverage is `33.33%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2144      +/-   ##
   ==========================================
   + Coverage   69.42%   70.39%   +0.97%     
   ==========================================
     Files         188       61     -127     
     Lines        7147     3814    -3333     
     Branches      823        0     -823     
   ==========================================
   - Hits         4962     2685    -2277     
   + Misses       1898      840    -1058     
   - Partials      287      289       +2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `46.72% <26.66%> (+0.27%)` | :arrow_up: |
   | backend-e2e-test-ginkgo | `48.82% <26.66%> (-0.29%)` | :arrow_down: |
   | backend-unit-test | `52.31% <6.66%> (-0.25%)` | :arrow_down: |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `90.90% <ø> (ø)` | |
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `56.00% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `89.58% <33.33%> (+1.68%)` | :arrow_up: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `68.80% <40.00%> (-2.51%)` | :arrow_down: |
   | [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `47.24% <0.00%> (-2.37%)` | :arrow_down: |
   | [...ages/Route/components/Step2/RequestRewriteView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAyL1JlcXVlc3RSZXdyaXRlVmlldy50c3g=) | | |
   | [web/src/pages/SSL/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9TU0wvTGlzdC50c3g=) | | |
   | [...rc/components/Upstream/components/RetryTimeout.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvUmV0cnlUaW1lb3V0LnRzeA==) | | |
   | [web/src/pages/Route/components/Step1/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL2luZGV4LnRzeA==) | | |
   | ... and [124 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2144/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [29e3084...7a4ac7a](https://codecov.io/gh/apache/apisix-dashboard/pull/2144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r725454096



##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +282,10 @@ type PluginConfig struct {
 	Plugins map[string]interface{} `json:"plugins"`
 	Labels  map[string]string      `json:"labels,omitempty"`
 }
+
+// swagger:model Proto

Review comment:
       @starsz Here is a reference to the practices of other data entities. My suggestion is to keep it for the time being and modify it in the PR specifically dealing with swagger.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r724663821



##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +282,10 @@ type PluginConfig struct {
 	Plugins map[string]interface{} `json:"plugins"`
 	Labels  map[string]string      `json:"labels,omitempty"`
 }
+
+// swagger:model Proto

Review comment:
       But now, we don't use swagger to generate API in fact.




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #2144: feat: support proto API (entity)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #2144:
URL: https://github.com/apache/apisix-dashboard/pull/2144#discussion_r713504590



##########
File path: api/internal/core/entity/interface.go
##########
@@ -0,0 +1,85 @@
+/*
+ * 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 entity
+
+type GetPlugins interface {
+	GetPlugins() map[string]interface{}
+}
+
+type GetBaseInfo interface {
+	GetBaseInfo() *BaseInfo
+}
+
+func (r *Route) GetPlugins() map[string]interface{} {
+	return r.Plugins
+}
+
+func (s *Service) GetPlugins() map[string]interface{} {
+	return s.Plugins
+}
+
+func (c *Consumer) GetPlugins() map[string]interface{} {
+	return c.Plugins
+}
+
+func (g *GlobalPlugins) GetPlugins() map[string]interface{} {
+	return g.Plugins
+}
+
+func (p *PluginConfig) GetPlugins() map[string]interface{} {
+	return p.Plugins
+}
+
+func (r *Route) GetBaseInfo() *BaseInfo {
+	return &r.BaseInfo
+}
+
+func (u *Upstream) GetBaseInfo() *BaseInfo {
+	return &u.BaseInfo
+}
+
+func (s *Service) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (c *Consumer) GetBaseInfo() *BaseInfo {
+	return &BaseInfo{
+		ID:         c.Username,
+		CreateTime: c.CreateTime,
+		UpdateTime: c.UpdateTime,
+	}
+}
+
+func (s *SSL) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (g *GlobalPlugins) GetBaseInfo() *BaseInfo {
+	return &g.BaseInfo
+}
+
+func (p *PluginConfig) GetBaseInfo() *BaseInfo {
+	return &p.BaseInfo
+}
+
+func (s *ServerInfo) GetBaseInfo() *BaseInfo {
+	return &s.BaseInfo
+}
+
+func (p *Proto) GetBaseInfo() *BaseInfo {

Review comment:
       I think the risk is greater than the benefit. Because when adding a new struct, may forget to add this method for it, resulting in an error when processing the request.
   




-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org