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/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
public
|
@ResponseBody
|
Map<String, Object> find() {
|
Map<String, Object> 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<String, Object> out(@RequestBody Map<String, Map<String, Object>> params) {
|
Map<String, Object> 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<String, Object> findPrimaryWorkspace() {
|
Map<String, Object> 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<String, Object> findMyWorkspace() {
|
Map<String, Object> 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<String, Object> modify(@RequestBody Map<String, Map<String, Object>> params) {
|
Map<String, Object> 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<String, Object> checkUseWorkspace() {
|
Map<String, Object> resJsonData = new HashMap<>();
|
this.workspaceService.checkUseWorkspace();
|
return this.setSuccessMessage(resJsonData);
|
}
|
}
|