Расфасовано по папкам
This commit is contained in:
parent
3bea45850b
commit
5343479239
@ -1,4 +1,4 @@
|
||||
package com.example.springip.controllers;
|
||||
package com.example.springip.lab1.controllers;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
@ -1,6 +1,6 @@
|
||||
package com.example.springip.controllers;
|
||||
package com.example.springip.lab2.controllers;
|
||||
|
||||
import com.example.springip.service.OperationService;
|
||||
import com.example.springip.lab2.service.OperationService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
@ -1,4 +1,4 @@
|
||||
package com.example.springip.domains;
|
||||
package com.example.springip.lab2.domains;
|
||||
|
||||
public interface OperationInterface<T> {
|
||||
T sum(T o,T o2);
|
@ -1,11 +1,10 @@
|
||||
package com.example.springip.domains;
|
||||
package com.example.springip.lab2.domains;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.example.springip.lab2.domains.OperationInterface;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component(value = "num")
|
||||
public class OperationNumImpl implements OperationInterface<Integer>{
|
||||
public class OperationNumImpl implements OperationInterface<Integer> {
|
||||
@Override
|
||||
public Integer sum(Integer o, Integer o2) {
|
||||
return o + o2;
|
@ -1,9 +1,10 @@
|
||||
package com.example.springip.domains;
|
||||
package com.example.springip.lab2.domains;
|
||||
|
||||
import com.example.springip.lab2.domains.OperationInterface;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component(value = "str")
|
||||
public class OperationStringImpl implements OperationInterface<String>{
|
||||
public class OperationStringImpl implements OperationInterface<String> {
|
||||
@Override
|
||||
public String sum(String o, String o2) {
|
||||
return o+o2;
|
@ -1,7 +1,6 @@
|
||||
package com.example.springip.service;
|
||||
package com.example.springip.lab2.service;
|
||||
|
||||
import com.example.springip.domains.OperationInterface;
|
||||
import com.example.springip.domains.OperationNumImpl;
|
||||
import com.example.springip.lab2.domains.OperationInterface;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
Loading…
Reference in New Issue
Block a user