package kr.wisestone.owl.web.controller; import kr.wisestone.owl.constant.Constants; import kr.wisestone.owl.domain.Workspace; import kr.wisestone.owl.service.WorkspaceService; import kr.wisestone.owl.web.form.UserInviteForm; import kr.wisestone.owl.web.form.WorkspaceForm; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; 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.ResponseBody; import java.util.HashMap; import java.util.Map; /** * Created by wisestone on 2018-03-12. */ @Controller public class WorkspaceController extends BaseController { @Autowired private WorkspaceService workspaceService; // 사용자 등급 조회 @RequestMapping(value = "/workspace/levelFind", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map levelFind() { Map resJsonData = new HashMap<>(); this.workspaceService.find(resJsonData); //this.workspaceService.levelFind(resJsonData); return this.setSuccessMessage(resJsonData); } // 부서 조회 @RequestMapping(value = "/workspace/departmentFind", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map departmentFind() { Map resJsonData = new HashMap<>(); this.workspaceService.find(resJsonData); //this.workspaceService.departmentFind(resJsonData); return this.setSuccessMessage(resJsonData); } // 사용자 관리 조회 @RequestMapping(value = "/workspace/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map find() { Map resJsonData = new HashMap<>(); this.workspaceService.find(resJsonData); return this.setSuccessMessage(resJsonData); } // 업무 공간 추방 @RequestMapping(value = "/workspace/out", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map out(@RequestBody Map> params) { Map resJsonData = new HashMap<>(); this.workspaceService.out(WorkspaceForm.make(params.get(Constants.REQ_KEY_CONTENT))); return this.setSuccessMessage(resJsonData); } // Primary 업무 공간 정보 @RequestMapping(value = "/workspace/findPrimaryWorkspace", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map findPrimaryWorkspace() { Map resJsonData = new HashMap<>(); this.workspaceService.findPrimaryWorkspace(resJsonData); return this.setSuccessMessage(resJsonData); } // 자신이 관리하는 업무 공간 정보 @RequestMapping(value = "/workspace/findMyWorkspace", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map findMyWorkspace() { Map resJsonData = new HashMap<>(); this.workspaceService.findMyWorkspace(resJsonData); return this.setSuccessMessage(resJsonData); } // 업무공간 이름 변경 @RequestMapping(value = "/workspace/modify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map modify(@RequestBody Map> params) { Map resJsonData = new HashMap<>(); this.workspaceService.modifyWorkspace(WorkspaceForm.make(params.get(Constants.REQ_KEY_CONTENT))); return this.setSuccessMessage(resJsonData); } // 업무 공간 참여 여부 확인 - 대시보드 이미지 다운로드에서 사용 @RequestMapping(value = "/workspace/checkUseWorkspace", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Map checkUseWorkspace() { Map resJsonData = new HashMap<>(); this.workspaceService.checkUseWorkspace(); return this.setSuccessMessage(resJsonData); } }