在超级账本作曲家中,我们必须在注释中指定参数和事务,编译器不应该忽略注释吗?这是如何工作的,为什么有必要在评论中这样做?
/**
* A temperature reading has been received for a shipment
* @param {org.acme.shipping.perishable.TemperatureReading}
temperatureReading - the TemperatureReading transaction
* @transaction
*/
function temperatureReading(temperatureReading) {
var shipment = temperatureReading.shipment;
console.log('Adding temperature ' + temperatureReading.centigrade + ' to shipment ' + shipment.$identifier);
if (shipment.temperatureReadings) {
shipment.temperatureReadings.push(temperatureReading);
} else {
shipment.temperatureReadings = [temperatureReading];
}
return getAssetRegistry('org.acme.shipping.perishable.Shipment')
.then(function (shipmentRegistry) {
// add the temp reading to the shipment
return shipmentRegistry.update(shipment);
});
}