Browse Source

feat:json 修改为 header

xuzhiheng 3 years ago
parent
commit
19c4fdddf4
3 changed files with 8 additions and 8 deletions
  1. 2 2
      api/internal/handler/routes.go
  2. 3 3
      api/internal/types/types.go
  3. 3 3
      api/userCenter.api

+ 2 - 2
api/internal/handler/routes.go

@@ -9,8 +9,8 @@ import (
 	"github.com/zeromicro/go-zero/rest"
 )
 
-func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
-	server.AddRoutes(
+func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
+	engine.AddRoutes(
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,

+ 3 - 3
api/internal/types/types.go

@@ -22,7 +22,7 @@ type ExamineReq struct {
 }
 
 type CheckEntReq struct {
-	EntId int64 `json:"entId"` //企业id
+	EntId int64 `header:"entId"` //企业id
 }
 
 type AuthEntReq struct {
@@ -36,7 +36,7 @@ type AuthEntReq struct {
 	AuthName         string `json:"authName"`         //联系人姓名
 	AuthPhone        string `json:"authPhone"`        //联系人手机号
 	Phone            string `json:"phone"`            //注册手机号
-	EntId            int64  `json:"entId,optional"`
+	EntId            int64  `header:"entId,optional"`
 }
 
 type EntListReq struct {
@@ -172,7 +172,7 @@ type UpdateEntReq struct {
 
 type GetStatusByCodeReq struct {
 	Code  string `json:"code"`
-	Phone string `json:"phone"`
+	Phone string `header:"phone"`
 }
 
 type GetStatusByCodeResp struct {

+ 3 - 3
api/userCenter.api

@@ -24,7 +24,7 @@ type (
 
 	//查看企业状态入参
 	checkEntReq {
-		EntId int64 `json:"entId"` //企业id
+		EntId int64 `header:"entId"` //企业id
 	}
 
 	//认证企业 入参
@@ -39,7 +39,7 @@ type (
 		AuthName         string `json:"authName"`         //联系人姓名
 		AuthPhone        string `json:"authPhone"`        //联系人手机号
 		Phone            string `json:"phone"`            //注册手机号
-		EntId            int64  `json:"entId,optional"`
+		EntId            int64  `header:"entId,optional"`
 	}
 
 	//企业列表
@@ -184,7 +184,7 @@ type (
 	//根据统一社会信用代码查看企业状态入参
 	GetStatusByCodeReq {
 		Code  string `json:"code"`
-		Phone string `json:"phone"`
+		Phone string `header:"phone"`
 	}
 
 	//根据统一社会信用代码查看企业状态出参