package com.huimv.receive.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huimv.receive.common.token.TokenSign;
import com.huimv.receive.common.utils.Result;
import com.huimv.receive.common.utils.ResultCode;
import com.huimv.receive.entity.BaseFlow;
import com.huimv.receive.entity.BaseWashoutPoint;
import com.huimv.receive.service.IBaseFlowService;
import com.huimv.receive.service.IBaseWashoutPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotBlank;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-03-06
 */
@RestController
@RequestMapping("/base-flow")
@CrossOrigin
public class BaseFlowController {
    @Autowired
    private IBaseFlowService baseFlowService;

    @PostMapping("/page")
    public Result list(@RequestBody Map<String,String> paramsMap){
        String pageNum = paramsMap.get("pageNum");
        String pageSize = paramsMap.get("pageSize");
        Page<BaseFlow> baseFlowPage = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
        return new Result(ResultCode.SUCCESS,baseFlowService.page(baseFlowPage));
    }

    @PostMapping("/list")
    public Result list(){
        return new Result(ResultCode.SUCCESS,baseFlowService.list());
    }
}
