OpenAppUserController.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package com.goafanti.app.controller;
  2. import javax.annotation.Resource;
  3. import org.apache.commons.lang3.StringUtils;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestMethod;
  6. import org.springframework.web.bind.annotation.RestController;
  7. import com.goafanti.achievement.service.AchievementInterestService;
  8. import com.goafanti.achievement.service.AchievementService;
  9. import com.goafanti.activity.service.ActivityService;
  10. import com.goafanti.banners.service.BannersService;
  11. import com.goafanti.common.bo.Result;
  12. import com.goafanti.common.constant.ErrorConstants;
  13. import com.goafanti.common.controller.BaseApiController;
  14. import com.goafanti.demand.service.DemandService;
  15. import com.goafanti.easemob.EasemobUtils;
  16. import com.goafanti.message.service.MessageService;
  17. import com.goafanti.news.service.NewsService;
  18. import com.goafanti.user.service.UserCareerService;
  19. import com.goafanti.user.service.UserIdentityService;
  20. import com.goafanti.user.service.UserInterestService;
  21. import com.goafanti.user.service.UserService;
  22. @RestController
  23. @RequestMapping(path = "open/app/user", method = RequestMethod.GET)
  24. public class OpenAppUserController extends BaseApiController {
  25. @Resource
  26. private UserService userServiceImpl;
  27. @Resource
  28. private MessageService messageService;
  29. @Resource
  30. private EasemobUtils easemobUtils;
  31. @Resource
  32. private BannersService bannersService;
  33. @Resource
  34. private ActivityService activityService;
  35. @Resource
  36. private NewsService newsService;
  37. @Resource
  38. private AchievementService achievementService;
  39. @Resource
  40. private DemandService demandService;
  41. @Resource
  42. private UserCareerService userCareerService;
  43. @Resource
  44. private UserInterestService userInterestService;
  45. @Resource
  46. private UserIdentityService userIdentityService;
  47. @Resource
  48. AchievementInterestService achievementInterestService;
  49. /**
  50. * 专家详情
  51. */
  52. @RequestMapping(value = "/expertsDetail", method = RequestMethod.GET)
  53. public Result expertsDetail(String uid) {
  54. Result res = new Result();
  55. if (StringUtils.isBlank(uid)) {
  56. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"专家必须指定","专家"));
  57. return res;
  58. }
  59. res.setData(userIdentityService.expertsDetail( uid));
  60. return res;
  61. }
  62. /**
  63. * 成果详情
  64. * @param id
  65. * @return
  66. */
  67. @RequestMapping(value = "/achievementDetail", method = RequestMethod.GET)
  68. private Result userDetail(String id ) {
  69. Result res = new Result();
  70. if (StringUtils.isBlank(id)) {
  71. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"成果必须指定","成果"));
  72. return res;
  73. }
  74. res.setData(achievementService.selectAppUserOwnerDetail(id));
  75. return res;
  76. }
  77. /**
  78. * 需求详情
  79. */
  80. @RequestMapping(value = "/demandDetail", method = RequestMethod.GET)
  81. public Result DemandDetail(String id ) {
  82. Result res = new Result();
  83. if (StringUtils.isBlank(id)) {
  84. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"需求必须指定","需求"));
  85. return res;
  86. }
  87. res.setData(demandService.selectDemandDetail( id));
  88. return res;
  89. }
  90. @RequestMapping(value = "/index", method = RequestMethod.GET)
  91. public Result index(){
  92. Result res = new Result();
  93. res.setData(messageService.selectMessageWithGroup());
  94. return res;
  95. }
  96. }