Skip to content

Commit

Permalink
update to tio-boot-v1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
litongjava committed Dec 21, 2023
1 parent 40e911c commit 0623ebf
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion paddle-ocr/paddle-ocr-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<lombok-version>1.18.30</lombok-version>
<hotswap-classloader.version>1.1.9</hotswap-classloader.version>
<final.name>ocr-server</final.name>
<main.class>com.litongjava.ai.server.padddle.ocr.OcrServer</main.class>
<main.class>com.litongjava.ai.server.padddle.ocr.PaddleOcrServer</main.class>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@ComponentScan
@Slf4j
public class OcrServer {
public class PaddleOcrServer {

public static void main(String[] args) throws Exception {

Expand All @@ -21,7 +21,7 @@ public static void main(String[] args) throws Exception {
downloadAndTest();
} else {
long start = System.currentTimeMillis();
TioApplication.run(OcrServer.class, args);
TioApplication.run(PaddleOcrServer.class, args);
long end = System.currentTimeMillis();
System.out.println("started:" + (end - start) + "(ms)");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.litongjava.ai.server.padddle.ocr.controller;

import com.litongjava.jfinal.aop.annotation.Controller;
import com.litongjava.tio.http.server.annotation.EnableCORS;
import com.litongjava.tio.http.server.annotation.RequestPath;

@EnableCORS
@Controller
@RequestPath(value = "/")
public class IndexController {
@RequestPath()
public String respText() {
return "paddle-ocr-server";
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
package com.litongjava.aio.server.tio.config;

import com.litongjava.ai.server.property.WhiserAsrProperties;
import com.litongjava.jfinal.aop.Aop;
import com.litongjava.jfinal.aop.annotation.Bean;
import com.litongjava.jfinal.aop.annotation.Configuration;
import com.litongjava.tio.boot.utils.Enviorment;
import com.litongjava.tio.utils.enviorment.EnviormentUtils;

import lombok.extern.slf4j.Slf4j;

@Configuration
@Slf4j
public class WhisperAsrConfig {

private Enviorment enviorment = Aop.get(Enviorment.class);

@Bean
public WhiserAsrProperties aiServiceProperties() {
WhiserAsrProperties aiServiceProperties = new WhiserAsrProperties();
String modelName = enviorment.get("model.name");
String modelName = EnviormentUtils.get("model.name");
if (modelName != null) {
log.info("modelName:{}", modelName);
aiServiceProperties.setModelName(modelName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import com.litongjava.jfinal.aop.Aop;
import com.litongjava.jfinal.aop.annotation.Controller;
import com.litongjava.tio.boot.annotation.EnableCORS;
import com.litongjava.tio.boot.utils.Enviorment;
import com.litongjava.tio.http.common.HttpRequest;
import com.litongjava.tio.http.common.HttpResponse;
import com.litongjava.tio.http.server.annotation.EnableCORS;
import com.litongjava.tio.http.server.annotation.RequestPath;
import com.litongjava.tio.http.server.util.Resps;
import com.litongjava.tio.utils.enviorment.EnviormentUtils;
import com.litongjava.tio.utils.resp.Resp;

@EnableCORS
Expand All @@ -16,9 +16,7 @@
public class EnviormentController {
@RequestPath("/{key}")
public HttpResponse get(String key, HttpRequest request) {
Enviorment enviorment = Aop.get(Enviorment.class);
System.out.println(enviorment.toString());
return Resps.json(request, Resp.ok(enviorment.get(key)));
return Resps.json(request, Resp.ok(EnviormentUtils.get(key)));
}

@RequestPath("/beans")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.litongjava.aio.server.tio.controller;

import com.litongjava.jfinal.aop.annotation.Controller;
import com.litongjava.tio.boot.annotation.EnableCORS;
import com.litongjava.tio.http.server.annotation.EnableCORS;
import com.litongjava.tio.http.server.annotation.RequestPath;

@EnableCORS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.util.Properties;

import com.litongjava.jfinal.aop.annotation.Controller;
import com.litongjava.tio.boot.annotation.EnableCORS;
import com.litongjava.tio.http.common.HttpRequest;
import com.litongjava.tio.http.common.HttpResponse;
import com.litongjava.tio.http.server.annotation.EnableCORS;
import com.litongjava.tio.http.server.annotation.RequestPath;
import com.litongjava.tio.http.server.util.Resps;
import com.litongjava.tio.utils.resp.Resp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import com.litongjava.ai.server.service.WhisperCppService;
import com.litongjava.jfinal.aop.Aop;
import com.litongjava.jfinal.aop.annotation.Controller;
import com.litongjava.tio.boot.annotation.EnableCORS;
import com.litongjava.tio.http.common.HttpRequest;
import com.litongjava.tio.http.common.HttpResponse;
import com.litongjava.tio.http.common.UploadFile;
import com.litongjava.tio.http.server.annotation.EnableCORS;
import com.litongjava.tio.http.server.annotation.RequestPath;
import com.litongjava.tio.http.server.util.Resps;
import com.litongjava.tio.utils.resp.Resp;
Expand Down

0 comments on commit 0623ebf

Please sign in to comment.