029d819f34407022c9cabbd1cc9a7d78b1b428c8..ee6a6653fc5fd35d44686a8f874ec83ecf4b47db
2023-08-26 wangpengfei
fix
ee6a66 对比 | 目录
2023-08-26 wangpengfei
add
2083c6 对比 | 目录
2023-08-26 wangpengfei
fix
2cffaa 对比 | 目录
1个文件已删除
5个文件已修改
143 ■■■■ 已修改文件
docs/docs.go 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log/2023-08-26/info.log 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/test/product.go 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/test/product.go 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go
@@ -3785,6 +3785,16 @@
                    },
                    {
                        "type": "string",
                        "name": "specifications",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "supplierId",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "name": "unit",
                        "in": "query"
                    }
@@ -3893,7 +3903,17 @@
                    },
                    {
                        "type": "string",
                        "name": "specifications",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "name": "startCreatedAt",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "supplierId",
                        "in": "query"
                    },
                    {
@@ -4006,7 +4026,17 @@
                    },
                    {
                        "type": "string",
                        "name": "specifications",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "name": "startCreatedAt",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "supplierId",
                        "in": "query"
                    },
                    {
@@ -8675,6 +8705,15 @@
                "shippingDuration": {
                    "type": "integer"
                },
                "specifications": {
                    "type": "string"
                },
                "supplier": {
                    "$ref": "#/definitions/test.Supplier"
                },
                "supplierId": {
                    "type": "integer"
                },
                "unit": {
                    "type": "string"
                }
docs/swagger.json
@@ -3776,6 +3776,16 @@
                    },
                    {
                        "type": "string",
                        "name": "specifications",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "supplierId",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "name": "unit",
                        "in": "query"
                    }
@@ -3884,7 +3894,17 @@
                    },
                    {
                        "type": "string",
                        "name": "specifications",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "name": "startCreatedAt",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "supplierId",
                        "in": "query"
                    },
                    {
@@ -3997,7 +4017,17 @@
                    },
                    {
                        "type": "string",
                        "name": "specifications",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "name": "startCreatedAt",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "supplierId",
                        "in": "query"
                    },
                    {
@@ -8666,6 +8696,15 @@
                "shippingDuration": {
                    "type": "integer"
                },
                "specifications": {
                    "type": "string"
                },
                "supplier": {
                    "$ref": "#/definitions/test.Supplier"
                },
                "supplierId": {
                    "type": "integer"
                },
                "unit": {
                    "type": "string"
                }
docs/swagger.yaml
@@ -1535,6 +1535,12 @@
        type: string
      shippingDuration:
        type: integer
      specifications:
        type: string
      supplier:
        $ref: '#/definitions/test.Supplier'
      supplierId:
        type: integer
      unit:
        type: string
    type: object
@@ -3749,6 +3755,12 @@
        name: shippingDuration
        type: integer
      - in: query
        name: specifications
        type: string
      - in: query
        name: supplierId
        type: integer
      - in: query
        name: unit
        type: string
      produces:
@@ -3815,8 +3827,14 @@
        name: shippingDuration
        type: integer
      - in: query
        name: specifications
        type: string
      - in: query
        name: startCreatedAt
        type: string
      - in: query
        name: supplierId
        type: integer
      - in: query
        name: unit
        type: string
@@ -3884,9 +3902,15 @@
        name: shippingDuration
        type: integer
      - in: query
        name: specifications
        type: string
      - in: query
        name: startCreatedAt
        type: string
      - in: query
        name: supplierId
        type: integer
      - in: query
        name: unit
        type: string
      produces:
log/2023-08-26/info.log
File was deleted
model/test/product.go
@@ -10,10 +10,12 @@
    Name             string   `json:"name" form:"name" gorm:"column:name;comment:名称;size:255;"`
    Number           string   `json:"number" form:"number" gorm:"column:number;comment:编码;size:255;"`
    SupplierId       uint     `json:"supplierId" form:"supplierId" gorm:"column:supplier_id;comment:供应商id;size:255;"`
    Supplier         Supplier `json:"supplier" form:"supplier" gorm:"foreignKey:SupplierId;references:ID;comment:供应商"`
    Unit             string   `json:"unit" form:"unit" gorm:"column:unit;comment:计量单位;size:255;"`
    PurchasePrice    *float64 `json:"purchasePrice" form:"purchasePrice" gorm:"column:purchase_price;comment:采购价格;"`
    DeliveryTime     *int     `json:"deliveryTime" form:"deliveryTime" gorm:"column:delivery_time;comment:;size:11;"`
    ShippingDuration *int     `json:"shippingDuration" form:"shippingDuration" gorm:"column:shipping_duration;comment:物流时长;size:11;"`
    Specifications   string   `json:"specifications" form:"specifications" gorm:"column:specifications;comment:规格;size:255;"`
    ProductType      string   `json:"productType" form:"productType" gorm:"column:product_type;comment:产品类别;size:255;"`
    MinimumStock     *int     `json:"minimumStock" form:"minimumStock" gorm:"column:minimum_stock;comment:最低库存;"`
    MaximumStock     *int     `json:"maximumStock" form:"maximumStock" gorm:"column:maximum_stock;comment:最高库存;"`
service/test/product.go
@@ -66,11 +66,16 @@
    if info.Unit != "" {
        db = db.Where("unit LIKE ?", "%"+info.Unit+"%")
    }
    if info.SupplierId != 0 {
        db = db.Where("supplier_id = ?", info.SupplierId)
    }
    err = db.Count(&total).Error
    if err != nil {
        return
    }
    err = db.Limit(limit).Offset(offset).Find(&ps).Error
    err = db.Limit(limit).Offset(offset).Preload("Supplier").Find(&ps).Error
    return ps, total, err
}