package cd.casic.ci.api;


import cd.casic.ci.process.dto.req.cloudResource.CloudResourceQueryReq;
import cd.casic.ci.process.dto.req.cloudResource.CloudResourceReq;
import cd.casic.ci.process.dto.resp.cloudResource.CloudResourceFindResp;
import cd.casic.ci.process.process.service.cloudResource.CloudResourceService;
import cd.casic.framework.commons.pojo.CommonResult;
import cd.casic.framework.commons.pojo.PageResult;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.jetbrains.annotations.NotNull;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName cloudResource
 * @Author hopeli
 * @Date 2025/5/10 10:57
 * @Version 1.0
 */

@RestController
@RequestMapping("/cloudResource")
public class CloudResourceController {

    @Resource
    private CloudResourceService cloudResourceService;

    @PostMapping(path="/createCloudResource")
    public CommonResult<String> createCloudResource(@RequestBody @Valid CloudResourceReq req){

        String resourceId = cloudResourceService.createCloudResource(req);

        return CommonResult.success(resourceId);
    }


//    @PostMapping(path="/deleteResource")
//    public CommonResult<Void> deleteResource(@RequestBody @Valid BaseIdReq req){
//
//        resourceManagerService.deleteResource(req.getId());
//
//        return CommonResult.success();
//    }
//
//    @PostMapping(path="/findResourceList")
//    public CommonResult<List<ResourceFindResp>> findResourceList(@RequestBody @Valid ResourceQueryReq req){
//
//        List<ResourceFindResp> ResourceFindRespList = resourceManagerService.findResourceList(req);
//
//        return CommonResult.success(ResourceFindRespList);
//    }
//
//
//
//    @PostMapping(path="/updateResource")
//    public CommonResult<Void> updateResource(@RequestBody @NotNull @Valid ResourceReq resourceReq){
//
//        resourceManagerService.updateResource(resourceReq);
//
//        return CommonResult.success();
//    }
//

    @PostMapping(path="/findCloudResourcePage")
    public CommonResult<PageResult<CloudResourceFindResp>> findCloudResourcePage(@RequestBody @NotNull @Valid CloudResourceQueryReq req){

        PageResult<CloudResourceFindResp> respPage = cloudResourceService.findCloudResourcePage(req);
        return CommonResult.success(respPage);
    }
//
//
//    @PostMapping(path="/findResourceById")
//    public CommonResult<ResourceFindResp> findResourceById(@RequestBody @Valid BaseIdReq req){
//
//        ResourceFindResp resp = resourceManagerService.findResourceById(req.getId());
//
//        return CommonResult.success(resp);
//    }
//
//
//    @PostMapping(path="/findResourceListByType")
//    public CommonResult<TaskResourceFindResp> findResourceListByType(@RequestBody @Valid ResourceQueryReq req){
//
//        TaskResourceFindResp ResourceFindResp = resourceManagerService.findResourceListByType(req);
//
//        return CommonResult.success(ResourceFindResp);
//    }
//
//
//
//    @PostMapping(path="/findResourceListForObjectByType")
//    public CommonResult<List> findResourceListForObjectByType(@RequestBody @Valid ResourceQueryReq req){
//
//        List resp = resourceManagerService.findResourceListForObjectByType(req);
//
//        return CommonResult.success(resp);
//    }

}
