Browse Source

Creo una interfaz para interactuar con el producto

master
vigliom 1 year ago
parent
commit
d944d4220c
3 changed files with 27 additions and 12 deletions
  1. +15
    -6
      .idea/workspace.xml
  2. +5
    -0
      src/main/java/com/jorpelu/ServicioDeProductos/ISercicioProducto.java
  3. +7
    -6
      src/main/java/com/jorpelu/ServicioDeProductos/Main.java

+ 15
- 6
.idea/workspace.xml View File

@ -4,10 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="d0e2ddd8-efdc-4dce-b0fd-07c7411e37c2" name="Changes" comment="innnit">
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<list default="true" id="d0e2ddd8-efdc-4dce-b0fd-07c7411e37c2" name="Changes" comment="Actualizo README.md borro Saludator.java">
<change afterPath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/ISercicioProducto.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/Saludator.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/Main.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -19,6 +19,7 @@
<list> <list>
<option value="spring-beans.schema" /> <option value="spring-beans.schema" />
<option value="Class" /> <option value="Class" />
<option value="Interface" />
</list> </list>
</option> </option>
</component> </component>
@ -84,7 +85,7 @@
<updated>1669234080818</updated> <updated>1669234080818</updated>
<workItem from="1669234082181" duration="4126000" /> <workItem from="1669234082181" duration="4126000" />
<workItem from="1669327599329" duration="2673000" /> <workItem from="1669327599329" duration="2673000" />
<workItem from="1669370939836" duration="2626000" />
<workItem from="1669370939836" duration="3002000" />
</task> </task>
<task id="LOCAL-00001" summary="innnit"> <task id="LOCAL-00001" summary="innnit">
<created>1669371969480</created> <created>1669371969480</created>
@ -93,7 +94,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1669371969480</updated> <updated>1669371969480</updated>
</task> </task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="Actualizo README.md borro Saludator.java">
<created>1669373591401</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1669373591401</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -112,6 +120,7 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="innnit" /> <MESSAGE value="innnit" />
<option name="LAST_COMMIT_MESSAGE" value="innnit" />
<MESSAGE value="Actualizo README.md borro Saludator.java" />
<option name="LAST_COMMIT_MESSAGE" value="Actualizo README.md borro Saludator.java" />
</component> </component>
</project> </project>

+ 5
- 0
src/main/java/com/jorpelu/ServicioDeProductos/ISercicioProducto.java View File

@ -0,0 +1,5 @@
package com.jorpelu.ServicioDeProductos;
public interface ISercicioProducto {
public Producto getProducto();
}

+ 7
- 6
src/main/java/com/jorpelu/ServicioDeProductos/Main.java View File

@ -6,12 +6,13 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
ApplicationContext appContext = new ClassPathXmlApplicationContext("beans.xml"); ApplicationContext appContext = new ClassPathXmlApplicationContext("beans.xml");
ServicioProductos servicioProductos = (ServicioProductos) appContext.getBean("productosService", ServicioProductos.class);
System.out.println("id: " + servicioProductos.getProductos().getId());
System.out.println("nombre: " + servicioProductos.getProductos().getNombre());
System.out.println("descripcion: : " + servicioProductos.getProductos().getDescripcion());
System.out.println("cantidad: " + servicioProductos.getProductos().getCantidad());
System.out.println("precio: " + servicioProductos.getProductos().getPrecio());
// ServicioProductos servicioProductos = (ServicioProductos) appContext.getBean("productosService", ServicioProductos.class);
ISercicioProducto servicioProductos = appContext.getBean(ISercicioProducto.class);
System.out.println("id: " + servicioProductos.getProducto().getId());
System.out.println("nombre: " + servicioProductos.getProducto().getNombre());
System.out.println("descripcion: : " + servicioProductos.getProducto().getDescripcion());
System.out.println("cantidad: " + servicioProductos.getProducto().getCantidad());
System.out.println("precio: " + servicioProductos.getProducto().getPrecio());
((ClassPathXmlApplicationContext) appContext).close(); ((ClassPathXmlApplicationContext) appContext).close();
} }
} }

Loading…
Cancel
Save