Add sharepoint fields

This commit is contained in:
Abhishek Pandey 2023-08-18 19:26:31 +05:30
parent 3ebb2c1c04
commit 06d4f764e7
2 changed files with 22 additions and 2 deletions

View File

@ -108,6 +108,7 @@ type CorsoDriveItemable interface {
GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
GetMalware() models.Malwareable
GetSharepointIds() models.SharepointIdsable
GetOdataType() *string
}
type CorsoDriveItem struct {
@ -122,6 +123,8 @@ type CorsoDriveItem struct {
CreatedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
LastModifiedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
Malware models.Malwareable
SharepointIds models.SharepointIdsable
OdataType *string
}
func (c *CorsoDriveItem) GetId() *string {
@ -177,7 +180,11 @@ func (c *CorsoDriveItem) GetMalware() models.Malwareable {
}
func (c *CorsoDriveItem) GetSharepointIds() models.SharepointIdsable {
return nil
return c.SharepointIds
}
func (c *CorsoDriveItem) GetOdataType() *string {
return c.OdataType
}
// models.DriveItemable to CorsoDriveItemable
@ -194,6 +201,8 @@ func ToCorsoDriveItemable(item models.DriveItemable) CorsoDriveItemable {
LastModifiedDateTime: item.GetLastModifiedDateTime(),
Malware: item.GetMalware(),
AdditionalData: item.GetAdditionalData(),
SharepointIds: item.GetSharepointIds(),
OdataType: item.GetOdataType(),
}
}

View File

@ -674,7 +674,14 @@ func getBackingStoreSize(ctx context.Context, item models.DriveItemable) {
driveItem := item.(*models.DriveItem)
// Get backing store
st := driveItem.GetBackingStore().(*store.InMemoryBackingStore)
logger.Ctx(ctx).Infow("serialized size", "in_mem_store_size", sizePkg.Of(st.Store))
logger.Ctx(ctx).Infow("store size", "in_mem_store_size", sizePkg.Of(st.Store))
logger.Ctx(ctx).Infow("drive item size", "in_mem_store_size", sizePkg.Of(driveItem))
}
func getBackingStoreSize1(ctx context.Context, item CorsoDriveItemable) {
driveItem := item.(*CorsoDriveItem)
// Get backing store
logger.Ctx(ctx).Infow("corso serialized size", "in_mem_store_size", sizePkg.Of(driveItem))
}
// UpdateCollections initializes and adds the provided drive items to Collections
@ -821,6 +828,8 @@ func (c *Collections) UpdateCollections(
if col.Add(item) {
getBackingStoreSize(ictx, item)
c.NumItems++
cdi := ToCorsoDriveItemable(item)
getBackingStoreSize1(ictx, cdi)
}
case item.GetFile() != nil:
@ -860,6 +869,8 @@ func (c *Collections) UpdateCollections(
getBackingStoreSize(ictx, item)
c.NumItems++
c.NumFiles++
cdi := ToCorsoDriveItemable(item)
getBackingStoreSize1(ictx, cdi)
}
// Do this after adding the file to the collection so if we fail to add