package com.corewing.app.modules.app;

import com.corewing.app.common.Result;
import com.corewing.app.dto.SubmitActivityRequest;
import com.corewing.app.service.BizActivityLotteryService;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "活动控制")
@Controller
@RequestMapping("/api/app/activity")
public class AppActivityController {

    @Resource
    private BizActivityLotteryService bizActivityLotteryService;

    /**
     * 活动参与地址
     * @param activityId
     * @return
     */
    @GetMapping("/eventVenue/{activityId}")
    public String eventVenue(@PathVariable String activityId) {
        return "/activity/eventVenue";
    }

    /**
     * 提交活动
     * @return
     */
    @PostMapping("/submitActivity")
    @ResponseBody
    public Result<String> submitActivity(SubmitActivityRequest submitActivityRequest) {
        return Result.isBool(bizActivityLotteryService.submitActivity(submitActivityRequest));
    }

}
