package com.liquidnet.service.goblin.controller.manage;

import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.service.manage.IGoblinZhengzaiService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * 正在下单活动管理
 */
@Slf4j
@RestController
@Api(tags = "活动-正在下单")
@RequestMapping("store/zhengzai")
public class GoblinZhengzaiController {

    @Autowired
    IGoblinZhengzaiService goblinZhengzaiService;

    @GetMapping("zhengzai/list")
    @ApiOperation("活动详情-正在下单-可参与活动列表")
    @ApiResponse(code = 200, message = "接口返回对象参数")
    @ApiImplicitParams({
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1")
    })
    public ResponseDto<List<GoblinSelfMarketingVo>> zhengzaiCanJoin(@RequestParam("storeId") @Valid String storeId) {
        return ResponseDto.success(goblinZhengzaiService.zhengzaiCanJoin(storeId));
    }

    @GetMapping("zhengzai/detals")
    @ApiOperation("活动详情-正在下单-可参与活动详情")
    @ApiResponse(code = 200, message = "接口返回对象参数")
    @ApiImplicitParams({
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1")
    })
    public ResponseDto<GoblinSelfMarketingVo> zhengzaiCanJoinDetails(@RequestParam("storeId") @Valid String storeId,
                                                                     @RequestParam("selfMarketId") @Valid String selfMarketId) {
        return ResponseDto.success(goblinZhengzaiService.zhengzaiCanJoinDetails(selfMarketId, storeId));
    }

    @PostMapping("zhengzai/config")
    @ApiOperation("活动详情-正在下单-配置商铺sku")
    @ApiResponse(code = 200, message = "接口返回对象参数")
    @ApiImplicitParams({
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1")
    })
    public ResponseDto<Boolean> zhengzaiStoreConfig(@RequestParam("storeId") @Valid String storeId,
                                                    @RequestParam("selfMarketId") @Valid String selfMarketId) {
        //todo
        return null;
    }

    @GetMapping("zhengzai/config/spu")
    @ApiOperation("活动详情-正在下单-获取商铺spu")
    @ApiResponse(code = 200, message = "接口返回对象参数")
    @ApiImplicitParams({
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1")
    })
    public ResponseDto<Boolean> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId,
                                                           @RequestParam("selfMarketId") @Valid String selfMarketId) {
        //todo
        return null;
    }

    @GetMapping("zhengzai/config/sku")
    @ApiOperation("活动详情-正在下单-获取商铺sku")
    @ApiResponse(code = 200, message = "接口返回对象参数")
    @ApiImplicitParams({
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1")
    })
    public ResponseDto<Boolean> zhengzaiStoreConfigSkuList(@RequestParam("storeId") @Valid String storeId,
                                                           @RequestParam("spuId") @Valid String spuId,
                                                           @RequestParam("selfMarketId") @Valid String selfMarketId) {
        //todo
        return null;
    }

    @DeleteMapping("zhengzai/config")
    @ApiOperation("活动详情-正在下单-删除商铺sku")
    @ApiResponse(code = 200, message = "接口返回对象参数")
    @ApiImplicitParams({
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
            @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuId", value = "skuId", example = "1"),
    })
    public ResponseDto<Boolean> zhengzaiStoreDel(@RequestParam("storeId") @Valid String storeId,
                                                 @RequestParam("selfMarketId") @Valid String selfMarketId,
                                                 @RequestParam("skuId") @Valid String skuId) {
        //todo
        return null;
    }

}
