package com.fdkankan.scene.controller;


import com.fdkankan.common.controller.BaseController;
import com.fdkankan.common.response.ResultData;
import com.fdkankan.scene.service.IFolderService;
import com.fdkankan.scene.vo.FolderParamVO;
import java.util.List;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 文件夹表 前端控制器
 * </p>
 *
 * @author dengsixing
 * @since 2021-12-24
 */
@RestController
@RequestMapping("/service/scene/folder")
public class FolderController extends BaseController {

    @Autowired
    private IFolderService folderService;

    /**
     * <p>
     新增文件夹
     * </p>
     * @author dengsixing
     * @date 2022/3/8
     * @param param
     * @return Result
     **/
    @RequestMapping(value = "/save", method = RequestMethod.POST)
//    @ApiImplicitParams({
//        @ApiImplicitParam(name = "name", value = "文件夹名称", dataType = "String"),
//        @ApiImplicitParam(name = "type", value = "文件夹类型，0我的场景，1协作场景", dataType = "String"),
//        @ApiImplicitParam(name = "parentId", value = "上层文件夹id", dataType = "String")})
    public ResultData save(@RequestBody @Validated FolderParamVO param){
        Long userId = this.getUserId();
        param.setUserId(userId);
        return folderService.save(param);
    }


}

