package com.uas.console.donate.controller; import com.alibaba.fastjson.JSONObject; import com.uas.console.donate.model.ActivityRecode; import com.uas.console.donate.service.ActivityRecodeService; import com.uas.console.donate.service.ActivityService; import com.uas.console.donate.service.AwardService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; @Controller @RequestMapping("/activityRecode") public class ActivityRecodeController { @Autowired private ActivityRecodeService activityRecodeService; @Autowired private AwardService awardService; @Autowired private ActivityService activityService; /** * 保存活动参与人信息 */ @ResponseBody @RequestMapping("/join") public ActivityRecode join(String jsonStr) { ActivityRecode activityRecode = JSONObject.parseObject(jsonStr, ActivityRecode.class); ActivityRecode activity = activityRecodeService.save(activityRecode); return activity; } /** * 查询某一用户参加过的活动 */ @ResponseBody @RequestMapping("/queryOne") public List queryOne(Long uuid) { return activityRecodeService.queryOne(uuid); } /** * 查询某一活动获奖者信息 * @param activityId * @return */ @ResponseBody @RequestMapping("/whoget") public List whoGetAward(Long activityId) { return activityRecodeService.whoGetAward(activityId); } /** * 查询某一活动参与人信息 * @param activityId * @return */ @ResponseBody @RequestMapping("/joins") public List joins(Long activityId) { return activityRecodeService.joins(activityId); } }