This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch refactor-with-go
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git


The following commit(s) were added to refs/heads/refactor-with-go by this push:
     new e9e363c1 feat: add yaml tags for model (#1056)
e9e363c1 is described below

commit e9e363c10253784ac022d431ace8f623fe6a4e6d
Author: Yixiang Zhao <[email protected]>
AuthorDate: Fri Mar 24 21:09:37 2023 +0800

    feat: add yaml tags for model (#1056)
---
 pkg/admin/model/base.go            | 10 +++++-----
 pkg/admin/model/condition_route.go | 26 +++++++++++++-------------
 pkg/admin/model/tag_route.go       | 30 +++++++++++++++---------------
 3 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/pkg/admin/model/base.go b/pkg/admin/model/base.go
index 8673b119..0510f083 100644
--- a/pkg/admin/model/base.go
+++ b/pkg/admin/model/base.go
@@ -16,9 +16,9 @@
 package model
 
 type Base struct {
-       Application    string `json:"application"`
-       Service        string `json:"service"`
-       ID             string `json:"id"`
-       ServiceVersion string `json:"serviceVersion"`
-       ServiceGroup   string `json:"serviceGroup"`
+       Application    string `json:"application" yaml:"application"`
+       Service        string `json:"service" yaml:"service"`
+       ID             string `json:"id" yaml:"id"`
+       ServiceVersion string `json:"serviceVersion" yaml:"serviceVersion"`
+       ServiceGroup   string `json:"serviceGroup" yaml:"serviceGroup"`
 }
diff --git a/pkg/admin/model/condition_route.go 
b/pkg/admin/model/condition_route.go
index d4728a08..51edd12b 100644
--- a/pkg/admin/model/condition_route.go
+++ b/pkg/admin/model/condition_route.go
@@ -20,21 +20,21 @@ package model
 type ConditionRouteDto struct {
        Base
 
-       Conditions []string `json:"conditions" binding:"required"`
+       Conditions []string `json:"conditions" yaml:"conditions" 
binding:"required"`
 
-       Priority      int    `json:"priority"`
-       Enabled       bool   `json:"enabled" binding:"required"`
-       Force         bool   `json:"force"`
-       Runtime       bool   `json:"runtime"`
-       ConfigVersion string `json:"configVersion" binding:"required"`
+       Priority      int    `json:"priority" yaml:"priority"`
+       Enabled       bool   `json:"enabled" yaml:"enabled" binding:"required"`
+       Force         bool   `json:"force" yaml:"force"`
+       Runtime       bool   `json:"runtime" yaml:"runtime"`
+       ConfigVersion string `json:"configVersion" yaml:"configVersion" 
binding:"required"`
 }
 
 type ConditionRoute struct {
-       Priority   int      `json:"priority"`
-       Enabled    bool     `json:"enabled"`
-       Force      bool     `json:"force"`
-       Runtime    bool     `json:"runtime"`
-       Key        string   `json:"key"`
-       Scope      string   `json:"scope"`
-       Conditions []string `json:"conditions"`
+       Priority   int      `json:"priority" yaml:"priority"`
+       Enabled    bool     `json:"enabled" yaml:"enabled"`
+       Force      bool     `json:"force" yaml:"force"`
+       Runtime    bool     `json:"runtime" yaml:"runtime"`
+       Key        string   `json:"key" yaml:"key"`
+       Scope      string   `json:"scope" yaml:"scope"`
+       Conditions []string `json:"conditions" yaml:"conditions"`
 }
diff --git a/pkg/admin/model/tag_route.go b/pkg/admin/model/tag_route.go
index 69df9c0e..d40a7fd1 100644
--- a/pkg/admin/model/tag_route.go
+++ b/pkg/admin/model/tag_route.go
@@ -20,26 +20,26 @@ package model
 type TagRouteDto struct {
        Base
 
-       Tags []Tag `json:"tags" binding:"required"`
+       Tags []Tag `json:"tags" yaml:"tags" binding:"required"`
 
-       Priority      int    `json:"priority"`
-       Enabled       bool   `json:"enabled" binding:"required"`
-       Force         bool   `json:"force"`
-       Runtime       bool   `json:"runtime"`
-       ConfigVersion string `json:"configVersion" binding:"required"`
+       Priority      int    `json:"priority" yaml:"priority"`
+       Enabled       bool   `json:"enabled" yaml:"enabled" binding:"required"`
+       Force         bool   `json:"force" yaml:"force"`
+       Runtime       bool   `json:"runtime" yaml:"runtime"`
+       ConfigVersion string `json:"configVersion" yaml:"configVersion" 
binding:"required"`
 }
 
 type TagRoute struct {
-       Priority int    `json:"priority"`
-       Enabled  bool   `json:"enabled"`
-       Force    bool   `json:"force"`
-       Runtime  bool   `json:"runtime"`
-       Key      string `json:"key"`
-       Tags     []Tag  `json:"tags"`
+       Priority int    `json:"priority" yaml:"priority"`
+       Enabled  bool   `json:"enabled" yaml:"enabled"`
+       Force    bool   `json:"force" yaml:"force"`
+       Runtime  bool   `json:"runtime" yaml:"runtime"`
+       Key      string `json:"key" yaml:"key"`
+       Tags     []Tag  `json:"tags" yaml:"tags"`
 }
 
 type Tag struct {
-       Name      string       `json:"name" binding:"required"`
-       Match     []ParamMatch `json:"match" binding:"required"`
-       Addresses []string     `json:"addresses"`
+       Name      string       `json:"name" yaml:"name" binding:"required"`
+       Match     []ParamMatch `json:"match" yaml:"match" binding:"required"`
+       Addresses []string     `json:"addresses" yaml:"addresses"`
 }

Reply via email to