From d2be142f7b42b20b3125d9ffb398e5b295155327 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期二, 29 八月 2023 11:32:16 +0800
Subject: [PATCH] fix

---
 service/test/supplier.go |    2 
 docs/swagger.yaml        |   44 ----------
 model/test/supplier.go   |   31 ++++---
 docs/docs.go             |   68 ----------------
 docs/swagger.json        |   68 ----------------
 model/test/contract.go   |    4 
 6 files changed, 27 insertions(+), 190 deletions(-)

diff --git a/docs/docs.go b/docs/docs.go
index 5433565..064a083 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -1924,22 +1924,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -1989,22 +1975,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -2059,22 +2031,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -2147,22 +2105,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -9720,16 +9664,7 @@
                     "description": "鍒涘缓鏃堕棿",
                     "type": "string"
                 },
-                "fileContent": {
-                    "type": "array",
-                    "items": {
-                        "type": "integer"
-                    }
-                },
                 "fileName": {
-                    "type": "string"
-                },
-                "fileType": {
                     "type": "string"
                 },
                 "id": {
@@ -9849,6 +9784,9 @@
                 "contact": {
                     "type": "string"
                 },
+                "contract": {
+                    "$ref": "#/definitions/test.Contract"
+                },
                 "created_at": {
                     "description": "鍒涘缓鏃堕棿",
                     "type": "string"
diff --git a/docs/swagger.json b/docs/swagger.json
index 03b7140..cdd6ea3 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -1915,22 +1915,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -1980,22 +1966,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -2050,22 +2022,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -2138,22 +2096,8 @@
                         "in": "query"
                     },
                     {
-                        "type": "array",
-                        "items": {
-                            "type": "integer"
-                        },
-                        "collectionFormat": "csv",
-                        "name": "fileContent",
-                        "in": "query"
-                    },
-                    {
                         "type": "string",
                         "name": "fileName",
-                        "in": "query"
-                    },
-                    {
-                        "type": "string",
-                        "name": "fileType",
                         "in": "query"
                     },
                     {
@@ -9711,16 +9655,7 @@
                     "description": "鍒涘缓鏃堕棿",
                     "type": "string"
                 },
-                "fileContent": {
-                    "type": "array",
-                    "items": {
-                        "type": "integer"
-                    }
-                },
                 "fileName": {
-                    "type": "string"
-                },
-                "fileType": {
                     "type": "string"
                 },
                 "id": {
@@ -9840,6 +9775,9 @@
                 "contact": {
                     "type": "string"
                 },
+                "contract": {
+                    "$ref": "#/definitions/test.Contract"
+                },
                 "created_at": {
                     "description": "鍒涘缓鏃堕棿",
                     "type": "string"
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index f2e40d0..e4d4b7f 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1628,13 +1628,7 @@
       created_at:
         description: 鍒涘缓鏃堕棿
         type: string
-      fileContent:
-        items:
-          type: integer
-        type: array
       fileName:
-        type: string
-      fileType:
         type: string
       id:
         description: 涓婚敭ID
@@ -1715,6 +1709,8 @@
         type: string
       contact:
         type: string
+      contract:
+        $ref: '#/definitions/test.Contract'
       created_at:
         description: 鍒涘缓鏃堕棿
         type: string
@@ -2839,17 +2835,8 @@
         in: query
         name: created_at
         type: string
-      - collectionFormat: csv
-        in: query
-        items:
-          type: integer
-        name: fileContent
-        type: array
       - in: query
         name: fileName
-        type: string
-      - in: query
-        name: fileType
         type: string
       - description: 涓婚敭ID
         in: query
@@ -2879,17 +2866,8 @@
         in: query
         name: created_at
         type: string
-      - collectionFormat: csv
-        in: query
-        items:
-          type: integer
-        name: fileContent
-        type: array
       - in: query
         name: fileName
-        type: string
-      - in: query
-        name: fileType
         type: string
       - description: 涓婚敭ID
         in: query
@@ -2922,17 +2900,8 @@
       - in: query
         name: endCreatedAt
         type: string
-      - collectionFormat: csv
-        in: query
-        items:
-          type: integer
-        name: fileContent
-        type: array
       - in: query
         name: fileName
-        type: string
-      - in: query
-        name: fileType
         type: string
       - description: 涓婚敭ID
         in: query
@@ -2977,17 +2946,8 @@
         in: query
         name: created_at
         type: string
-      - collectionFormat: csv
-        in: query
-        items:
-          type: integer
-        name: fileContent
-        type: array
       - in: query
         name: fileName
-        type: string
-      - in: query
-        name: fileType
         type: string
       - description: 涓婚敭ID
         in: query
diff --git a/model/test/contract.go b/model/test/contract.go
index 80f22a7..87d5ad4 100644
--- a/model/test/contract.go
+++ b/model/test/contract.go
@@ -10,8 +10,8 @@
 	global.GVA_MODEL
 	SupplierID  *int   `json:"supplierID" form:"supplierID" gorm:"column:supplier_id;comment:渚涘簲鍟唅d;"`
 	FileName    string `json:"fileName" form:"fileName" gorm:"column:file_name;comment:鏂囦欢鍚嶇О;size:255;"`
-	FileContent []byte `json:"fileContent" form:"fileContent" gorm:"type:mediumblob;column:file_content;comment:鏂囦欢鍐呭;"`
-	FileType    string `json:"fileType" form:"fileType" gorm:"column:file_type;comment:鏂囦欢绫诲瀷;size:255;"`
+	FileContent []byte `json:"-" form:"fileContent" gorm:"type:mediumblob;column:file_content;comment:鏂囦欢鍐呭;"`
+	FileType    string `json:"-" form:"fileType" gorm:"column:file_type;comment:鏂囦欢绫诲瀷;size:255;"`
 }
 
 // TableName Contract 琛ㄥ悕
diff --git a/model/test/supplier.go b/model/test/supplier.go
index 40a56f5..394bab4 100644
--- a/model/test/supplier.go
+++ b/model/test/supplier.go
@@ -8,21 +8,22 @@
 // Supplier 缁撴瀯浣�
 type Supplier struct {
 	global.GVA_MODEL
-	Number                string `json:"number" form:"number" gorm:"column:number;comment:渚涘簲鍟嗙紪鍙�;size:255;"`
-	Name                  string `json:"name" form:"name" gorm:"column:name;comment:鍚嶇О;size:255;"`
-	SupplierType          string `json:"supplierType" form:"supplierType" gorm:"column:supplier_type;comment:渚涘簲鍟嗙被鍨�;size:255;"`
-	Industry              string `json:"industry" form:"industry" gorm:"column:industry;comment:鎵�灞炶涓�;size:255;"`
-	Contact               string `json:"contact" form:"contact" gorm:"column:contact;comment:鑱旂郴浜�;size:255;"`
-	Phone                 string `json:"phone" form:"phone" gorm:"column:phone;comment:鐢佃瘽;size:255;"`
-	ResponsiblePersonName string `json:"responsiblePersonName" form:"responsiblePersonName" gorm:"column:responsible_person_name;comment:璐熻矗浜�;size:255;"`
-	Email                 string `json:"email" form:"email" gorm:"column:email;comment:閭;size:255;"`
-	DetailAddress         string `json:"detailAddress" form:"detailAddress" gorm:"column:detail_address;comment:璇︾粏鍦板潃;type:text;"`
-	Url                   string `json:"url" form:"url" gorm:"column:url;comment:缃戝潃;size:255;"`
-	AccountName           string `json:"accountName" form:"accountName" gorm:"column:account_name;comment:鎴峰悕;size:255;"`
-	Account               string `json:"account" form:"account" gorm:"column:account;comment:璐﹀彿;size:255;"`
-	Bank                  string `json:"bank" form:"bank" gorm:"column:bank;comment:寮�鎴疯;size:255;"`
-	FileId                *int   `json:"fileId" form:"fileId" gorm:"column:file_id;comment:闄勪欢id;size:11;"`
-	Status                int    `json:"status" form:"status" gorm:"column:status;comment:鐘舵��;size:11;"`
+	Number                string   `json:"number" form:"number" gorm:"column:number;comment:渚涘簲鍟嗙紪鍙�;size:255;"`
+	Name                  string   `json:"name" form:"name" gorm:"column:name;comment:鍚嶇О;size:255;"`
+	SupplierType          string   `json:"supplierType" form:"supplierType" gorm:"column:supplier_type;comment:渚涘簲鍟嗙被鍨�;size:255;"`
+	Industry              string   `json:"industry" form:"industry" gorm:"column:industry;comment:鎵�灞炶涓�;size:255;"`
+	Contact               string   `json:"contact" form:"contact" gorm:"column:contact;comment:鑱旂郴浜�;size:255;"`
+	Phone                 string   `json:"phone" form:"phone" gorm:"column:phone;comment:鐢佃瘽;size:255;"`
+	ResponsiblePersonName string   `json:"responsiblePersonName" form:"responsiblePersonName" gorm:"column:responsible_person_name;comment:璐熻矗浜�;size:255;"`
+	Email                 string   `json:"email" form:"email" gorm:"column:email;comment:閭;size:255;"`
+	DetailAddress         string   `json:"detailAddress" form:"detailAddress" gorm:"column:detail_address;comment:璇︾粏鍦板潃;type:text;"`
+	Url                   string   `json:"url" form:"url" gorm:"column:url;comment:缃戝潃;size:255;"`
+	AccountName           string   `json:"accountName" form:"accountName" gorm:"column:account_name;comment:鎴峰悕;size:255;"`
+	Account               string   `json:"account" form:"account" gorm:"column:account;comment:璐﹀彿;size:255;"`
+	Bank                  string   `json:"bank" form:"bank" gorm:"column:bank;comment:寮�鎴疯;size:255;"`
+	FileId                *int     `json:"fileId" form:"fileId" gorm:"column:file_id;comment:闄勪欢id;size:11;"`
+	Contract              Contract `json:"contract" form:"contract" gorm:"foreignKey:FileId;comment:鍚堝悓;"`
+	Status                int      `json:"status" form:"status" gorm:"column:status;comment:鐘舵��;size:11;"`
 }
 
 // TableName Supplier 琛ㄥ悕
diff --git a/service/test/supplier.go b/service/test/supplier.go
index 8ac496d..b160aa6 100644
--- a/service/test/supplier.go
+++ b/service/test/supplier.go
@@ -65,7 +65,7 @@
 		return
 	}
 
-	err = db.Limit(limit).Offset(offset).Find(&ss).Error
+	err = db.Limit(limit).Offset(offset).Preload("Contract").Find(&ss).Error
 	return ss, total, err
 }
 

--
Gitblit v1.8.0