소스 검색

更新project_list的swagger

yuliang1112 3 년 전
부모
커밋
ebaef630be
10개의 변경된 파일423개의 추가작업 그리고 13개의 파일을 삭제
  1. 1 1
      db/project.go
  2. 139 0
      docs/docs.go
  3. 139 0
      docs/swagger.json
  4. 93 0
      docs/swagger.yaml
  5. 6 6
      go.mod
  6. 14 2
      go.sum
  7. 18 0
      handler/project_list.go
  8. 4 4
      pack/full_project_condition.go
  9. 1 0
      route/init.go
  10. 8 0
      util/type.go

+ 1 - 1
db/project.go

@@ -25,7 +25,7 @@ func GetFullProjectList(ctx context.Context, enterpriseID int64, pageSize, pageN
 	// 根据Project条件过滤
 	conditionType := reflect.TypeOf(condition)
 	conditionValue := reflect.ValueOf(condition)
-	for i := 0; i < conditionType.NumField(); i++ {
+	for i := 0; i < conditionValue.NumField(); i++ {
 		field := conditionType.Field(i)
 		tag := field.Tag.Get("condition")
 		value := conditionValue.FieldByName(field.Name)

+ 139 - 0
docs/docs.go

@@ -66,6 +66,56 @@ const docTemplate = `{
                 }
             }
         },
+        "/product/list": {
+            "get": {
+                "description": "展示企业的商品列表",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "summary": "ProjectList 商品列表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "登录TOKEN信息",
+                        "name": "Authorization",
+                        "in": "header",
+                        "required": true
+                    },
+                    {
+                        "description": "创建全部商品请求结构体",
+                        "name": "req",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/http_model.FullProjectListRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "创建全部商品列表相应结构体",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/http_model.CommonResponse"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/http_model.FullProjectListData"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
         "/sendCode": {
             "post": {
                 "description": "发送验证码,每次发送到邮箱",
@@ -189,6 +239,95 @@ const docTemplate = `{
                 }
             }
         },
+        "http_model.FullProjectListData": {
+            "type": "object",
+            "properties": {
+                "full_project_pre_view": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/http_model.FullProjectPreview"
+                    }
+                },
+                "total": {
+                    "type": "string"
+                }
+            }
+        },
+        "http_model.FullProjectListRequest": {
+            "type": "object",
+            "properties": {
+                "page_num": {
+                    "type": "integer"
+                },
+                "page_size": {
+                    "type": "integer"
+                },
+                "project_content_type": {
+                    "description": "内容形式",
+                    "type": "string"
+                },
+                "project_fee_forms": {
+                    "description": "稿费形式",
+                    "type": "string"
+                },
+                "project_form": {
+                    "description": "项目形式",
+                    "type": "string"
+                },
+                "project_platform": {
+                    "description": "项目平台",
+                    "type": "string"
+                },
+                "project_status": {
+                    "description": "项目状态",
+                    "type": "string"
+                },
+                "project_updated": {
+                    "description": "最后操作时间",
+                    "type": "string"
+                }
+            }
+        },
+        "http_model.FullProjectPreview": {
+            "type": "object",
+            "properties": {
+                "project_content_type": {
+                    "description": "内容形式",
+                    "type": "string"
+                },
+                "project_fee_forms": {
+                    "description": "稿费形式",
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    }
+                },
+                "project_form": {
+                    "description": "项目形式",
+                    "type": "string"
+                },
+                "project_id": {
+                    "description": "项目ID",
+                    "type": "string"
+                },
+                "project_name": {
+                    "description": "项目名",
+                    "type": "string"
+                },
+                "project_platform": {
+                    "description": "项目平台",
+                    "type": "string"
+                },
+                "project_status": {
+                    "description": "项目状态",
+                    "type": "string"
+                },
+                "project_updated": {
+                    "description": "最后操作时间",
+                    "type": "string"
+                }
+            }
+        },
         "http_model.SendCodeData": {
             "type": "object"
         },

+ 139 - 0
docs/swagger.json

@@ -54,6 +54,56 @@
                 }
             }
         },
+        "/product/list": {
+            "get": {
+                "description": "展示企业的商品列表",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "summary": "ProjectList 商品列表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "登录TOKEN信息",
+                        "name": "Authorization",
+                        "in": "header",
+                        "required": true
+                    },
+                    {
+                        "description": "创建全部商品请求结构体",
+                        "name": "req",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/http_model.FullProjectListRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "创建全部商品列表相应结构体",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/http_model.CommonResponse"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/http_model.FullProjectListData"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
         "/sendCode": {
             "post": {
                 "description": "发送验证码,每次发送到邮箱",
@@ -177,6 +227,95 @@
                 }
             }
         },
+        "http_model.FullProjectListData": {
+            "type": "object",
+            "properties": {
+                "full_project_pre_view": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/http_model.FullProjectPreview"
+                    }
+                },
+                "total": {
+                    "type": "string"
+                }
+            }
+        },
+        "http_model.FullProjectListRequest": {
+            "type": "object",
+            "properties": {
+                "page_num": {
+                    "type": "integer"
+                },
+                "page_size": {
+                    "type": "integer"
+                },
+                "project_content_type": {
+                    "description": "内容形式",
+                    "type": "string"
+                },
+                "project_fee_forms": {
+                    "description": "稿费形式",
+                    "type": "string"
+                },
+                "project_form": {
+                    "description": "项目形式",
+                    "type": "string"
+                },
+                "project_platform": {
+                    "description": "项目平台",
+                    "type": "string"
+                },
+                "project_status": {
+                    "description": "项目状态",
+                    "type": "string"
+                },
+                "project_updated": {
+                    "description": "最后操作时间",
+                    "type": "string"
+                }
+            }
+        },
+        "http_model.FullProjectPreview": {
+            "type": "object",
+            "properties": {
+                "project_content_type": {
+                    "description": "内容形式",
+                    "type": "string"
+                },
+                "project_fee_forms": {
+                    "description": "稿费形式",
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    }
+                },
+                "project_form": {
+                    "description": "项目形式",
+                    "type": "string"
+                },
+                "project_id": {
+                    "description": "项目ID",
+                    "type": "string"
+                },
+                "project_name": {
+                    "description": "项目名",
+                    "type": "string"
+                },
+                "project_platform": {
+                    "description": "项目平台",
+                    "type": "string"
+                },
+                "project_status": {
+                    "description": "项目状态",
+                    "type": "string"
+                },
+                "project_updated": {
+                    "description": "最后操作时间",
+                    "type": "string"
+                }
+            }
+        },
         "http_model.SendCodeData": {
             "type": "object"
         },

+ 93 - 0
docs/swagger.yaml

@@ -53,6 +53,69 @@ definitions:
         description: 店铺地址,商品类型为线下品牌时需填写
         type: string
     type: object
+  http_model.FullProjectListData:
+    properties:
+      full_project_pre_view:
+        items:
+          $ref: '#/definitions/http_model.FullProjectPreview'
+        type: array
+      total:
+        type: string
+    type: object
+  http_model.FullProjectListRequest:
+    properties:
+      page_num:
+        type: integer
+      page_size:
+        type: integer
+      project_content_type:
+        description: 内容形式
+        type: string
+      project_fee_forms:
+        description: 稿费形式
+        type: string
+      project_form:
+        description: 项目形式
+        type: string
+      project_platform:
+        description: 项目平台
+        type: string
+      project_status:
+        description: 项目状态
+        type: string
+      project_updated:
+        description: 最后操作时间
+        type: string
+    type: object
+  http_model.FullProjectPreview:
+    properties:
+      project_content_type:
+        description: 内容形式
+        type: string
+      project_fee_forms:
+        description: 稿费形式
+        items:
+          type: string
+        type: array
+      project_form:
+        description: 项目形式
+        type: string
+      project_id:
+        description: 项目ID
+        type: string
+      project_name:
+        description: 项目名
+        type: string
+      project_platform:
+        description: 项目平台
+        type: string
+      project_status:
+        description: 项目状态
+        type: string
+      project_updated:
+        description: 最后操作时间
+        type: string
+    type: object
   http_model.SendCodeData:
     type: object
   http_model.SendCodeRequest:
@@ -93,6 +156,36 @@ paths:
                   $ref: '#/definitions/http_model.CreateProductData'
               type: object
       summary: CreateProduct 创建商品
+  /product/list:
+    get:
+      consumes:
+      - application/json
+      description: 展示企业的商品列表
+      parameters:
+      - description: 登录TOKEN信息
+        in: header
+        name: Authorization
+        required: true
+        type: string
+      - description: 创建全部商品请求结构体
+        in: body
+        name: req
+        required: true
+        schema:
+          $ref: '#/definitions/http_model.FullProjectListRequest'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 创建全部商品列表相应结构体
+          schema:
+            allOf:
+            - $ref: '#/definitions/http_model.CommonResponse'
+            - properties:
+                data:
+                  $ref: '#/definitions/http_model.FullProjectListData'
+              type: object
+      summary: ProjectList 商品列表
   /sendCode:
     post:
       consumes:

+ 6 - 6
go.mod

@@ -12,21 +12,21 @@ require (
 	github.com/go-openapi/swag v0.21.1 // indirect
 	github.com/go-playground/validator/v10 v10.10.1 // indirect
 	github.com/go-redis/redis/v8 v8.11.5
-	github.com/golang-collections/lib.go v0.0.0-20141117141324-c7bc093f17da // indirect
-	github.com/issue9/conv v1.2.2 // indirect
+	github.com/issue9/conv v1.2.2
 	github.com/jinzhu/now v1.1.5 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/mailru/easyjson v0.7.7 // indirect
 	github.com/mattn/go-isatty v0.0.14 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/sirupsen/logrus v1.8.1
-	github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect
-	github.com/swaggo/gin-swagger v1.4.1 // indirect
+	github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2
+	github.com/swaggo/gin-swagger v1.4.1
 	github.com/swaggo/swag v1.8.1
 	github.com/ugorji/go v1.2.7 // indirect
+	github.com/urfave/cli/v2 v2.4.0 // indirect
 	golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
-	golang.org/x/net v0.0.0-20220401154927-543a649e0bdd // indirect
-	golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
+	golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 // indirect
+	golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12 // indirect
 	golang.org/x/tools v0.1.10 // indirect
 	google.golang.org/protobuf v1.28.0 // indirect
 	gopkg.in/yaml.v2 v2.4.0

+ 14 - 2
go.sum

@@ -15,6 +15,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
+github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
+github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -24,7 +26,9 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/gin-contrib/gzip v0.0.3 h1:etUaeesHhEORpZMp18zoOhepboiWnFtXrBZxszWUn4k=
 github.com/gin-contrib/gzip v0.0.3/go.mod h1:YxxswVZIqOvcHEQpsSn+QF5guQtO1dCfy0shBPy4jFc=
 github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
 github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
@@ -59,8 +63,6 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
-github.com/golang-collections/lib.go v0.0.0-20141117141324-c7bc093f17da h1:gxDUcLQNN/n69fLYkOnYqW6rsFV8y9gIPfW3YczN47k=
-github.com/golang-collections/lib.go v0.0.0-20141117141324-c7bc093f17da/go.mod h1:lhns5PAQCMYxDxsmukk33l29WZ33ILfd8v0I0yaqRK8=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -86,6 +88,7 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/issue9/assert/v2 v2.0.0 h1:vN7fr70g5ND6zM39tPZk/E4WCyjGMqApmFbujSTmEo0=
 github.com/issue9/assert/v2 v2.0.0/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
 github.com/issue9/conv v1.2.2 h1:DlvooVwcCgHxGxgVNSt4LFGxIVzWbMV8E2dmQlrGHNA=
 github.com/issue9/conv v1.2.2/go.mod h1:uDqE/xgXbZ5UjC2J5+HLIoguE0qOKGzv7EzLzkvoRPE=
@@ -153,6 +156,9 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
 github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
 github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
 github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
@@ -180,6 +186,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY
 github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
 github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
 github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
+github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I=
+github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg=
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -209,6 +217,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220401154927-543a649e0bdd h1:zYlwaUHTmxuf6H7hwO2dgwqozQmH7zf4x+/qql4oVWc=
 golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 h1:EN5+DfgmRMvRUrMGERW2gQl3Vc+Z7ZMnI/xdEpPSf0c=
+golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -236,6 +246,8 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f h1:rlezHXNlxYWvBCzNses9Dlc7nGFaNMJeqLolcmQSSZY=
 golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12 h1:QyVthZKMsyaQwBTJE04jdNN0Pp5Fn9Qga0mrgxyERQM=
+golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

+ 18 - 0
handler/project_list.go

@@ -15,6 +15,18 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
+// WrapFullProjectListHandler
+// @BasePath /youngee/m/
+// SendCode godoc
+// @Summary ProjectList 商品列表
+// @Schemes
+// @Description 展示企业的商品列表
+// @Accept json
+// @Produce json
+// @Param Authorization header string true "登录TOKEN信息"
+// @Param req body http_model.FullProjectListRequest true "创建全部商品请求结构体"
+// @Success 200 {object} http_model.CommonResponse{data=http_model.FullProjectListData} "创建全部商品列表相应结构体"
+// @Router /product/list [get]
 func WrapFullProjectListHandler(ctx *gin.Context) {
 	handler := newFullProjectListHandler(ctx)
 	baseRun(handler)
@@ -56,22 +68,28 @@ func (h *FullProjectListHandler) run() {
 }
 func (h *FullProjectListHandler) checkParam() error {
 	var errs []error
+	logrus.Printf("pagesize:%+v",h.req.PageSize)
 	if h.req.PageNum <= 0 || h.req.PageSize <= 0 {
 		errs = append(errs, errors.New("page param error"))
 	}
+	h.req.ProjectForm = util.IsNull(h.req.ProjectForm)
 	h.req.PageNum++
 	if _, err := conv.Int64(h.req.ProjectForm); err != nil {
 		errs = append(errs, err)
 	}
+	h.req.ProjectStatus = util.IsNull(h.req.ProjectStatus)
 	if _, err := conv.Int64(h.req.ProjectStatus); err != nil {
 		errs = append(errs, err)
 	}
+	h.req.ProjectUpdated = util.IsNull(h.req.ProjectUpdated)
 	if _, err := conv.Int64(h.req.ProjectUpdated); err != nil {
 		errs = append(errs, err)
 	}
+	h.req.ProjectContentType = util.IsNull(h.req.ProjectContentType)
 	if _, err := conv.Int64(h.req.ProjectContentType); err != nil {
 		errs = append(errs, err)
 	}
+	h.req.ProjectPlatform = util.IsNull(h.req.ProjectPlatform)
 	if _, err := conv.Int64(h.req.ProjectPlatform); err != nil {
 		errs = append(errs, err)
 	}

+ 4 - 4
pack/full_project_condition.go

@@ -10,10 +10,10 @@ import (
 func HttpFullProjectRequestToCondition(req *http_model.FullProjectListRequest) *common_model.ProjectCondition {
 	projectUpdated := time.UnixMilli(conv.MustInt64(req.ProjectUpdated))
 	return &common_model.ProjectCondition{
-		ProjectStatus:      conv.MustInt64(req.ProjectStatus),
-		ProjectPlatform:    conv.MustInt64(req.ProjectPlatform),
-		ProjectForm:        conv.MustInt64(req.ProjectForm),
-		ProjectContentType: conv.MustInt64(req.ProjectContentType),
+		ProjectStatus:      conv.MustInt64(req.ProjectStatus,0),
+		ProjectPlatform:    conv.MustInt64(req.ProjectPlatform,0),
+		ProjectForm:        conv.MustInt64(req.ProjectForm,0),
+		ProjectContentType: conv.MustInt64(req.ProjectContentType,0),
 		ProjectUpdated:     projectUpdated.String(),
 	}
 }

+ 1 - 0
route/init.go

@@ -46,6 +46,7 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/product/find", handler.WrapFindProductHandler)
 		m.POST("/project/create", handler.WrapCreateProjectHandler)
 		m.POST("/product/create", handler.WrapCreateProductHandler)
+		m.POST("/product/list", handler.WrapFullProjectListHandler)
 	}
 
 }

+ 8 - 0
util/type.go

@@ -0,0 +1,8 @@
+package util
+
+func IsNull(s string) string {
+	if s == ""{
+		return "0"
+	}
+	return s
+}