| Line 3... |
Line 3... |
| 3 |
import com.google.gson.Gson;
|
3 |
import com.google.gson.Gson;
|
| 4 |
import com.jcraft.jsch.*;
|
4 |
import com.jcraft.jsch.*;
|
| 5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 6 |
import com.spice.profitmandi.common.solr.SolrService;
|
6 |
import com.spice.profitmandi.common.solr.SolrService;
|
| 7 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
7 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| - |
|
8 |
import com.spice.profitmandi.dao.entity.cs.Bulletin;
|
| 8 |
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
|
9 |
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
|
| 9 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
10 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
| 10 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
11 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
| 11 |
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
|
12 |
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
|
| 12 |
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
|
13 |
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
|
| Line 16... |
Line 17... |
| 16 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
17 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 17 |
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
|
18 |
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
|
| 18 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
19 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| 19 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
20 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 20 |
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
|
21 |
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
|
| - |
|
22 |
import com.spice.profitmandi.dao.repository.cs.BulletinRepository;
|
| 21 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
23 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
24 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.dtr.DocumentUrlRepository;
|
25 |
import com.spice.profitmandi.dao.repository.dtr.DocumentUrlRepository;
|
| 24 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
26 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 25 |
import com.spice.profitmandi.dao.repository.fofo.PrintResourceRegionRepository;
|
27 |
import com.spice.profitmandi.dao.repository.fofo.PrintResourceRegionRepository;
|
| Line 89... |
Line 91... |
| 89 |
PartnerRegionRepository partnerRegionRepository;
|
91 |
PartnerRegionRepository partnerRegionRepository;
|
| 90 |
@Autowired
|
92 |
@Autowired
|
| 91 |
SuperCatalogRepository superCatalogRepository;
|
93 |
SuperCatalogRepository superCatalogRepository;
|
| 92 |
@Autowired
|
94 |
@Autowired
|
| 93 |
CatalogRepository catalogRepository;
|
95 |
CatalogRepository catalogRepository;
|
| 94 |
|
96 |
@Autowired
|
| - |
|
97 |
BulletinRepository bulletinRepository;
|
| 95 |
private Gson gson = new Gson();
|
98 |
private Gson gson = new Gson();
|
| 96 |
|
99 |
|
| 97 |
public static final int Entity_Id = 0;
|
100 |
public static final int Entity_Id = 0;
|
| 98 |
public static final int Title = 1;
|
101 |
public static final int Title = 1;
|
| 99 |
public static final int KeySpec1 = 2;
|
102 |
public static final int KeySpec1 = 2;
|
| Line 757... |
Line 760... |
| 757 |
LOGGER.info("Video Url {}", cp.getVideoUrls());
|
760 |
LOGGER.info("Video Url {}", cp.getVideoUrls());
|
| 758 |
return ResponseEntity.ok(cp.getVideoUrls());
|
761 |
return ResponseEntity.ok(cp.getVideoUrls());
|
| 759 |
}
|
762 |
}
|
| 760 |
|
763 |
|
| 761 |
|
764 |
|
| - |
|
765 |
@GetMapping(value = "/bulletin")
|
| - |
|
766 |
public String bulletin(HttpServletRequest request, Model model) throws Exception {
|
| - |
|
767 |
List<Region> regionList = regionRepository.selectAll();
|
| - |
|
768 |
model.addAttribute("regionList", regionList);
|
| - |
|
769 |
return "post-bulletin";
|
| - |
|
770 |
}
|
| - |
|
771 |
|
| - |
|
772 |
|
| - |
|
773 |
@RequestMapping(value = "/bulletinPost", method = RequestMethod.POST)
|
| - |
|
774 |
public String bulletinPost(HttpServletRequest request, @RequestBody BulletinPostModel bulletinPostModel,
|
| - |
|
775 |
Model model) throws Exception {
|
| - |
|
776 |
LOGGER.info("bulletinPostModel {}", bulletinPostModel);
|
| - |
|
777 |
Bulletin bulletin = new Bulletin();
|
| - |
|
778 |
bulletin.setTitle(bulletinPostModel.getTitle());
|
| - |
|
779 |
bulletin.setRegionId(bulletinPostModel.getRegionId());
|
| - |
|
780 |
bulletin.setDescription(bulletinPostModel.getDescription());
|
| - |
|
781 |
bulletin.setDocumentIds(bulletinPostModel.getDocumentIds());
|
| - |
|
782 |
bulletin.setCreatedAt(LocalDateTime.now());
|
| - |
|
783 |
bulletinRepository.persist(bulletin);
|
| - |
|
784 |
|
| - |
|
785 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| - |
|
786 |
|
| - |
|
787 |
return "response";
|
| - |
|
788 |
}
|
| - |
|
789 |
|
| - |
|
790 |
|
| - |
|
791 |
|
| - |
|
792 |
|
| 762 |
}
|
793 |
}
|