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