diff --git a/server/info/internal/handler/routes.go b/server/info/internal/handler/routes.go index 82d01e1c..8ab5d58b 100644 --- a/server/info/internal/handler/routes.go +++ b/server/info/internal/handler/routes.go @@ -2,7 +2,6 @@ package handler import ( - "net/http" "fusenapi/server/info/internal/svc" @@ -11,7 +10,6 @@ import ( ) func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { - server.AddRoutes( []rest.Route{ { diff --git a/server/info/internal/types/types.go b/server/info/internal/types/types.go index c3ca47c3..2b740955 100644 --- a/server/info/internal/types/types.go +++ b/server/info/internal/types/types.go @@ -23,7 +23,7 @@ type AddressNameRequest struct { } type AddressRequest struct { - AddressId int64 `json:"address_id,omitempty"` + AddressId int64 `json:"address_id,optional"` IsDefault int64 `json:"is_default"` //是否默认 AddressName string `json:"address_name"` //收货人 FirstName string `json:"first_name"` //first_name diff --git a/server_api/info.api b/server_api/info.api index dfadc0b2..094b8dba 100644 --- a/server_api/info.api +++ b/server_api/info.api @@ -17,7 +17,7 @@ service info { post /api/info/address/default(AddressIdRequest) returns (response); @handler AddressAddHandler - post /api/info/address/add(AddressNameRequest) returns (response); + post /api/info/address/add(AddressRequest) returns (response); @handler AddressUpdateHandler post /api/info/address/update(AddressObjectRequest) returns (response); @@ -48,7 +48,7 @@ type ( } AddressRequest { - AddressId int64 `json:"address_id,omitempty"` + AddressId int64 `json:"address_id,optional"` IsDefault int64 `json:"is_default"` //是否默认 AddressName string `json:"address_name"` //收货人 FirstName string `json:"first_name"` //first_name