| Line 18... |
Line 18... |
| 18 |
import org.springframework.web.bind.annotation.RequestMethod;
|
18 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 19 |
import org.springframework.web.bind.annotation.RequestParam;
|
19 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 20 |
|
20 |
|
| 21 |
import com.mongodb.DBObject;
|
21 |
import com.mongodb.DBObject;
|
| 22 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
22 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 23 |
import com.spice.profitmandi.dao.entity.catalog.Brand;
|
23 |
import com.spice.profitmandi.dao.entity.catalog.BrandCatalog;
|
| 24 |
import com.spice.profitmandi.dao.entity.catalog.BrandCategory;
|
24 |
import com.spice.profitmandi.dao.entity.catalog.BrandCategory;
|
| 25 |
import com.spice.profitmandi.dao.entity.dtr.Api;
|
25 |
import com.spice.profitmandi.dao.entity.dtr.Api;
|
| 26 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
26 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
| 27 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
27 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 28 |
import com.spice.profitmandi.dao.enumuration.dtr.Method;
|
28 |
import com.spice.profitmandi.dao.enumuration.dtr.Method;
|
| Line 240... |
Line 240... |
| 240 |
List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
|
240 |
List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
|
| 241 |
for (DBObject mobileBrand : mobileBrands) {
|
241 |
for (DBObject mobileBrand : mobileBrands) {
|
| 242 |
String brandName = (String) mobileBrand.get("name");
|
242 |
String brandName = (String) mobileBrand.get("name");
|
| 243 |
// Brand brand = brandsRepository.selectByBrand(brandName);
|
243 |
// Brand brand = brandsRepository.selectByBrand(brandName);
|
| 244 |
|
244 |
|
| 245 |
Brand brand = new Brand();
|
245 |
BrandCatalog brand = new BrandCatalog();
|
| 246 |
brand.setName(brandName);
|
246 |
brand.setName(brandName);
|
| 247 |
brand.setLogoUrl((String) mobileBrand.get("url"));
|
247 |
brand.setLogoUrl((String) mobileBrand.get("url"));
|
| 248 |
brandsRepository.persist(brand);
|
248 |
brandsRepository.persist(brand);
|
| 249 |
Double category = (Double) mobileBrand.get("categoryId");
|
249 |
Double category = (Double) mobileBrand.get("categoryId");
|
| 250 |
|
250 |
|