| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 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.auth.AuthUser;
|
| 7 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
8 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 8 |
import com.spice.profitmandi.dao.entity.cs.Bulletin;
|
9 |
import com.spice.profitmandi.dao.entity.cs.Bulletin;
|
| 9 |
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
|
10 |
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
|
| 10 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
11 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
| 11 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
12 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
| Line 771... |
Line 772... |
| 771 |
|
772 |
|
| 772 |
|
773 |
|
| 773 |
@RequestMapping(value = "/bulletinPost", method = RequestMethod.POST)
|
774 |
@RequestMapping(value = "/bulletinPost", method = RequestMethod.POST)
|
| 774 |
public String bulletinPost(HttpServletRequest request, @RequestBody BulletinPostModel bulletinPostModel,
|
775 |
public String bulletinPost(HttpServletRequest request, @RequestBody BulletinPostModel bulletinPostModel,
|
| 775 |
Model model) throws Exception {
|
776 |
Model model) throws Exception {
|
| - |
|
777 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
778 |
String email = loginDetails.getEmailId();
|
| - |
|
779 |
AuthUser authUser = authRepository.selectByEmailOrMobile(email);
|
| 776 |
LOGGER.info("bulletinPostModel {}", bulletinPostModel);
|
780 |
LOGGER.info("bulletinPostModel {}", bulletinPostModel);
|
| 777 |
Bulletin bulletin = new Bulletin();
|
781 |
Bulletin bulletin = new Bulletin();
|
| 778 |
bulletin.setTitle(bulletinPostModel.getTitle());
|
- |
|
| 779 |
bulletin.setRegionId(bulletinPostModel.getRegionId());
|
782 |
bulletin.setRegionId(bulletinPostModel.getRegionId());
|
| 780 |
bulletin.setDescription(bulletinPostModel.getDescription());
|
783 |
bulletin.setDescription(bulletinPostModel.getDescription());
|
| 781 |
bulletin.setDocumentIds(bulletinPostModel.getDocumentIds());
|
784 |
bulletin.setDocumentIds(bulletinPostModel.getDocumentIds());
|
| 782 |
bulletin.setCreatedAt(LocalDateTime.now());
|
785 |
bulletin.setCreatedAt(LocalDateTime.now());
|
| - |
|
786 |
bulletin.setCreatedBy(authUser.getFullName());
|
| 783 |
bulletinRepository.persist(bulletin);
|
787 |
bulletinRepository.persist(bulletin);
|
| 784 |
|
788 |
|
| 785 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
789 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 786 |
|
790 |
|
| 787 |
return "response";
|
791 |
return "response";
|