package com.cool.store.controller.webb;

import com.cool.store.context.CurrentUserHolder;
import com.cool.store.request.PreparationRequest;
import com.cool.store.request.TrainingExperienceDistributionRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.PreparationService;
import com.cool.store.service.impl.PreparationServiceImpl;
import com.cool.store.vo.Preparation.PreparationProcessVO;
import com.cool.store.vo.Preparation.PreparationScheduleDetailVO;
import com.cool.store.vo.Preparation.PreparationScheduleVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author suzhuhong
 * @Date 2024/4/26 16:56
 * @Version 1.0
 */
@Slf4j
@Api(tags = "筹建进度")
@RestController
@RequestMapping("/pc/preparation")
public class PreparationController {

    @Resource
    PreparationService preparationService;

    @ApiOperation("进度列表")
    @PostMapping("/list")
    public ResponseResult<PageInfo<PreparationScheduleVO>> distribution(@RequestBody PreparationRequest request) {
        request.setCurUserId(CurrentUserHolder.getUserId());
        return ResponseResult.success(preparationService.getPreparationSchedule(request));
    }


    @ApiOperation("筹建详情")
    @GetMapping("/getPreparationDetail")
    public ResponseResult<PreparationScheduleDetailVO> getPreparationDetail(@RequestParam("shopId")Long shopId) {
        return ResponseResult.success(preparationService.getPreparationDetail(shopId));
    }

    @ApiOperation("筹建进展")
    @GetMapping("/getPreparationProcess")
    public ResponseResult<PreparationProcessVO> getPreparationProcess(@RequestParam("shopId")Long shopId) {
        return ResponseResult.success(preparationService.getPreparationProcess(shopId));
    }

}
