package com.cool.store.controller.webb;

import com.cool.store.context.CurrentUserHolder;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.PointService;
import com.cool.store.vo.point.PointToDoVO;
import com.cool.store.vo.shop.RentInfoToDoVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author zhangchenbiao
 * @FileName: ToDoController
 * @Description:
 * @date 2024-04-22 14:29
 */
@Api(tags = "待办")
@RestController
@RequestMapping("/pc/todo")
public class ToDoController {

    @Resource
    private PointService pointService;

    @ApiOperation("获取铺位选址待办")
    @GetMapping("/getSelectPointToDoPage")
    public ResponseResult<PageInfo<PointToDoVO>> getSelectPointToDoPage(@RequestParam(value = "pageNumber",defaultValue = "1")Integer pageNumber,
                                                                        @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize){
        String userId = CurrentUserHolder.getUserId();
        return ResponseResult.success(pointService.getSelectPointToDoPage(userId, pageNumber, pageSize));
    }

    @ApiOperation("上传租赁合同待办")
    @PostMapping("/getRentContractToDoPage")
    public ResponseResult<PageInfo<RentInfoToDoVO>> getRentContractToDoPage(@RequestParam(value = "pageNumber",defaultValue = "1")Integer pageNumber,
                                                            @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize){
        String userId = CurrentUserHolder.getUserId();
        return ResponseResult.success(pointService.getRentContractToDoPage(userId, pageNumber, pageSize));
    }
}
