Skip to content

Commit

Permalink
fix: use a same type for status
Browse files Browse the repository at this point in the history
  • Loading branch information
johzchen committed Dec 21, 2020
1 parent ad64bf5 commit 9458387
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions api/filter/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/apisix/manager-api/internal/core/entity"
"github.com/apisix/manager-api/internal/core/store"
"github.com/apisix/manager-api/internal/utils/consts"
"github.com/apisix/manager-api/log"
Expand All @@ -43,10 +44,8 @@ var resources = map[string]string{
"ssl": "ssl",
}

type Status uint8

const (
StatusDisable Status = iota
StatusDisable entity.Status = iota
StatusEnable
)

Expand Down
4 changes: 3 additions & 1 deletion api/internal/core/entity/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type BaseInfoGetter interface {
GetBaseInfo() *BaseInfo
}

type Status uint8

// swagger:model Route
type Route struct {
BaseInfo
Expand All @@ -83,7 +85,7 @@ type Route struct {
ServiceProtocol string `json:"service_protocol,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
EnableWebsocket bool `json:"enable_websocket,omitempty"`
Status uint8 `json:"status"`
Status Status `json:"status"`
}

// --- structures for upstream start ---
Expand Down

0 comments on commit 9458387

Please sign in to comment.