| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package com.uas.service.donate.controller;
- import com.alibaba.fastjson.JSONObject;
- import com.uas.service.donate.model.ActivityRecode;
- import com.uas.service.donate.service.ActivityRecodeService;
- 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.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
- @Controller
- @RequestMapping("/activityRecode")
- public class ActivityRecodeController {
- @Autowired
- private ActivityRecodeService activityRecodeService;
- /**
- * 参与活动
- */
- @ResponseBody
- @RequestMapping("/join")
- public ActivityRecode join(Long activityId,Long uuid){
- ActivityRecode activityRecode=new ActivityRecode();
- activityRecode.setActivityId(activityId);
- activityRecode.setUuid(uuid);
- activityRecode.setStatus(0);
- ActivityRecode activity=activityRecodeService.save(activityRecode);
- return activity;
- }
- /**
- *查询某一用户参加过的活动
- */
- @ResponseBody
- @RequestMapping("/queryOne")
- public List<ActivityRecode> queryOne(Long uuid){
- return activityRecodeService.queryOne(uuid);
- }
- /**
- * 查询某一活动参与者
- * @param activityId
- * @return
- */
- @ResponseBody
- @RequestMapping("/joins")
- public List<ActivityRecode> joins(Long activityId){
- return activityRecodeService.joins(activityId);
- }
- /**
- * 领奖 1.未领取 2.已领取
- */
- @ResponseBody
- @RequestMapping("/receive")
- public ActivityRecode receive(Long activityId,Long uuid){
- ActivityRecode activityRecode=activityRecodeService.findOne(activityId,uuid);
- activityRecode.setStatus(2);
- activityRecode.setReceiveTime(new Date());
- return activityRecode;
- }
- }
|