package com.yuchen.saas.park.service.controller.basic;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;

import com.yuchen.saas.park.api.param.ApplyManageParkBindingSaveParam;
import com.yuchen.saas.park.api.vo.park.ApplyManageParkDetailVO;
import com.yuchen.saas.park.service.service.INestApplyManageParkBindingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 园区应用关系 前端控制器
 * </p>
 *
 * @author cxj
 * @since 2023-11-13
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(value = "园区应用关系", tags = "园区应用关系")
@RequestMapping("/nestApplyManageParkBinding")
public class NestApplyManageParkBindingController {
    @Resource
    private  INestApplyManageParkBindingService baseService;

    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "保存园区应用绑定关系", notes = "保存园区应用绑定关系")
    public R save(@Valid @RequestBody ApplyManageParkBindingSaveParam param) {
        return R.status(baseService.saveBinding(param));
    }

    @GetMapping("/bindingDetail")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "绑定详情", notes = "绑定详情")
    public R<ApplyManageParkDetailVO> bindingDetail(@ApiParam(value = "园区id") @RequestParam(value = "parkId")@NotNull Long parkId) {
        return R.data(baseService.bindingDetail(parkId));
    }

    /*@GetMapping("/listByApplyId")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "根据应用id获取绑定详情", notes = "根据应用id获取绑定详情")
    public R<List<NestApplyManageParkBinding>> listByApplyId(@ApiParam(value = "应用id") @RequestParam(value = "applyId") Long applyId) {
        return R.data(baseService.listByApplyId(applyId));
    }*/

}
