mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 17:45:10 +00:00
se soluciono un error donde Asset era un .Java en lugar de un .java
This commit is contained in:
parent
7649753506
commit
97d1c87af5
6 changed files with 27 additions and 24 deletions
|
|
@ -11,7 +11,7 @@ plugins {
|
|||
|
||||
}
|
||||
ext {
|
||||
javaMainClass = "application.java.App"
|
||||
javaMainClass = "application.java.App"
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
|
@ -30,16 +30,14 @@ java {
|
|||
languageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs = ['application-gateway-java/src/main/java']
|
||||
srcDirs = ['src/main/java']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
// Define the main class for the application.
|
||||
mainClass = 'App'
|
||||
mainClass = 'application.java.App'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package models;
|
||||
|
||||
class Asset {
|
||||
public class Asset {
|
||||
private String id;
|
||||
private String owner;
|
||||
private String prescripcionAnteriorId;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.code.hyperledger;
|
||||
|
||||
|
||||
//import com.code.hyperledger.coso.Asset;
|
||||
import com.code.hyperledger.coso.Asset;
|
||||
import org.hyperledger.fabric.gateway.*;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
|
@ -179,7 +179,7 @@ public final class App {
|
|||
private void createAsset() throws EndorseException, SubmitException, CommitStatusException, CommitException {
|
||||
System.out.println("\n--> Submit Transaction: CreateAsset, creates new asset with all arguments");
|
||||
|
||||
/*Asset asset = new Asset(
|
||||
Asset asset = new Asset(
|
||||
assetId,
|
||||
"Tom",
|
||||
"presc456",
|
||||
|
|
@ -216,7 +216,7 @@ public final class App {
|
|||
asset.getFechaDeAutorizacion().toString(),
|
||||
Integer.toString(asset.getCantidad()),
|
||||
asset.getExpectedSupplyDuration().toString()
|
||||
);*/
|
||||
);
|
||||
|
||||
System.out.println("*** Transaction committed successfully");
|
||||
}
|
||||
|
|
@ -263,10 +263,10 @@ public final class App {
|
|||
* responses from the smart contract.
|
||||
*/
|
||||
private void updateNonExistentAsset() {
|
||||
//try {
|
||||
try {
|
||||
System.out.println("\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error");
|
||||
|
||||
/*Asset asset = new Asset(
|
||||
Asset asset = new Asset(
|
||||
"asset70", // Asset ID
|
||||
"Tomoko", // Owner
|
||||
"presc789", // Prescripcion Anterior Id
|
||||
|
|
@ -324,6 +324,6 @@ public final class App {
|
|||
e.printStackTrace(System.out);
|
||||
System.out.println("Transaction ID: " + e.getTransactionId());
|
||||
System.out.println("Status code: " + e.getCode());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.code.main.controllers;
|
||||
package com.code.hyperledger.controllers;
|
||||
|
||||
import com.code.hyperledger.coso.Asset;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -8,6 +9,8 @@ public class Example {
|
|||
|
||||
@GetMapping("/hello")
|
||||
public String sayHello() {
|
||||
Asset asset = new Asset();
|
||||
|
||||
return "Hello, World!";
|
||||
}
|
||||
}
|
||||
|
|
@ -5,9 +5,11 @@ import java.time.LocalDateTime;
|
|||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Asset {
|
||||
private String id;
|
||||
private String owner;
|
||||
Loading…
Reference in a new issue