the server responded with a status of 400

mybatis在insert一条信息,返回主键值:
**
insert into users (name, password) values (#{name},#{password});
**
在mapper的实现类中,insert方法返回类型为int:__
public int insert(User user);
angularjs前端接受数据:
app.controller('SignCtrl',function ($rootScope,$scope,$resource,$location) {

$scope.user={};
$scope.validUsername=true;

$scope.signup = function () {

    var userResource = $resource('auth/signup', {}, {add:{method:'POST',responseType:"application/json;charset=UTF-8"}});
    userResource.save({},$scope.user, function (res) {
        alert("signup success");
        var user = res.data;
        $rootScope.user.name=$scope.user.name;
        $location.path("/login");
    }, function (data) {
        alert("signup faliure");
    });
};

    然后报错Failed to load resource: the server responded with a status of 400 (Bad Request)
    百度了很多说法是前后端数据不匹配,但是不知道怎么改啊。大神求抱大腿!