Kaynağa Gözat

直接传参接口,修改返回int64类型为string。前端接收int64类型会丢失精度

jyq 4 yıl önce
ebeveyn
işleme
62ec303f3f

+ 12 - 12
api/grpc/base/base.pb.go

@@ -691,9 +691,9 @@ type ShopInfo struct {
 	Phone       string    `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`
 	Phone       string    `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`
 	Contacts    string    `protobuf:"bytes,6,opt,name=contacts,proto3" json:"contacts,omitempty"`
 	Contacts    string    `protobuf:"bytes,6,opt,name=contacts,proto3" json:"contacts,omitempty"`
 	Status      WebStatus `protobuf:"varint,7,opt,name=status,proto3,enum=base.WebStatus" json:"status,omitempty"`
 	Status      WebStatus `protobuf:"varint,7,opt,name=status,proto3,enum=base.WebStatus" json:"status,omitempty"`
-	CreatedAt   int64     `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
+	CreatedAt   string    `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
 	CreatedUser int64     `protobuf:"varint,9,opt,name=created_user,json=createdUser,proto3" json:"created_user,omitempty"`
 	CreatedUser int64     `protobuf:"varint,9,opt,name=created_user,json=createdUser,proto3" json:"created_user,omitempty"`
-	UpdatedAt   int64     `protobuf:"varint,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
+	UpdatedAt   string    `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
 	UpdatedUser int64     `protobuf:"varint,11,opt,name=updated_user,json=updatedUser,proto3" json:"updated_user,omitempty"`
 	UpdatedUser int64     `protobuf:"varint,11,opt,name=updated_user,json=updatedUser,proto3" json:"updated_user,omitempty"`
 	IsHr        int64     `protobuf:"varint,12,opt,name=is_hr,json=isHr,proto3" json:"is_hr,omitempty"`
 	IsHr        int64     `protobuf:"varint,12,opt,name=is_hr,json=isHr,proto3" json:"is_hr,omitempty"`
 	IsScore     int64     `protobuf:"varint,13,opt,name=is_score,json=isScore,proto3" json:"is_score,omitempty"`
 	IsScore     int64     `protobuf:"varint,13,opt,name=is_score,json=isScore,proto3" json:"is_score,omitempty"`
@@ -781,11 +781,11 @@ func (x *ShopInfo) GetStatus() WebStatus {
 	return WebStatus_Ban
 	return WebStatus_Ban
 }
 }
 
 
-func (x *ShopInfo) GetCreatedAt() int64 {
+func (x *ShopInfo) GetCreatedAt() string {
 	if x != nil {
 	if x != nil {
 		return x.CreatedAt
 		return x.CreatedAt
 	}
 	}
-	return 0
+	return ""
 }
 }
 
 
 func (x *ShopInfo) GetCreatedUser() int64 {
 func (x *ShopInfo) GetCreatedUser() int64 {
@@ -795,11 +795,11 @@ func (x *ShopInfo) GetCreatedUser() int64 {
 	return 0
 	return 0
 }
 }
 
 
-func (x *ShopInfo) GetUpdatedAt() int64 {
+func (x *ShopInfo) GetUpdatedAt() string {
 	if x != nil {
 	if x != nil {
 		return x.UpdatedAt
 		return x.UpdatedAt
 	}
 	}
-	return 0
+	return ""
 }
 }
 
 
 func (x *ShopInfo) GetUpdatedUser() int64 {
 func (x *ShopInfo) GetUpdatedUser() int64 {
@@ -1058,7 +1058,7 @@ type Column struct {
 	Sn      int32     `protobuf:"varint,4,opt,name=sn,proto3" json:"sn,omitempty"`
 	Sn      int32     `protobuf:"varint,4,opt,name=sn,proto3" json:"sn,omitempty"`
 	Status  WebStatus `protobuf:"varint,5,opt,name=status,proto3,enum=base.WebStatus" json:"status,omitempty"`
 	Status  WebStatus `protobuf:"varint,5,opt,name=status,proto3,enum=base.WebStatus" json:"status,omitempty"`
 	NavShow bool      `protobuf:"varint,6,opt,name=navShow,proto3" json:"navShow,omitempty"`
 	NavShow bool      `protobuf:"varint,6,opt,name=navShow,proto3" json:"navShow,omitempty"`
-	Id      int64     `protobuf:"varint,7,opt,name=id,proto3" json:"id,omitempty"`
+	Id      string    `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"`
 }
 }
 
 
 func (x *Column) Reset() {
 func (x *Column) Reset() {
@@ -1135,11 +1135,11 @@ func (x *Column) GetNavShow() bool {
 	return false
 	return false
 }
 }
 
 
-func (x *Column) GetId() int64 {
+func (x *Column) GetId() string {
 	if x != nil {
 	if x != nil {
 		return x.Id
 		return x.Id
 	}
 	}
-	return 0
+	return ""
 }
 }
 
 
 type GetShopNaviReply struct {
 type GetShopNaviReply struct {
@@ -1888,11 +1888,11 @@ var file_base_proto_rawDesc = []byte{
 	0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53,
 	0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53,
 	0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a,
 	0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a,
 	0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
 	0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x21, 0x0a, 0x0c,
+	0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x21, 0x0a, 0x0c,
 	0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01,
 	0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01,
 	0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12,
 	0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12,
 	0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20,
 	0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x21,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x21,
 	0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0b,
 	0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0b,
 	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65,
 	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65,
 	0x72, 0x12, 0x13, 0x0a, 0x05, 0x69, 0x73, 0x5f, 0x68, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03,
 	0x72, 0x12, 0x13, 0x0a, 0x05, 0x69, 0x73, 0x5f, 0x68, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03,
@@ -1926,7 +1926,7 @@ var file_base_proto_rawDesc = []byte{
 	0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75,
 	0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75,
 	0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x61, 0x76,
 	0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x61, 0x76,
 	0x53, 0x68, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6e, 0x61, 0x76, 0x53,
 	0x53, 0x68, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6e, 0x61, 0x76, 0x53,
-	0x68, 0x6f, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x68, 0x6f, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x61,
 	0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x61,
 	0x76, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18,
 	0x76, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18,
 	0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6c,
 	0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6c,

+ 6 - 6
assembly/base/service/shop.go

@@ -45,11 +45,11 @@ func (s Shop) ManageableShopList(token string, r *pb.ShopListRequest) *pb.ShopLi
 			l.Addr = v.Addr
 			l.Addr = v.Addr
 			l.Phone = v.Phone
 			l.Phone = v.Phone
 			l.Contacts = v.Contacts
 			l.Contacts = v.Contacts
-			l.CreatedAt = v.CreatedAt
-			l.UpdatedAt = v.UpdatedAt
+			l.CreatedAt = strconv.FormatInt(v.CreatedAt, 10)
+			l.UpdatedAt = strconv.FormatInt(v.UpdatedAt, 10)
 			l.ShopUUID = strconv.FormatInt(v.ShopId, 10)
 			l.ShopUUID = strconv.FormatInt(v.ShopId, 10)
 			l.Status = s.ManageStatusToWebStatus(v.Status)
 			l.Status = s.ManageStatusToWebStatus(v.Status)
-			println(l.ShopUUID)
+			//println(l.ShopUUID)
 			info = append(info, l)
 			info = append(info, l)
 		}
 		}
 	}
 	}
@@ -83,9 +83,9 @@ func (s Shop) ManageableGetShopInfo(token string, r *pb.ShopDetailRequest) *pb.S
 		Phone:       rst.Phone,
 		Phone:       rst.Phone,
 		Contacts:    rst.Contacts,
 		Contacts:    rst.Contacts,
 		Status:      s.ManageStatusToWebStatus(rst.Status),
 		Status:      s.ManageStatusToWebStatus(rst.Status),
-		CreatedAt:   rst.CreatedAt,
+		CreatedAt:   strconv.FormatInt(rst.CreatedAt, 10),
 		CreatedUser: rst.CreatedUser,
 		CreatedUser: rst.CreatedUser,
-		UpdatedAt:   rst.UpdatedAt,
+		UpdatedAt:   strconv.FormatInt(rst.UpdatedAt, 10),
 		UpdatedUser: rst.UpdatedUser,
 		UpdatedUser: rst.UpdatedUser,
 		IsHr:        isHr,
 		IsHr:        isHr,
 		IsScore:     isScore,
 		IsScore:     isScore,
@@ -133,7 +133,7 @@ func (s Shop) GetShopNavi(token string, r *pb.GetShopNaviRequest) *pb.GetShopNav
 			l.Code = v.Code
 			l.Code = v.Code
 			l.Sn = v.Sn
 			l.Sn = v.Sn
 			l.NavShow = v.NavShow
 			l.NavShow = v.NavShow
-			l.Id = v.Id
+			l.Id = strconv.FormatInt(v.Id, 10)
 			l.Status = s.ManageStatusToWebStatus(v.Status)
 			l.Status = s.ManageStatusToWebStatus(v.Status)
 			info = append(info, l)
 			info = append(info, l)
 		}
 		}

+ 3 - 3
proto/server/base.proto

@@ -198,9 +198,9 @@ message ShopInfo{
   string phone = 5;
   string phone = 5;
   string contacts = 6;
   string contacts = 6;
   WebStatus status = 7;
   WebStatus status = 7;
-  int64 created_at = 8;
+  string  created_at = 8;
   int64 created_user = 9;
   int64 created_user = 9;
-  int64 updated_at = 10;
+  string updated_at = 10;
   int64 updated_user = 11;
   int64 updated_user = 11;
   int64 is_hr = 12;
   int64 is_hr = 12;
   int64 is_score = 13;
   int64 is_score = 13;
@@ -245,7 +245,7 @@ message Column{
   int32 sn = 4;
   int32 sn = 4;
   WebStatus status = 5;
   WebStatus status = 5;
   bool navShow = 6;
   bool navShow = 6;
-  int64 id = 7;
+  string id = 7;
 }
 }
 
 
 message GetShopNaviReply{
 message GetShopNaviReply{