fix
add contract name to supplier return results
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "description": "创建时间", |
| | | "type": "string" |
| | | }, |
| | | "fileContent": { |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | | } |
| | | }, |
| | | "fileName": { |
| | | "type": "string" |
| | | }, |
| | | "fileType": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | |
| | | "contact": { |
| | | "type": "string" |
| | | }, |
| | | "contract": { |
| | | "$ref": "#/definitions/test.Contract" |
| | | }, |
| | | "created_at": { |
| | | "description": "创建时间", |
| | | "type": "string" |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "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" |
| | | }, |
| | | { |
| | |
| | | "description": "创建时间", |
| | | "type": "string" |
| | | }, |
| | | "fileContent": { |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | | } |
| | | }, |
| | | "fileName": { |
| | | "type": "string" |
| | | }, |
| | | "fileType": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | |
| | | "contact": { |
| | | "type": "string" |
| | | }, |
| | | "contract": { |
| | | "$ref": "#/definitions/test.Contract" |
| | | }, |
| | | "created_at": { |
| | | "description": "创建时间", |
| | | "type": "string" |
| | |
| | | created_at: |
| | | description: 创建时间 |
| | | type: string |
| | | fileContent: |
| | | items: |
| | | type: integer |
| | | type: array |
| | | fileName: |
| | | type: string |
| | | fileType: |
| | | type: string |
| | | id: |
| | | description: 主键ID |
| | |
| | | type: string |
| | | contact: |
| | | type: string |
| | | contract: |
| | | $ref: '#/definitions/test.Contract' |
| | | created_at: |
| | | description: 创建时间 |
| | | type: string |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | - 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 |
| | |
| | | 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 |
| | |
| | | global.GVA_MODEL |
| | | SupplierID *int `json:"supplierID" form:"supplierID" gorm:"column:supplier_id;comment:供应商id;"` |
| | | 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 表名 |
| | |
| | | // 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 表名 |
| | |
| | | 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 |
| | | } |
| | | |