|
@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* Created by weiqinxiao on 2019/2/25.
|
|
|
*/
|
|
@@ -23,6 +25,18 @@ public class UserController {
|
|
|
return userService.register(userModel);
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/batchRegister", method = RequestMethod.POST)
|
|
|
+ public Object register(@RequestBody List<UserModel> userModels){
|
|
|
+ userModels.forEach(e->{
|
|
|
+ try {
|
|
|
+ userService.register(e);
|
|
|
+ } catch (Exception e1) {
|
|
|
+ e1.printStackTrace();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
public Object update(@RequestBody UserModel userModel) throws Exception {
|
|
|
return userService.update(userModel);
|