package com.liquidnet.service.platform.controller.kylin.task;

import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.platform.service.impl.kylin.PlatformGroupBuyTaskServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "前端-拼团任务")
@RestController
@RequestMapping("groupBuy")
@Validated
public class PlatformGroupBuyTaskController {

    @Autowired
    private PlatformGroupBuyTaskServiceImpl groupBuyTaskService;

    @PostMapping("timeout")
    @ApiOperation("拼团超时退款任务")
    public ResponseDto<Boolean> timeout() {
        return ResponseDto.success(groupBuyTaskService.timeout());
    }

    @PostMapping("activitySchedule")
    @ApiOperation("拼团活动启动/结束任务")
    public ResponseDto<Boolean> activitySchedule() {
        return ResponseDto.success(groupBuyTaskService.activitySchedule());
    }
}
