ResourceController.java 932 Bytes
package com.bsth.controller.sys;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.bsth.controller.BaseController;
import com.bsth.entity.sys.Resource;
import com.bsth.service.sys.ResourceService;

@RestController
@RequestMapping("resource")
public class ResourceController extends BaseController<Resource, Integer>{
	
	@Autowired
	ResourceService resourceService;
	
	@RequestMapping(value = "/batch", method = RequestMethod.POST)
	public Map<String, Object> save(@RequestParam String array){
		return resourceService.saveList(JSON.parseArray(array, Resource.class));
	}
}