From 2e224ec0aa7f4c633687d1251b521c6c8f5ad587 Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Sun, 4 Feb 2024 14:03:05 +0800 Subject: [PATCH] update --- .../core/BinomialWebController.java | 38 ++++++++++ .../springboot/AutoConfigurationWrapper.java | 69 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 io.sc.engine.mv/src/main/java/io/sc/engine/mv/controller/core/BinomialWebController.java create mode 100644 io.sc.platform.developer/src/main/java/io/sc/platform/developer/wrapper/springboot/AutoConfigurationWrapper.java diff --git a/io.sc.engine.mv/src/main/java/io/sc/engine/mv/controller/core/BinomialWebController.java b/io.sc.engine.mv/src/main/java/io/sc/engine/mv/controller/core/BinomialWebController.java new file mode 100644 index 00000000..54be5849 --- /dev/null +++ b/io.sc.engine.mv/src/main/java/io/sc/engine/mv/controller/core/BinomialWebController.java @@ -0,0 +1,38 @@ +package io.sc.engine.mv.controller.core; + +import io.sc.engine.mv.jpa.entity.CoeBinomialHistory; +import io.sc.engine.mv.jpa.repository.CoeBinomialHistoryRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.ExampleMatcher; +import org.springframework.data.domain.ExampleMatcher.StringMatcher; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +@Controller +@RequestMapping("/mv/coe/binomial") +public class BinomialWebController { + @Autowired private CoeBinomialHistoryRepository coeBinomialHistoryRepository; + + @RequestMapping(value="isc/fetch",method=RequestMethod.GET) + @ResponseBody + public List iscFetch(CoeBinomialHistory history){ + return fetch(history); + } + + @RequestMapping(value="fetch",method=RequestMethod.GET) + @ResponseBody + public List fetch(CoeBinomialHistory history){ + ExampleMatcher matcher = ExampleMatcher.matching() + .withIgnoreNullValues() + .withIgnoreCase() + .withStringMatcher(StringMatcher.CONTAINING); + Example example = Example.of(history, matcher); + List result =coeBinomialHistoryRepository.findAll(example); + return result; + } +} diff --git a/io.sc.platform.developer/src/main/java/io/sc/platform/developer/wrapper/springboot/AutoConfigurationWrapper.java b/io.sc.platform.developer/src/main/java/io/sc/platform/developer/wrapper/springboot/AutoConfigurationWrapper.java new file mode 100644 index 00000000..003c59b0 --- /dev/null +++ b/io.sc.platform.developer/src/main/java/io/sc/platform/developer/wrapper/springboot/AutoConfigurationWrapper.java @@ -0,0 +1,69 @@ +package io.sc.platform.developer.wrapper.springboot; + +public class AutoConfigurationWrapper { + private String context; + private String name; + private PositiveAndNegativeType positiveAndNegativeType; + private MatchedAndNotMatchedType matchedAndNotMatchedType; + private String condition; + private String message; + + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PositiveAndNegativeType getPositiveAndNegativeType() { + return positiveAndNegativeType; + } + + public void setPositiveAndNegativeType(PositiveAndNegativeType positiveAndNegativeType) { + this.positiveAndNegativeType = positiveAndNegativeType; + } + + public MatchedAndNotMatchedType getMatchedAndNotMatchedType() { + return matchedAndNotMatchedType; + } + + public void setMatchedAndNotMatchedType(MatchedAndNotMatchedType matchedAndNotMatchedType) { + this.matchedAndNotMatchedType = matchedAndNotMatchedType; + } + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static enum PositiveAndNegativeType{ + Positive, + Negative + } + + public static enum MatchedAndNotMatchedType{ + Matched, + NotMatched + } +}