未验证 提交 0585ca26 编写于 作者: Z zhatiai 提交者: GitHub

fix the bug that failed to get gin form default value (#2988)

Signed-off-by: Nzhatiai <zhatiai@koderover.com>
Co-authored-by: Nzhatiai <zhatiai@koderover.com>
上级 1e45e0e0
...@@ -2266,8 +2266,8 @@ type ListWorkloadsArgs struct { ...@@ -2266,8 +2266,8 @@ type ListWorkloadsArgs struct {
Namespace string `json:"namespace" form:"namespace"` Namespace string `json:"namespace" form:"namespace"`
ClusterID string `json:"clusterId" form:"clusterId"` ClusterID string `json:"clusterId" form:"clusterId"`
WorkloadName string `json:"workloadName" form:"workloadName"` WorkloadName string `json:"workloadName" form:"workloadName"`
PerPage int `json:"perPage" form:"perPage,default:20"` PerPage int `json:"perPage" form:"perPage,default=20"`
Page int `json:"page" form:"page,default:1"` Page int `json:"page" form:"page,default=1"`
} }
func ListWorkloads(c *gin.Context) { func ListWorkloads(c *gin.Context) {
......
...@@ -79,8 +79,8 @@ type EnvDefinition struct { ...@@ -79,8 +79,8 @@ type EnvDefinition struct {
} }
type OpenAPIListProjectReq struct { type OpenAPIListProjectReq struct {
PageSize int64 `json:"pageSize" form:"pageSize,default:20"` PageSize int64 `json:"pageSize" form:"pageSize,default=20"`
PageNum int64 `json:"pageNum" form:"pageNum,default:1"` PageNum int64 `json:"pageNum" form:"pageNum,default=1"`
} }
type OpenAPIProjectDetailResp struct { type OpenAPIProjectDetailResp struct {
......
...@@ -26,8 +26,8 @@ import ( ...@@ -26,8 +26,8 @@ import (
) )
type GetBuildStatArgs struct { type GetBuildStatArgs struct {
StartDate int64 `json:"startDate" form:"startDate,default:0"` StartDate int64 `json:"startDate" form:"startDate,default=0"`
EndDate int64 `json:"endDate" form:"endDate,default:0"` EndDate int64 `json:"endDate" form:"endDate,default=0"`
} }
func GetBuildStat(c *gin.Context) { func GetBuildStat(c *gin.Context) {
...@@ -47,8 +47,8 @@ func GetBuildStat(c *gin.Context) { ...@@ -47,8 +47,8 @@ func GetBuildStat(c *gin.Context) {
} }
type OpenAPIGetBuildStatArgs struct { type OpenAPIGetBuildStatArgs struct {
StartDate int64 `json:"startDate" form:"startDate,default:0"` StartDate int64 `json:"startDate" form:"startDate,default=0"`
EndDate int64 `json:"endDate" form:"endDate,default:0"` EndDate int64 `json:"endDate" form:"endDate,default=0"`
Project string `json:"project" form:"projectKey"` Project string `json:"project" form:"projectKey"`
} }
......
...@@ -25,8 +25,8 @@ import ( ...@@ -25,8 +25,8 @@ import (
) )
type getStatReq struct { type getStatReq struct {
StartDate int64 `json:"startDate,omitempty" form:"startDate,default:0"` StartDate int64 `json:"startDate,omitempty" form:"startDate,default=0"`
EndDate int64 `json:"endDate,omitempty" form:"endDate,default:0"` EndDate int64 `json:"endDate,omitempty" form:"endDate,default=0"`
ProductNames []string `json:"productNames"` ProductNames []string `json:"productNames"`
} }
......
...@@ -26,8 +26,8 @@ import ( ...@@ -26,8 +26,8 @@ import (
) )
type GetDeployStatArgs struct { type GetDeployStatArgs struct {
StartDate int64 `json:"startDate" form:"startDate,default:0"` StartDate int64 `json:"startDate" form:"startDate,default=0"`
EndDate int64 `json:"endDate" form:"endDate,default:0"` EndDate int64 `json:"endDate" form:"endDate,default=0"`
} }
func GetDeployStat(c *gin.Context) { func GetDeployStat(c *gin.Context) {
...@@ -47,8 +47,8 @@ func GetDeployStat(c *gin.Context) { ...@@ -47,8 +47,8 @@ func GetDeployStat(c *gin.Context) {
} }
type OpenAPIGetDeployStatArgs struct { type OpenAPIGetDeployStatArgs struct {
StartDate int64 `json:"startDate" form:"startDate,default:0"` StartDate int64 `json:"startDate" form:"startDate,default=0"`
EndDate int64 `json:"endDate" form:"endDate,default:0"` EndDate int64 `json:"endDate" form:"endDate,default=0"`
Project string `json:"project" form:"projectKey"` Project string `json:"project" form:"projectKey"`
} }
......
...@@ -49,8 +49,8 @@ type OpenAPITestStatResp struct { ...@@ -49,8 +49,8 @@ type OpenAPITestStatResp struct {
} }
type OpenAPIGetTestStatArgs struct { type OpenAPIGetTestStatArgs struct {
StartDate int64 `json:"startDate,omitempty" form:"startDate,default:0"` StartDate int64 `json:"startDate,omitempty" form:"startDate,default=0"`
EndDate int64 `json:"endDate,omitempty" form:"endDate,default:0"` EndDate int64 `json:"endDate,omitempty" form:"endDate,default=0"`
Project string `json:"project" form:"projectKey"` Project string `json:"project" form:"projectKey"`
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册