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 GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
GetMalware() models.Malwareable GetMalware() models.Malwareable
GetSharepointIds() models.SharepointIdsable GetSharepointIds() models.SharepointIdsable
GetOdataType() *string
} }
type CorsoDriveItem struct { type CorsoDriveItem struct {
@ -122,6 +123,8 @@ type CorsoDriveItem struct {
CreatedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time CreatedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
LastModifiedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time LastModifiedDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
Malware models.Malwareable Malware models.Malwareable
SharepointIds models.SharepointIdsable
OdataType *string
} }
func (c *CorsoDriveItem) GetId() *string { func (c *CorsoDriveItem) GetId() *string {
@ -177,7 +180,11 @@ func (c *CorsoDriveItem) GetMalware() models.Malwareable {
} }
func (c *CorsoDriveItem) GetSharepointIds() models.SharepointIdsable { func (c *CorsoDriveItem) GetSharepointIds() models.SharepointIdsable {
return nil return c.SharepointIds
}
func (c *CorsoDriveItem) GetOdataType() *string {
return c.OdataType
} }
// models.DriveItemable to CorsoDriveItemable // models.DriveItemable to CorsoDriveItemable
@ -194,6 +201,8 @@ func ToCorsoDriveItemable(item models.DriveItemable) CorsoDriveItemable {
LastModifiedDateTime: item.GetLastModifiedDateTime(), LastModifiedDateTime: item.GetLastModifiedDateTime(),
Malware: item.GetMalware(), Malware: item.GetMalware(),
AdditionalData: item.GetAdditionalData(), 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) driveItem := item.(*models.DriveItem)
// Get backing store // Get backing store
st := driveItem.GetBackingStore().(*store.InMemoryBackingStore) 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 // UpdateCollections initializes and adds the provided drive items to Collections
@ -821,6 +828,8 @@ func (c *Collections) UpdateCollections(
if col.Add(item) { if col.Add(item) {
getBackingStoreSize(ictx, item) getBackingStoreSize(ictx, item)
c.NumItems++ c.NumItems++
cdi := ToCorsoDriveItemable(item)
getBackingStoreSize1(ictx, cdi)
} }
case item.GetFile() != nil: case item.GetFile() != nil:
@ -860,6 +869,8 @@ func (c *Collections) UpdateCollections(
getBackingStoreSize(ictx, item) getBackingStoreSize(ictx, item)
c.NumItems++ c.NumItems++
c.NumFiles++ c.NumFiles++
cdi := ToCorsoDriveItemable(item)
getBackingStoreSize1(ictx, cdi)
} }
// Do this after adding the file to the collection so if we fail to add // Do this after adding the file to the collection so if we fail to add