chore: fix resource int type

This commit is contained in:
Steven 2023-09-19 08:59:26 +08:00
parent 9bf1979fa8
commit 465b173b36

View File

@ -156,12 +156,12 @@ func (s *Store) ListResources(ctx context.Context, find *FindResource) ([]*Resou
relatedMemoIDList := strings.Split(relatedMemoIDs.String, ",") relatedMemoIDList := strings.Split(relatedMemoIDs.String, ",")
if len(relatedMemoIDList) > 0 { if len(relatedMemoIDList) > 0 {
// Only take the first related memo ID. // Only take the first related memo ID.
relatedMemoIDInt, err := strconv.Atoi(relatedMemoIDList[0]) relatedMemoIDInt, err := strconv.ParseInt(relatedMemoIDList[0], 10, 32)
if err != nil { if err != nil {
return nil, err return nil, err
} }
relatedMemoIDInt32 := int32(relatedMemoIDInt) relatedMemoID := int32(relatedMemoIDInt)
resource.RelatedMemoID = &relatedMemoIDInt32 resource.RelatedMemoID = &relatedMemoID
} }
} }
list = append(list, &resource) list = append(list, &resource)