我有一个功能,
var findUserDevice = function(userDeviceId){
var device = db.DeviceUser.find({
where: {
id: userDeviceId
}
}).then(function(device) {
if (!device) {
return 'not find';
}
return device.dataValues;
});
};
Run Code Online (Sandbox Code Playgroud)
但是这个功能不会返回任何东西......
var UserDevice = findUserDevice(req.body.deviceUserId);
console.log(UserDevice);// undefined
Run Code Online (Sandbox Code Playgroud) 我有界面
public interface Arithmetic {
Object sum(Object o);
}
Run Code Online (Sandbox Code Playgroud)
我需要在Matrix类中分配一个sum函数
public class Matrix implements Arithmetic{
int[][] data;
public Matrix ...
public Object sum(Object o){
// then I have to add two matrix
}
}
Run Code Online (Sandbox Code Playgroud)
请告诉我如何在第一个矩阵类型为int [] []时添加两个矩阵,而第二个类型为Object