package com.uas.platform.b2b.mobile.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.uas.platform.b2b.mobile.service.AddUserService;
import com.uas.platform.b2b.model.User;
import com.uas.platform.core.util.serializer.FlexJsonUtils;

@Controller("mobile.AddUserController")
@RequestMapping("/mobile/adduser")
public class AddUserController {

	@Autowired
	private AddUserService userService;

	/**
	 * 手机端增加人员
	 * 
	 * @param formStore
	 * @param dept
	 * @param role
	 * @param enuu
	 * @return
	 */
	@RequestMapping(value = "/user", method = RequestMethod.POST)
	@ResponseBody
	private ModelMap addUser(String formStore, String dept, String role, Long enuu) {
		User user = FlexJsonUtils.fromJson(formStore, User.class);
		return userService.addUser(user, dept, role, enuu);
	}
}
