Subversion Repositories SmartDukaan

Rev

Rev 9218 | Rev 11958 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9218 Rev 11957
Line 6... Line 6...
6
import in.shop2020.metamodel.core.ExpertReview;
6
import in.shop2020.metamodel.core.ExpertReview;
7
import in.shop2020.metamodel.core.ExpertReviewSource;
7
import in.shop2020.metamodel.core.ExpertReviewSource;
8
import in.shop2020.metamodel.core.Helpdoc;
8
import in.shop2020.metamodel.core.Helpdoc;
9
import in.shop2020.metamodel.core.SpecialPage;
9
import in.shop2020.metamodel.core.SpecialPage;
10
import in.shop2020.metamodel.util.ExpandedBullet;
10
import in.shop2020.metamodel.util.ExpandedBullet;
-
 
11
import in.shop2020.metamodel.util.ItemPojo;
-
 
12
import in.shop2020.metamodel.util.PrivateDealPojo;
11
import in.shop2020.storage.mongo.adapters.BDOAdapter;
13
import in.shop2020.storage.mongo.adapters.BDOAdapter;
12
 
14
 
13
import java.lang.reflect.Type;
15
import java.lang.reflect.Type;
14
import java.util.ArrayList;
16
import java.util.ArrayList;
15
import java.util.Collection;
17
import java.util.Collection;
Line 63... Line 65...
63
    /**
65
    /**
64
     * Run the sample program.
66
     * Run the sample program.
65
     * @throws Exception 
67
     * @throws Exception 
66
     */
68
     */
67
    public static void main(String[] args) throws Exception {
69
    public static void main(String[] args) throws Exception {
68
    	Map<Long,Double> m = StorageManager.getStorageManager().getCustomSlideScores(1008185);
70
    	String jsonDeals = StorageManager.getStorageManager().getDealsJson(1007521l);
69
    	System.out.println(m.containsKey(130002l));
71
    	System.out.println(jsonDeals);
70
    }
72
    }
71
 
73
 
72
    /**
74
    /**
73
     * get storage manager
75
     * get storage manager
74
     * @return MongoStorageManager
76
     * @return MongoStorageManager
Line 439... Line 441...
439
 
441
 
440
	public List<ExpertReview> getExpertReviewByEntity(long entityId) {
442
	public List<ExpertReview> getExpertReviewByEntity(long entityId) {
441
		Type t = new TypeToken<List<ExpertReview>>() {}.getType();
443
		Type t = new TypeToken<List<ExpertReview>>() {}.getType();
442
		return getById(views.expertReviews, entityId, t);
444
		return getById(views.expertReviews, entityId, t);
443
	}
445
	}
-
 
446
	
-
 
447
	public String getDealsJson(Long entityId){
-
 
448
		Type t = new TypeToken<ItemPojo>() {}.getType();
-
 
449
		DBObject dboQuery=  new BasicDBObject().append("_id", entityId);
-
 
450
		DBObject dboProjection = new BasicDBObject("items.dealPojo", 1).append("items.id", 1);
-
 
451
		DBObject dbo =  views.siteContent.findOne(dboQuery,dboProjection);
-
 
452
		if(dbo != null && dbo.get("items")!=null){
-
 
453
			return dbo.get("items").toString();
-
 
454
		}
-
 
455
		return null;
-
 
456
	}
444
    
457
    
445
}
458
}