package com.persagy.adm.server.custom.controller;

import com.persagy.adm.server.custom.common.AdmRequest;
import com.persagy.adm.server.custom.service.ISyncSpace;
import com.persagy.dmp.common.model.response.CommonResult;
import com.persagy.dmp.common.utils.ResultHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/manage")
public class ManageController {
	@Autowired
	private ISyncSpace syncSpace;
	@RequestMapping("/syncSpace")
	public CommonResult<Object> syncSpace(@RequestBody AdmRequest req){
		Map<String, Object> syncResult = syncSpace.sync(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getFloorId(), "GeneralZone");
		return ResultHelper.single(syncResult);
	}

}
