package io.gisbi.api.permissions.dataset.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.gisbi.api.permissions.dataset.dto.*;
import io.gisbi.api.permissions.user.vo.UserFormVO;
import io.gisbi.auth.DeApiPath;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

import static io.gisbi.constant.AuthResourceEnum.DATASET;


@DeApiPath(value = "/dataset/rowPermissions", rt = DATASET)
public interface RowPermissionsApi {

    @GetMapping("/pager/{datasetId}/{goPage}/{pageSize}")
    public IPage<DataSetRowPermissionsTreeDTO> rowPermissions(@PathVariable("datasetId") Long datasetId, @PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize);


    @PostMapping("save")
    public void save(@RequestBody DataSetRowPermissionsTreeDTO datasetRowPermissions);


    @PostMapping("/delete")
    public void delete(@RequestBody DataSetRowPermissionsTreeDTO datasetRowPermissions);


    @GetMapping("/authObjs/{datasetId}/{type}")
    public List<Item> authObjs(@PathVariable("datasetId") Long datasetId, @PathVariable("type") String type);

    @PostMapping("/dataSetRowPermissionInfo")
    public DataSetRowPermissionsTreeDTO dataSetRowPermissionInfo(@RequestBody DataSetRowPermissionsTreeDTO request);

    @PostMapping("/whiteListUsers")
    public List<UserFormVO> whiteListUsers(@RequestBody WhiteListUsersRequest request);

    public UserFormVO getUserById(Long id);

    public List<DataSetRowPermissionsTreeDTO> list(DatasetRowPermissionsTreeRequest dataSetRowPermissionsTreeDTO) ;
}
