|
|
|
package model
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type Product struct {
|
|
|
|
//gorm.Model
|
|
|
|
ID int32 `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
ProductType int32 `gorm:"default:1" json:"productType"`
|
|
|
|
CategoryId int32 `json:"categoryId"`
|
|
|
|
StartingPrice float32 `json:"startingPrice"`
|
|
|
|
TotalStock int32 `gorm:"default:1234" json:"totalStock"`
|
|
|
|
MainPicture string `gorm:"default:1" json:"mainPicture"`
|
|
|
|
RemoteAreaPostage float32 `json:"remoteAreaPostage"`
|
|
|
|
SingleBuyLimit int32 `json:"singleBuyLimit"`
|
|
|
|
IsEnable bool `json:"isEnable"`
|
|
|
|
Remark string `gorm:"default:1" json:"remark"`
|
|
|
|
CreateUser int32 `gorm:"default:1" json:"createUser"`
|
|
|
|
CreateTime time.Time `json:"createTime"`
|
|
|
|
UpdateUser int32 `json:"updateUser"`
|
|
|
|
UpdateTime time.Time `json:"updateTime"`
|
|
|
|
IsDeleted bool `json:"isDeleted"`
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
"id": 116,
|
|
|
|
|
|
|
|
"name": "Spring Cloud 微服务快速上手",
|
|
|
|
"categoryId": 31,
|
|
|
|
"pictureList": ["https://msb-edu-prod.oss-cn-beijing.aliyuncs.com/mall-product/product/8c23730b-d86c-43ed-9db2-9efaa1028115.png"],
|
|
|
|
"startingPrice": 97.90,
|
|
|
|
"detail": "<p><img src=\"https://img30.360buyimg.com/vc/jfs/t1/82359/11/20972/3012125/62d5fe69Ea84e2ad5/218e555c7cbd9731.jpg\"></p>></p>",
|
|
|
|
"attributeGroupList": [],
|
|
|
|
"remoteAreaPostage": 10.00,
|
|
|
|
"singleBuyLimit": 0,
|
|
|
|
"isEnable": true,
|
|
|
|
"productActivityVO": {
|
|
|
|
"isActivity": null,
|
|
|
|
"isStartActivity": false,
|
|
|
|
"activityStartTime": null,
|
|
|
|
"activityEndTime": null,
|
|
|
|
"currentTime": null,
|
|
|
|
"activityPrice": null,
|
|
|
|
"activityId": null,
|
|
|
|
"activityTimeId": null
|
|
|
|
},
|
|
|
|
"productType": 1
|
|
|
|
*/
|
|
|
|
type ProductDetail struct {
|
|
|
|
//gorm.Model
|
|
|
|
ID int32 `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
ProductType int32 `gorm:"default:1" json:"productType"`
|
|
|
|
CategoryId int32 `json:"categoryId"`
|
|
|
|
StartingPrice float32 `json:"startingPrice"`
|
|
|
|
TotalStock int32 `gorm:"default:1234" json:"totalStock"`
|
|
|
|
MainPicture string `gorm:"default:1" json:"mainPicture"`
|
|
|
|
RemoteAreaPostage float32 `json:"remoteAreaPostage"`
|
|
|
|
SingleBuyLimit int32 `json:"singleBuyLimit"`
|
|
|
|
IsEnable bool `json:"isEnable"`
|
|
|
|
Remark string `gorm:"default:1" json:"remark"`
|
|
|
|
CreateUser int32 `gorm:"default:1" json:"createUser"`
|
|
|
|
CreateTime time.Time `json:"createTime"`
|
|
|
|
UpdateUser int32 `json:"updateUser"`
|
|
|
|
UpdateTime time.Time `json:"updateTime"`
|
|
|
|
IsDeleted bool `json:"isDeleted"`
|
|
|
|
Detail string `gorm:"detail" json:"detail"` //商品详情页面
|
|
|
|
PictureList string `gorm:"picture_list" json:"pictureList"` //商品详情需要的图片
|
|
|
|
}
|
|
|
|
|
|
|
|
func (table *Product) TableName() string {
|
|
|
|
return "product"
|
|
|
|
}
|