diff --git a/common/time.go b/common/time.go index 4dc02fe..e54bfaa 100644 --- a/common/time.go +++ b/common/time.go @@ -130,6 +130,7 @@ func TsToStrTime(tc int64) string { //return time.Now().Format("2018-07-02 19:14:00") return time.Unix(tc, 0).Format("2006-01-02 15:04:05") } + func TsToStrDateTime(tc int64) string { //return time.Now().Format("2018-07-02 19:14:00") return time.Unix(tc, 0).Format("2006-01-02") @@ -198,3 +199,8 @@ func HMSToTime(h, m, s int) time.Time { func IntToTime(n int) time.Time { return HMSToTime(n/10000, n%10000/100, n%100) } + +func StrTimeToTime(s string) time.Time { + t, _ := time.ParseInLocation("2006-01-02 15:04:05", s, time.Local) + return t +} diff --git a/protocol/webapi/common.pb.go b/protocol/webapi/common.pb.go index 1d878e7..a8e4bfc 100644 --- a/protocol/webapi/common.pb.go +++ b/protocol/webapi/common.pb.go @@ -3681,10 +3681,10 @@ type ShopWeight struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ShopType int32 `protobuf:"varint,1,opt,name=ShopType,proto3" json:"ShopType,omitempty"` - Weight int32 `protobuf:"varint,2,opt,name=Weight,proto3" json:"Weight,omitempty"` - Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` - IsShow int32 `protobuf:"varint,4,opt,name=IsShow,proto3" json:"IsShow,omitempty"` + ShopType int32 `protobuf:"varint,1,opt,name=ShopType,proto3" json:"ShopType,omitempty"` // 商品类型 对应 ExchangeShop.ShopType + Weight int32 `protobuf:"varint,2,opt,name=Weight,proto3" json:"Weight,omitempty"` // 排序,从大到小 + Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` // 分类名称, 多语言 {\"zh\":\"电子\",\"en\":\"electronic engineering\",\"vi\":\"Điện tử\",\"kh\":\"អេឡិចត្រូន\"} + IsShow int32 `protobuf:"varint,4,opt,name=IsShow,proto3" json:"IsShow,omitempty"` // 是否显示 1显示 Location []int32 `protobuf:"varint,5,rep,packed,name=Location,proto3" json:"Location,omitempty"` // 显示位置 } diff --git a/protocol/webapi/common.proto b/protocol/webapi/common.proto index 1e03fd4..c1cb5fb 100644 --- a/protocol/webapi/common.proto +++ b/protocol/webapi/common.proto @@ -419,10 +419,10 @@ message ExchangeShopList{ } message ShopWeight{ - int32 ShopType = 1; - int32 Weight = 2; - string Name = 3; - int32 IsShow = 4; + int32 ShopType = 1; // 商品类型 对应 ExchangeShop.ShopType + int32 Weight = 2; // 排序,从大到小 + string Name = 3; // 分类名称, 多语言 {\"zh\":\"电子\",\"en\":\"electronic engineering\",\"vi\":\"Điện tử\",\"kh\":\"អេឡិចត្រូន\"} + int32 IsShow = 4; // 是否显示 1显示 repeated int32 Location = 5; // 显示位置 }