PublicApiController.java 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.uas.ps.inquiry.controller;
  2. import com.uas.ps.httplog.annotation.HttpLog;
  3. import com.uas.ps.inquiry.service.PublicInquiryService;
  4. import org.slf4j.Logger;
  5. import org.slf4j.LoggerFactory;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.ui.ModelMap;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestMethod;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import java.util.Date;
  12. /**
  13. * 询价服务供其他应用调用的接口
  14. *
  15. * @author dongbw
  16. */
  17. @RequestMapping(value = "/inquiry/api")
  18. @RestController
  19. public class PublicApiController {
  20. @Autowired
  21. private PublicInquiryService publicInquiryService;
  22. private final static Logger log = LoggerFactory.getLogger(PublicApiController.class);
  23. /**
  24. * 查询个人不同型号发布询价数量统计
  25. * @param enuu 企业uu
  26. * @param useruu 用户uu
  27. * @param starttime 开始时间
  28. * @param endtime 结束时间
  29. * @return 数量结果
  30. */
  31. @HttpLog
  32. @RequestMapping(value = "/sum/publish/personal", method = RequestMethod.GET)
  33. public ModelMap sumPersonalPublish(Long enuu, Long useruu, Long starttime, Long endtime) {
  34. long start = System.currentTimeMillis();
  35. ModelMap map = publicInquiryService.sumPersonalPublish(enuu, useruu, starttime, endtime);
  36. log.info("/api/sum/publish/personal get 参数:enuu: {}, useruu: {}, starttime: {}, endtime: {}, 耗时: {}",
  37. enuu, useruu, new Date(starttime), new Date(endtime), (System.currentTimeMillis() - start));
  38. return map;
  39. }
  40. /**
  41. * 查询企业不同型号发布询价数量统计
  42. * @param enuu 企业uu
  43. * @param starttime 开始时间
  44. * @param endtime 结束时间
  45. * @return
  46. */
  47. @HttpLog
  48. @RequestMapping(value = "/sum/publish/enterprise", method = RequestMethod.GET)
  49. public ModelMap sumEnterprisePublish(Long enuu, Long starttime, Long endtime) {
  50. long start = System.currentTimeMillis();
  51. ModelMap map = publicInquiryService.sumEnterprisePublish(enuu, starttime, endtime);
  52. log.info("/api/sum/publish/enterprise get 参数:enuu: {}, starttime: {}, endtime: {}, 耗时: {}",
  53. enuu, new Date(starttime), new Date(endtime), (System.currentTimeMillis() - start));
  54. return map;
  55. }
  56. /**
  57. * 查询个人回复询价数量统计
  58. * @param enuu 企业uu
  59. * @param useruu 用户uu
  60. * @param starttime 开始时间
  61. * @param endtime 结束时间
  62. * @return
  63. */
  64. @HttpLog
  65. @RequestMapping(value = "/sum/reply/personal", method = RequestMethod.GET)
  66. public ModelMap sumPersonalReply(Long enuu, Long useruu, Long starttime, Long endtime) {
  67. long start = System.currentTimeMillis();
  68. ModelMap map = publicInquiryService.sumPersonalReply(enuu, useruu, starttime, endtime);
  69. log.info("/api/sum/reply/personal get 参数:enuu: {}, useruu: {}, starttime: {}, endtime: {}, 耗时: {}",
  70. enuu, useruu, new Date(starttime), new Date(endtime), (System.currentTimeMillis() - start));
  71. return map;
  72. }
  73. /**
  74. * 查询企业回复询价数量统计
  75. * @param enuu 企业uu
  76. * @param starttime 开始时间
  77. * @param endtime 结束时间
  78. * @return
  79. */
  80. @HttpLog
  81. @RequestMapping(value = "/sum/reply/enterprise", method = RequestMethod.GET)
  82. public ModelMap sumEnterpriseReply(Long enuu, Long starttime, Long endtime) {
  83. long start = System.currentTimeMillis();
  84. ModelMap map = publicInquiryService.sumEnterpriseReply(enuu, starttime, endtime);
  85. log.info("/api/sum/reply/enterprise get 参数:enuu: {}, starttime: {}, endtime: {}, 耗时: {}",
  86. enuu, new Date(starttime), new Date(endtime), (System.currentTimeMillis() - start));
  87. return map;
  88. }
  89. }