新增一系列接口

This commit is contained in:
yan.y
2024-03-29 00:24:07 +08:00
parent 0884384e91
commit c799107d6c
17 changed files with 511 additions and 315 deletions
+36 -30
View File
@@ -49,10 +49,11 @@ type PetBaseInfo struct {
// ServiceAddr 服务地址
type ServiceAddr struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //ID
Longitude string `json:"longitude"` //经度
Latitude string `json:"latitude"` //纬度
Addr string `gorm:"not null" json:"addr"` //详细地址
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //ID
Longitude string `json:"longitude"` //经度
Latitude string `json:"latitude"` //纬度
Addr string `gorm:"not null" json:"addr"` //详细地址
DistantGapMeters float64 `gorm:"not null" json:"distantGapMeters"` //服务最远距离 单位/米
}
// UserServiceAddr 用户服务地址
@@ -61,8 +62,11 @@ type UserServiceAddr struct {
Uid int64 `gorm:"index;not null" json:"uid"` //用户ID
Name string `gorm:"not null" json:"name"` //名称
Mobile string `gorm:"not null" json:"mobile"` //手机号
Area string `gorm:"not null" json:"area"` //服务区域 精确到区县级
AreaId int64 `gorm:"not null" json:"areaId"` //服务区域ID
Addr string `gorm:"not null" json:"addr"` //详细地址
Longitude string `json:"longitude"` //经度
Latitude string `json:"latitude"` //纬度
Area string `gorm:"-" json:"area"` //服务区域
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not null" json:"-"` //创建时间
}
@@ -76,16 +80,18 @@ type Goods struct {
ParentId int64 `gorm:"not null" json:"parentId"` //商品父ID
BuyMany int `gorm:"not null" json:"buyMany"` //同类型是否可购买多个 0否 1是
GoodsDetail string `gorm:"not null" json:"goodsDetail"` //商品详情 图片URL
GoodsIcon string `json:"goodsIcon"` //iconUrl
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"-"` //创建时间
}
// PetGoods 宠物商品
type PetGoods struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
Assortment int `gorm:"not null" json:"assortment"` //品种 优先用品种查询 如不存在 则用类型及大小查询
Assortment int `gorm:"not null" json:"assortment"` //品种Id 优先用品种查询 如不存在 则用类型及大小查询
PetType int `gorm:"not null" json:"petType"` //类型 1猫 2狗
Size int `gorm:"not null" json:"size"` //大小 1大 2中 3小
GoodsId int64 `gorm:"not null" json:"goodsId"` //商品ID
Sort int `gorm:"not null" json:"sort"` //排序
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"-"` //创建时间
}
@@ -100,36 +106,36 @@ type SystemConfig struct {
// OrderMain 主订单
type OrderMain struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
OrderId string `gorm:"index;unique;not null" json:"orderId"` //主订单号
Uid int64 `gorm:"index;not null" json:"uid"` //用户id
Status int `json:"status"` //主订单状态 1待服务 2服务中 3已完成
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"createTime"` //创建时间
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
OrderId string `gorm:"index;unique;not null" json:"orderId"` //主订单号
Uid int64 `gorm:"index;not null" json:"uid"` //用户id
Status int `json:"status"` //主订单状态 1待服务 2服务中 3已完成
ServiceTime string `json:"serviceTime"` //服务时间
ServiceAddrId int64 `json:"serviceAddrId"` //服务地址信息
ServiceRemark string `json:"serviceRemark"` //服务备注
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"createTime"` //创建时间
}
// OrderSub 子订单
type OrderSub struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
MainOrderId int64 `gorm:"index" json:"mainOrderId"` //订单ID
Status int `gorm:"not null" json:"status"` //订单状态 1待服务 2服务中 3已完成 4已取消
PetId int64 `gorm:"index" json:"petId"` //宠物ID
PayType int `gorm:"not null" json:"payType"` //支付方式 1线下 2线上
Discount int `json:"discount"` //折扣
TotalAmount int32 `gorm:"not null" json:"totalAmount"` //总金额
PayAmount int32 `json:"payAmount"` //实际支付金额
PayTime string `json:"payTime"` //支付时间
ReserveTime string `gorm:"not null" json:"reserveTime"` //预约时间
ServiceTime string `json:"serviceTime"` //服务时间
ServiceAddrId int64 `json:"serviceAddrId"` //服务地址信息
ServiceRemark string `json:"serviceRemark"` //服务备注
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"createTime"` //创建时间
UpdateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"-"` //更新时间
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
OrderId string `gorm:"index" json:"orderId"` //订单ID
MainOrderId string `gorm:"index" json:"mainOrderId"` //订单ID
Status int `gorm:"not null" json:"status"` //子订单状态 1待服务 2服务中 3已完成 4已取消
PetId int64 `gorm:"index" json:"petId"` //宠物ID
PayType int `gorm:"not null" json:"payType"` //支付方式 1线下 2线上
Discount int `json:"discount"` //折扣
TotalAmount int32 `gorm:"not null" json:"totalAmount"` //总金额
PayAmount int32 `json:"payAmount"` //实际支付金额
PayTime time.Time `gorm:"type:timestamp;" json:"payTime"` //支付时间
CreateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"createTime"` //创建时间
UpdateTime time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"-"` //更新时间
}
// OrderDetail 订单明细
type OrderDetail struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
SubOrderId int64 `gorm:"index;not null" json:"subOrderId"` //子订单ID
GoodsId int64 `gorm:"index;not null" json:"goodsId"` //商品ID
Amount int `gorm:"not null" json:"amount"` //价格
Id int64 `gorm:"primaryKey;autoIncrement" json:"id"` //id
SubOrderId string `gorm:"index;not null" json:"subOrderId"` //子订单ID
GoodsId int64 `gorm:"index;not null" json:"goodsId"` //商品ID
Amount int32 `gorm:"not null" json:"amount"` //价格
}