package kr.wisestone.owl.web.controller;
|
|
import kr.wisestone.owl.constant.Constants;
|
import kr.wisestone.owl.service.UserWorkspaceService;
|
import kr.wisestone.owl.web.condition.UserWorkspaceCondition;
|
import kr.wisestone.owl.web.form.UserWorkspaceForm;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.data.domain.Pageable;
|
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-10-02.
|
*/
|
@Controller
|
public class UserWorkspaceController extends BaseController {
|
|
@Autowired
|
private UserWorkspaceService userWorkspaceService;
|
|
|
// 업무공간에 참여하는 사용자 조회
|
@RequestMapping(value = "/userWorkspace/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
public
|
@ResponseBody
|
Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) {
|
Map<String, Object> resJsonData = new HashMap<String, Object>();
|
Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params));
|
|
this.userWorkspaceService.findUserWorkspace(resJsonData, UserWorkspaceCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable);
|
|
return this.setSuccessMessage(resJsonData);
|
}
|
|
// 업무공간에 참여하는 참여자 상태 수정
|
@RequestMapping(value = "/userWorkspace/modify", 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.userWorkspaceService.modifyUserWorkspace(UserWorkspaceForm.make(params.get(Constants.REQ_KEY_CONTENT)));
|
|
return this.setSuccessMessage(resJsonData);
|
}
|
|
}
|