保存修改
This commit is contained in:
@@ -120,12 +120,12 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
||||
//校验token
|
||||
String cacheToken = LocalCacheUtils.getTokenCache(String.valueOf(principal.getId()));
|
||||
|
||||
if(StringUtils.isEmpty(cacheToken)){
|
||||
/*if(StringUtils.isEmpty(cacheToken)){
|
||||
throw new RuntimeException("TOKEN已过期,请重新登录!");
|
||||
}
|
||||
if(!cacheToken.equals(jwtToken) ){
|
||||
throw new RuntimeException("TOKEN已过期,请重新登录!");
|
||||
}
|
||||
}*/
|
||||
// UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(null, null);
|
||||
// SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||
}
|
||||
|
||||
@@ -17,21 +17,21 @@ public class AccountTask {
|
||||
private AccountService accountService;
|
||||
|
||||
/** 每周日晚上刷新 年付用户、月付用户的积分 */
|
||||
@Scheduled(cron = "59 59 23 ? * SUN")
|
||||
// @Scheduled(cron = "59 59 23 ? * SUN")
|
||||
// @Scheduled(cron = "59 59 23 * * ?")
|
||||
public void refreshCreditsMonthly(){
|
||||
log.info("每周日晚11:59:59刷新付费用户积分为 6000");
|
||||
accountService.refreshCreditsWeekly();
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
|
||||
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
|
||||
public void getPaidUser(){
|
||||
// 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单
|
||||
accountService.extendValidityForCC();
|
||||
}
|
||||
|
||||
// 每天凌晨0点执行一次
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
public void cancelActivityBenefits(){
|
||||
// 1、查询当前所有参与了活动且过期的用户
|
||||
List<Account> accountList = accountService.getExpiredUserBySystemUser(4);
|
||||
@@ -44,7 +44,7 @@ public class AccountTask {
|
||||
}
|
||||
|
||||
// 每天检测正式用户到期情况,每天凌晨0点执行
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
public void paidUserToVisitor(){
|
||||
// 1、查询当前已过期正式用户或试用用户
|
||||
List<Account> accountList = accountService.getExpiredUserBySystemUser(1);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PaypalTask {
|
||||
@Resource
|
||||
private PayPalCheckoutService payPalCheckoutService;
|
||||
|
||||
@Scheduled(cron = "0/30 * * * * ?")
|
||||
// @Scheduled(cron = "0/30 * * * * ?")
|
||||
public void orderConfirm() throws SerializeException {
|
||||
|
||||
// log.info("PayPal orderConfirm 被执行......");
|
||||
|
||||
@@ -22,7 +22,7 @@ public class StripeTask {
|
||||
@Resource
|
||||
private StripeService stripeService;
|
||||
|
||||
@Scheduled(cron = "0/30 * * * * ?")
|
||||
// @Scheduled(cron = "0/30 * * * * ?")
|
||||
public void orderConfirm() throws SerializeException {
|
||||
|
||||
// 查看超过30分钟以上仍未支付的订单 置为超时订单
|
||||
|
||||
31
src/main/java/com/ai/da/controller/TagsController.java
Normal file
31
src/main/java/com/ai/da/controller/TagsController.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.ai.da.controller;
|
||||
|
||||
|
||||
import com.ai.da.common.response.Response;
|
||||
import com.ai.da.mapper.primary.entity.Product;
|
||||
import com.ai.da.mapper.primary.entity.Tags;
|
||||
import com.ai.da.service.ProductService;
|
||||
import com.ai.da.service.TagsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@CrossOrigin //开放前端的跨域访问
|
||||
@Api(tags = "标签管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/tags")
|
||||
public class TagsController {
|
||||
|
||||
@Resource
|
||||
private TagsService tagsService;
|
||||
|
||||
@ApiOperation("获取标签")
|
||||
@GetMapping("/getTags")
|
||||
public Response<List<Tags>> getTags(@RequestParam("userInput") String userInput) {
|
||||
return Response.success(tagsService.getTags(userInput));
|
||||
}
|
||||
}
|
||||
153
src/main/resources/application-local.properties
Normal file
153
src/main/resources/application-local.properties
Normal file
@@ -0,0 +1,153 @@
|
||||
server.port=5567
|
||||
|
||||
spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.primary.jdbcUrl=jdbc:mysql://localhost:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.primary.driver-class-name=com.p6spy.engine.spy.P6SpyDriver
|
||||
#spring.datasource.primary.jdbcUrl=jdbc:p6spy:mysql://localhost:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.primary.username=root
|
||||
spring.datasource.primary.password=root
|
||||
#spring.datasource.primary.jdbcUrl=jdbc:p6spy:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.primary.username=aida_con
|
||||
#spring.datasource.primary.password=123456
|
||||
spring.datasource.hikari.max-lifetime=120000
|
||||
|
||||
#spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.primary.username=root
|
||||
#spring.datasource.primary.password=QWa998345
|
||||
|
||||
#spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.primary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.primary.username=aida_con
|
||||
#spring.datasource.primary.password=123456
|
||||
|
||||
spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new_style?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.secondary.username=aida_con
|
||||
spring.datasource.secondary.password=123456
|
||||
|
||||
#datasource
|
||||
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.url=jdbc:mysql://18.167.251.121:33008/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.jdbcUrl=jdbc:mysql://localhost:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.username=aida_con
|
||||
#spring.datasource.username=root
|
||||
#spring.datasource.password=123456
|
||||
#spring.datasource.password=root
|
||||
#spring.datasource.password=QWa998345
|
||||
|
||||
#security
|
||||
spring.security.jwtSecret=JWTSECRET
|
||||
spring.security.jwtTokenHeader=Authorization
|
||||
spring.security.jwtTokenPrefix=Bearer-
|
||||
## 24Сʱ
|
||||
spring.security.jwtExpiration=8640000000
|
||||
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
|
||||
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
||||
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\
|
||||
/api/product/**,/api/ali-pay/**,/api/order-info/**,/api/paypal/**,/api/credits/**,/api/inquiry/**,/api/tasks/**,/api/python/prepareForSR,/api/alipay-hk/**,/api/portfolio/**,\
|
||||
/api/message/**,/notification/**,/api/tags/**
|
||||
spring.security.authApi=/auth/login
|
||||
|
||||
|
||||
rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
|
||||
#mybatis
|
||||
mybatis-plus.global-config.banner=false
|
||||
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
|
||||
#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mybatis-plus.global-config.db-config.logic-delete-field=isDeleted
|
||||
mybatis-plus.global-config.db-config.logic-delete-value=1
|
||||
mybatis-plus.global-config.db-config.logic-not-delete-value=0
|
||||
mybatis-plus.global-config.db-config.performance-interceptor.format=true
|
||||
mybatis-plus.global-config.db-config.performance-interceptor.max-time=1000
|
||||
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
file.mac.path=~/file/
|
||||
file.linux.path=/workspace/home/aida/file/
|
||||
#linux服务器域名(预览和下载用)
|
||||
file.linuxDomain=https://www.aida.com.hk/download/
|
||||
file.windows.path=D:\\upload\\
|
||||
spring.servlet.multipart.max-file-size = 10MB
|
||||
spring.servlet.multipart.max-request-size= 10MB
|
||||
#访问python服务的ip(对应环境)
|
||||
#access.python.ip=http://43.198.80.117
|
||||
access.python.ip=http://18.167.251.121
|
||||
#access.python.ip=http://18.167.251.121:9991/
|
||||
access.python.port=9994
|
||||
access.python.generate_sr_port=9996
|
||||
#access.python.sr=http://18.167.251.121:9995
|
||||
access.python.address=http://18.167.251.121:9996
|
||||
|
||||
minio.endpoint=https://www.minio.aida.com.hk:12024
|
||||
minio.accessKey=admin
|
||||
minio.secretKey=Aidlab123123!
|
||||
minio.bucketName.clothing=aida-clothing
|
||||
minio.bucketName.mannequins=aida-mannequins
|
||||
minio.bucketName.results=aida-results
|
||||
minio.bucketName.sysImage=aida-sys-image
|
||||
minio.bucketName.users=aida-users
|
||||
minio.bucketName.collectionElement=aida-collection-element
|
||||
minio.bucketName.gradient=aida-gradient
|
||||
minio.bucketName.slogan=aida-slogan
|
||||
minio.bucketName.modifiedSketch=aida-modified-sketch
|
||||
redirect_url=http://18.167.251.121:7788
|
||||
|
||||
#spring.rabbitmq.host=127.0.0.1
|
||||
#spring.rabbitmq.port=5672
|
||||
#spring.rabbitmq.username=guest
|
||||
#spring.rabbitmq.password=guest
|
||||
#spring.rabbitmq.virtual-host=/
|
||||
|
||||
spring.rabbitmq.host=18.167.251.121
|
||||
spring.rabbitmq.port=5672
|
||||
spring.rabbitmq.username=rabbit
|
||||
spring.rabbitmq.password=123456
|
||||
spring.rabbitmq.virtual-host=/
|
||||
|
||||
#spring.redis.host=172.31.11.32
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.port=6379
|
||||
spring.redis.database=1
|
||||
#spring.redis.password=Aidlab
|
||||
spring.redis.lettuce.pool.max-active=8
|
||||
spring.redis.lettuce.pool.max-idle=8
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.pool.max-wait=5
|
||||
|
||||
redis.key.orderForGenerate=OrderForGenerate
|
||||
redis.key.generateCancelSet=GenerateCancelSet
|
||||
redis.key.generateExceptionMap=Generate:Exception
|
||||
redis.key.resultMap=ResultMap
|
||||
redis.key.orderForSR=OrderForSR
|
||||
redis.key.SRCancelSet=SRCancelSet
|
||||
redis.key.SRExceptionMap=SRExceptionMap
|
||||
redis.key.taskList=TaskList
|
||||
redis.key.credits.pre-deduction=Credits:PreDeduction
|
||||
redis.key.generateResult=Generate:Result
|
||||
redis.key.toProductImageResultKey=ToProductImage:Result
|
||||
redis.key.relightResultKey=Relight:Result
|
||||
redis.key.newPosted=LastViewNewPostedTime
|
||||
redis.key.maximumUserId=CodeCreate:MaximumUserId
|
||||
|
||||
aws.s3.accessKeyId=AKIAVD3OJIMF6UJFLSHZ
|
||||
aws.s3.secretKey=LNIwFFB27/QedtZ+Q/viVUoX9F5x1DbuM8N0DkD8
|
||||
aws.s3.regionName=ap-east-1
|
||||
|
||||
# 客服 customer service
|
||||
cs.max-customer-per-service: 2
|
||||
cs.welcome: Welcome! Any questions?
|
||||
cs.auto-reply-after-work: Sorry, we are all off, you can leave your questions and we will respond to you.
|
||||
cs.unified-service-name: Great Company
|
||||
cs.always-display-unified-service-name: true
|
||||
cs.service-down: Sorry, the service network is abnormal and disconnected
|
||||
|
||||
# RabbitMQ Exchange and Queue configurations
|
||||
rabbitmq.queues.generate=generate-queue-local
|
||||
rabbitmq.queues.sr=SR-queue-local
|
||||
rabbitmq.queues.srResult=SuperResolution-local
|
||||
rabbitmq.queues.generateResult=GenerateImage-local
|
||||
rabbitmq.queues.toProductImageResult=ToProductImage-local
|
||||
rabbitmq.queues.relightResult=Relight-local
|
||||
rabbitmq.exchange.generate=generate-exchange
|
||||
@@ -2,7 +2,7 @@
|
||||
#spring.profiles.active=test
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>application-prod<6F>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
spring.profiles.active=prod
|
||||
#spring.profiles.active=prod
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>application-dev<65>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
#spring.profiles.active=dev
|
||||
spring.profiles.active=local
|
||||
|
||||
221
src/test/java/com/ai/da/controller/ApplicationTest.java
Normal file
221
src/test/java/com/ai/da/controller/ApplicationTest.java
Normal file
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
package com.ai.da.controller;
|
||||
|
||||
import com.ai.da.AiDaApplication;
|
||||
import com.ai.da.common.utils.DateUtil;
|
||||
import com.ai.da.common.utils.PantoneUtils;
|
||||
import com.ai.da.common.utils.RedisUtil;
|
||||
import com.ai.da.model.vo.DesignItemDetailVO;
|
||||
import com.ai.da.service.DesignItemService;
|
||||
import com.ai.da.service.DesignService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.minio.MinioClient;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = AiDaApplication.class)
|
||||
public class ApplicationTest {
|
||||
|
||||
@Resource
|
||||
private DesignService designService;
|
||||
@Resource
|
||||
private DesignItemService designItemService;
|
||||
|
||||
@Autowired
|
||||
private MinioClient minioClient;
|
||||
|
||||
@Test
|
||||
public void testDesignDetail(){
|
||||
DesignItemDetailVO detail = designService.detail(32929L, 33130L);
|
||||
System.out.println(JSONObject.toJSON(detail));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDate(){
|
||||
String timeZone = "Asia/Shanghai";
|
||||
Date date = DateUtil.getByTimeZone(timeZone);
|
||||
|
||||
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of(timeZone));
|
||||
|
||||
System.out.println("date : " + date);
|
||||
|
||||
System.out.println("localdatetime : " + localDateTime);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPantone(){
|
||||
|
||||
int[] a1 = new int[]{161,23,41};
|
||||
int[] a2 = new int[]{244,222,222};
|
||||
System.out.println(Arrays.toString(PantoneUtils.rgbToHsv(a1)));
|
||||
System.out.println(Arrays.toString(PantoneUtils.rgbToHsv(a2)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLength(){
|
||||
String testString = "You look gorgeous!";
|
||||
String[] s = testString.split("\\s+");
|
||||
System.out.println(s.length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRgbToHsv(){
|
||||
int[] ints = PantoneUtils.rgbToHsv(new int[]{150, 147, 204});
|
||||
System.out.println(Arrays.toString(ints));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pngToSvg() throws TranscoderException {
|
||||
String pngImages = "D:\\download\\images\\result1.png";
|
||||
String svgImages = "D:\\download\\images\\result1.svg";
|
||||
|
||||
|
||||
try {
|
||||
FileInputStream fileInputStream = new FileInputStream(pngImages);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(svgImages);
|
||||
|
||||
Transcoder pngTranscoder = new PNGTranscoder();
|
||||
|
||||
TranscoderInput transcoderInput = new TranscoderInput(fileInputStream);
|
||||
|
||||
TranscoderOutput transcoderOutput = new TranscoderOutput(fileOutputStream);
|
||||
|
||||
pngTranscoder.transcode(transcoderInput,transcoderOutput);
|
||||
|
||||
fileInputStream.close();
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
System.out.println("转换完成");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pngToSvg2() throws IOException {
|
||||
String pngImages = "D:\\download\\images\\result_1.png";
|
||||
String svgImages = "D:\\download\\images\\result1.svg";
|
||||
|
||||
|
||||
File inputFile = new File(pngImages);
|
||||
BufferedImage bufferedImage = ImageIO.read(inputFile);
|
||||
|
||||
BufferedImage convertedImage = new BufferedImage(
|
||||
bufferedImage.getWidth(),
|
||||
bufferedImage.getHeight(),
|
||||
BufferedImage.TYPE_INT_RGB
|
||||
);
|
||||
|
||||
convertedImage.createGraphics().drawImage(bufferedImage,0,0,null);
|
||||
|
||||
// 创建SVG文档
|
||||
DOMImplementation domImpl = SVGDOMImplementation.getDOMImplementation();
|
||||
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
|
||||
Document document = domImpl.createDocument(svgNS, "svg", null);
|
||||
Element root = document.getDocumentElement();
|
||||
root.setAttributeNS(null, "width", String.valueOf(convertedImage.getWidth()));
|
||||
root.setAttributeNS(null, "height", String.valueOf(convertedImage.getHeight()));
|
||||
|
||||
// 转换为SVG代码
|
||||
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
|
||||
svgGenerator.drawImage(convertedImage, null, null);
|
||||
|
||||
svgGenerator.stream(root,);
|
||||
|
||||
boolean useCSS = true; // we want to use CSS style attributes
|
||||
Writer out = new OutputStreamWriter(Files.newOutputStream(Paths.get(svgImages)), StandardCharsets.UTF_8);
|
||||
svgGenerator.stream(out, useCSS);
|
||||
|
||||
String svgCode = svgGenerator.getRoot().toString();
|
||||
// .getSVGDocument().getRootElement().toString();
|
||||
FileUtils.writeStringToFile(new File(svgImages), svgCode, "UTF-8");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// new GongShiUtilTest().test4();
|
||||
String scg = "C:\\Users\\DELL\\Desktop\\WORD\\22.svg";
|
||||
File destFile=new File("C:\\Users\\DELL\\Desktop\\WORD\\22.png");
|
||||
if(!destFile.exists()){
|
||||
destFile.createNewFile();
|
||||
}
|
||||
FileInputStream inputStream = new FileInputStream(new File(scg));
|
||||
convertSvg2Png(inputStream,destFile);
|
||||
}
|
||||
|
||||
|
||||
public static void convertSvg2Png(InputStream in, File png) throws IOException, TranscoderException
|
||||
{
|
||||
OutputStream out = new FileOutputStream(png);
|
||||
out = new BufferedOutputStream(out);
|
||||
PNGTranscoder pngTranscoder = new PNGTranscoder();
|
||||
try {
|
||||
TranscoderInput input = new TranscoderInput(in);
|
||||
try {
|
||||
TranscoderOutput output = new TranscoderOutput(out);
|
||||
pngTranscoder.transcode(input, output);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void paint(Graphics2D g) throws IOException {
|
||||
File imageSrc = new File("D:\\download\\images\\result1.png");
|
||||
BufferedImage img = ImageIO.read(imageSrc);
|
||||
|
||||
g.drawImage(img,0,0,null);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
// Get a DOMImplementation.
|
||||
DOMImplementation domImpl =
|
||||
GenericDOMImplementation.getDOMImplementation();
|
||||
|
||||
// Create an instance of org.w3c.dom.Document.
|
||||
String svgNS = "http://www.w3.org/2000/svg";
|
||||
Document document = domImpl.createDocument(svgNS, "svg", null);
|
||||
|
||||
// Create an instance of the SVG Generator.
|
||||
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
|
||||
|
||||
// Ask the test to render into the SVG Graphics2D implementation.
|
||||
paint(svgGenerator);
|
||||
|
||||
// Finally, stream out SVG to the standard output using
|
||||
// UTF-8 encoding.
|
||||
boolean useCSS = true; // we want to use CSS style attributes
|
||||
Writer out = new OutputStreamWriter(Files.newOutputStream(Paths.get("D:\\download\\images\\result1.svg")), StandardCharsets.UTF_8);
|
||||
svgGenerator.stream(out, useCSS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
186
src/test/java/com/ai/da/controller/PgmIo.java
Normal file
186
src/test/java/com/ai/da/controller/PgmIo.java
Normal file
@@ -0,0 +1,186 @@
|
||||
package com.ai.da.controller;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A utility class for reading and writing PGM images. Methods use integers to represent unsigned bytes.
|
||||
* <p>
|
||||
* Does not fully conform to the PGM specification because currently there is no support for:
|
||||
* <ul>
|
||||
* <li>More than one image per file</li>
|
||||
* <li>Images with more than 256 shades of gray</li>
|
||||
* <li>Comments within the raster</li>
|
||||
* </ul>
|
||||
* github https://gist.github.com/armanbilge/3276d80030d1caa2ed7c#file-pgmio-java-L2
|
||||
*
|
||||
* @author Arman Bilge
|
||||
*/
|
||||
public final class PgmIo {
|
||||
|
||||
private static final String MAGIC = "P5";
|
||||
/**
|
||||
* Character indicating a comment.
|
||||
*/
|
||||
private static final char COMMENT = '#';
|
||||
/**
|
||||
* The maximum gray value.
|
||||
*/
|
||||
private static final int MAXVAL = 255;
|
||||
|
||||
/**
|
||||
* Reads a grayscale image from a file in PGM format.
|
||||
*
|
||||
* @param file the PGM file read from
|
||||
* @return two-dimensional byte array representation of the image
|
||||
* @throws IOException
|
||||
*/
|
||||
public static int[][] read(final File file) throws IOException {
|
||||
final BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file));
|
||||
try {
|
||||
if (!next(stream).equals(MAGIC))
|
||||
throw new IOException("File " + file + " is not a binary PGM image.");
|
||||
final int col = Integer.parseInt(next(stream));
|
||||
final int row = Integer.parseInt(next(stream));
|
||||
final int max = Integer.parseInt(next(stream));
|
||||
if (max < 0 || max > MAXVAL)
|
||||
throw new IOException("The image's maximum gray value must be in range [0, " + MAXVAL + "].");
|
||||
final int[][] image = new int[row][col];
|
||||
for (int i = 0; i < row; ++i) {
|
||||
for (int j = 0; j < col; ++j) {
|
||||
final int p = stream.read();
|
||||
if (p == -1)
|
||||
throw new IOException("Reached end-of-file prematurely.");
|
||||
else if (p < 0 || p > max)
|
||||
throw new IOException("Pixel value " + p + " outside of range [0, " + max + "].");
|
||||
image[i][j] = p;
|
||||
}
|
||||
}
|
||||
return image;
|
||||
} finally {
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the next whitespace-delimited string in a stream, ignoring any comments.
|
||||
*
|
||||
* @param stream the stream read from
|
||||
* @return the next whitespace-delimited string
|
||||
* @throws IOException
|
||||
*/
|
||||
private static String next(final InputStream stream) throws IOException {
|
||||
final List<Byte> bytes = new ArrayList<Byte>();
|
||||
while (true) {
|
||||
final int b = stream.read();
|
||||
|
||||
if (b != -1) {
|
||||
|
||||
final char c = (char) b;
|
||||
if (c == COMMENT) {
|
||||
int d;
|
||||
do {
|
||||
d = stream.read();
|
||||
} while (d != -1 && d != '\n' && d != '\r');
|
||||
} else if (!Character.isWhitespace(c)) {
|
||||
bytes.add((byte) b);
|
||||
} else if (bytes.size() > 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
final byte[] bytesArray = new byte[bytes.size()];
|
||||
for (int i = 0; i < bytesArray.length; ++i)
|
||||
bytesArray[i] = bytes.get(i);
|
||||
return new String(bytesArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a grayscale image to a file in PGM format.
|
||||
*
|
||||
* @param image a two-dimensional byte array representation of the image
|
||||
* @param file the file to write to
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void write(final int[][] image, final File file) throws IOException {
|
||||
write(image, file, MAXVAL);
|
||||
}
|
||||
|
||||
|
||||
public static void write(BufferedImage image, final File file) throws IOException {
|
||||
int[][] rgbArray = new int[image.getHeight()][image.getWidth()];
|
||||
for (int j = 0; j < image.getHeight(); j++) {
|
||||
for (int i = 0; i < image.getWidth(); i++) {
|
||||
int p = image.getRGB(i, j);
|
||||
int a = (p >> 24) & 0xff;
|
||||
int r = (p >> 16) & 0xff;
|
||||
int g = (p >> 8) & 0xff;
|
||||
int b = p & 0xff;
|
||||
int avg = (r + g + b) / 3;
|
||||
p = (a << 24) | (avg << 16) | (avg << 8) | avg;
|
||||
//newImg.setRGB(i, j, p);
|
||||
//image.setRGB(i, j, p);
|
||||
rgbArray[j][i] = avg;
|
||||
}
|
||||
}
|
||||
write(rgbArray, file);
|
||||
}
|
||||
|
||||
public static void write(File imageFile, final File file) throws IOException {
|
||||
try {
|
||||
BufferedImage bf = ImageIO.read(imageFile);
|
||||
write(bf, file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a grayscale image to a file in PGM format.
|
||||
*
|
||||
* @param image a two-dimensional byte array representation of the image
|
||||
* @param file the file to write to
|
||||
* @param maxval the maximum gray value
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void write(final int[][] image, final File file, final int maxval) throws IOException {
|
||||
if (maxval > MAXVAL)
|
||||
throw new IllegalArgumentException("The maximum gray value cannot exceed " + MAXVAL + ".");
|
||||
final BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file));
|
||||
try {
|
||||
stream.write(MAGIC.getBytes());
|
||||
stream.write("\n".getBytes());
|
||||
stream.write(Integer.toString(image[0].length).getBytes());
|
||||
stream.write(" ".getBytes());
|
||||
stream.write(Integer.toString(image.length).getBytes());
|
||||
stream.write("\n".getBytes());
|
||||
stream.write(Integer.toString(maxval).getBytes());
|
||||
stream.write("\n".getBytes());
|
||||
|
||||
for (int i = 0; i < image.length; i++) {
|
||||
for (int j = 0; j < image[0].length; j++) {
|
||||
final int p = image[i][j];
|
||||
if (p < 0 || p > maxval)
|
||||
throw new IOException("Pixel value " + p + " outside of range [0, " + maxval + "].");
|
||||
stream.write(image[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
//you can delete println
|
||||
System.out.println("PGM create successful, file name :" + file.getName() + "\nwidth:" + image[0].length + ",height:" + image.length);
|
||||
|
||||
} finally {
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
74
src/test/java/com/ai/da/controller/Server.java
Normal file
74
src/test/java/com/ai/da/controller/Server.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.ai.da.controller;
|
||||
|
||||
|
||||
import com.stripe.Stripe;
|
||||
import com.stripe.StripeClient;
|
||||
import com.stripe.exception.StripeException;
|
||||
import com.stripe.model.Customer;
|
||||
import com.stripe.model.PaymentIntent;
|
||||
import com.stripe.model.Product;
|
||||
import com.stripe.param.CustomerCreateParams;
|
||||
import com.stripe.param.PaymentIntentCreateParams;
|
||||
import com.stripe.param.ProductCreateParams;
|
||||
import com.stripe.param.PriceCreateParams;
|
||||
import com.stripe.model.Price;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
|
||||
public class Server {
|
||||
/*public static void main(String[] args) throws StripeException {
|
||||
Stripe.apiKey = "sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2";
|
||||
|
||||
ProductCreateParams productParams =
|
||||
ProductCreateParams.builder()
|
||||
.setName("Starter Subscription")
|
||||
.setDescription("$12/Month subscription")
|
||||
.build();
|
||||
Product product = Product.create(productParams);
|
||||
System.out.println("Success! Here is your starter subscription product id: " + product.getId());
|
||||
|
||||
PriceCreateParams params =
|
||||
PriceCreateParams
|
||||
.builder()
|
||||
.setProduct(product.getId())
|
||||
.setCurrency("usd")
|
||||
.setUnitAmount(1200L)
|
||||
.setRecurring(
|
||||
PriceCreateParams.Recurring
|
||||
.builder()
|
||||
.setInterval(PriceCreateParams.Recurring.Interval.MONTH)
|
||||
.build())
|
||||
.build();
|
||||
Price price = Price.create(params);
|
||||
System.out.println("Success! Here is your starter subscription price id: " + price.getId());
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
public static void main(String[] args) {
|
||||
StripeClient client = new StripeClient("sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2");
|
||||
CustomerCreateParams params =
|
||||
CustomerCreateParams
|
||||
.builder()
|
||||
.setDescription("Example description")
|
||||
.setEmail("test@example.com")
|
||||
.setPaymentMethod("pm_card_visa") // obtained via Stripe.js
|
||||
.build();
|
||||
|
||||
try {
|
||||
Customer customer = client.customers().create(params);
|
||||
System.out.println(customer);
|
||||
} catch (StripeException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
96
src/test/java/com/ai/da/controller/testS3.java
Normal file
96
src/test/java/com/ai/da/controller/testS3.java
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
package com.ai.da.controller;
|
||||
|
||||
import com.ai.da.common.constant.CommonConstant;
|
||||
import com.ai.da.common.response.Response;
|
||||
import com.ai.da.common.utils.MD5Utils;
|
||||
import com.ai.da.common.utils.S3Util;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
public class testS3 {
|
||||
|
||||
@Resource
|
||||
private S3Util s3Util;
|
||||
|
||||
@ApiOperation(value = "test1")
|
||||
@PostMapping("/test1")
|
||||
public Response<String> test1() {
|
||||
String bucketName = "aida-collection-element";
|
||||
String imageType = "png";
|
||||
String base64 = "iVBORw0KGgoAAAANSUhEUgAAAMMAAABPCAYAAABWDXEJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAbNSURBVHhe7ZrLTSRJFEVxARtwAR8wARvaBVZsWLBkBR60BW1BO4DEGg/woUYHRbRyUu/GLyOKoece6UmtojJ++U78qi9OxphPLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyGJOwDMYkLIMxCctg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AMxiQsgzEJy2DMJ6fTP087MrRzJGnPAAAAAElFTkSuQmCC";
|
||||
String s = s3Util.uploadImageFromBase64(bucketName, base64, imageType);
|
||||
log.info("s3Util.uploadImageFromBase64 测试成功");
|
||||
return Response.success(s);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "test2")
|
||||
@PostMapping("/test2")
|
||||
public Response<String> test2(@RequestParam("file") MultipartFile file) {
|
||||
String bucketName = "aida-users";
|
||||
String path = "87/tmp";
|
||||
String s = s3Util.upload(bucketName, path, file);
|
||||
log.info("s3Util.upload 测试成功");
|
||||
return Response.success(s);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "test3")
|
||||
@PostMapping("/test3")
|
||||
public Response<String> test3(@RequestParam("file") MultipartFile file) {
|
||||
String bucketName = "aida-users";
|
||||
String path = "87/tmp";
|
||||
String s = s3Util.upload(bucketName, path, file, "");
|
||||
log.info("s3Util.upload _ copy 测试成功");
|
||||
return Response.success(s);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "test4")
|
||||
@PostMapping("/test4")
|
||||
public Response<String> test4(@RequestParam("path") String path) {
|
||||
String s = MD5Utils.encryptFile(s3Util.download(path));
|
||||
log.info("s3Util.download 测试成功");
|
||||
return Response.success("图片MD5 :" + s);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "test5")
|
||||
@PostMapping("/test5")
|
||||
public Response<String> test5(@RequestParam("path") String path) {
|
||||
String s = s3Util.getPreSignedUrl(path, CommonConstant.MINIO_IMAGE_EXPIRE_TIME);
|
||||
log.info("s3Util.getPreSignedUrl 测试成功");
|
||||
return Response.success("S3 图片临时访问地址 :" + s);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "test6")
|
||||
@PostMapping("/test6")
|
||||
public Response<Boolean> test6(@RequestParam("bucketName") String bucketName,@RequestParam("objectName") String objectName) {
|
||||
boolean b = s3Util.doesObjectExist(bucketName, objectName);
|
||||
log.info("s3Util.doesObjectExist 测试成功");
|
||||
return Response.success(b);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "test7")
|
||||
@PostMapping("/test7")
|
||||
public Response<String> test7() {
|
||||
String bucketName = "aida-users";
|
||||
String path = "87/tmp";
|
||||
String base64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAABPCAYAAABWDXEJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAbNSURBVHhe7ZrLTSRJFEVxARtwAR8wARvaBVZsWLBkBR60BW1BO4DEGg/woUYHRbRyUu/GLyOKoece6UmtojJ++U78qi9OxphPLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyGJOwDMYkLIMxCctgTMIyLOb9/f308vJyur29PV1fX58uLi7+FTc3N6cfP36cfv78efr4+EhPma/g7DKQHPuEyHF1dZW+Nc7j42NYtorLy8s/CUnS0r4ZUA5lRnWWgmdapaDdURm1QEqeZax+/fp1WMLfv3+H9YyEYmYdlBVxdhnu7u7CBuZQDW2lV4YoSJQj7UCqqNzWQNCW+kdliIKVa7TPPBeVORKKmXWofp5dBmb/qIE5mBmPMEOGHJTVy8hqoIJZu8RMGXJQZu/qaBkG4OVGjdsGs+KRZXumDASzfCu1uvOWjNWR4N98Fn2X4G+lxFwhA0G9nGFasQwDRLNmtFL0vIg9KiFJagZhH3w/Othuo2WmpKzoWaKWXPxNSUHCK5QM9CkKxp9naqtzjtb3oPpOXVE7SqGYWYd6n2eTgdk+6gwDvv+slAA16Oy+PILBLMGqpRKyZXVQQvF5i0yMjypDtV3J0AJtYuxrYtTGDVSi8i5mcY46ziZDlPQc2mD/OdGSQBGjMoA6+NbkjPpGINfr62v6Vh2+G5Wj6j8iw5bSgZ8+1LatlqGTaNbLyzBS7P822skjMqjVqyZD1H5ipA/72zbGTa1Ms2SA0nmu1g/L0AGzfNSRPONEM+vobw5HZ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BMyqxcrQMemmrkYN6SH6iVid/L6Gep60qeKYkfA5EaFnRgDGMyqCuqA2lYAwjVB08M4spMjB7RLNi7WW2QNn7cgm1fDM40fePBMnTSosQLUGdtVlZyXA0WC1aRQCVqCOhcubbyKASQFnei7rliJJltgyl84mCVUttmVqChGjZnqyQgRW+pe4tlmFD9FJIhlmoH7aiA+0sGegTL2AUEkptHVUwI/dMIDNlYMIZ7a9lSKg7eXUdOEp00Iu2L6My8BJoM4IdPedsQQoSnGSL9urUy+qjzkAljsiQ+0vbeleCPZbBmL8My2BMwjIYk7AMxiQsgzEJy2BMwjIYk7AMxiQsgzEJy2BMwjIYk7AMxiQsgzEJy2BMwjIYk7AMxiQsgzEJy2DMJ6fTP087MrRzJGnPAAAAAElFTkSuQmCC";
|
||||
String s = s3Util.base64UploadToPath(base64, bucketName, path);
|
||||
log.info("s3Util.base64UploadToPath 测试成功");
|
||||
return Response.success(s);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "test8")
|
||||
@PostMapping("/test8")
|
||||
public Response<String> test8(@RequestParam("path") String path) {
|
||||
s3Util.deleteObject(path);
|
||||
log.info("s3Util.deleteObject 测试成功");
|
||||
return Response.success(null);
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,77 +0,0 @@
|
||||
{
|
||||
"groups": [
|
||||
{
|
||||
"name": "file",
|
||||
"type": "com.ai.da.common.config.FileProperties",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties"
|
||||
},
|
||||
{
|
||||
"name": "file.linux",
|
||||
"type": "com.ai.da.common.config.FileProperties$ElPath",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties",
|
||||
"sourceMethod": "getLinux()"
|
||||
},
|
||||
{
|
||||
"name": "file.mac",
|
||||
"type": "com.ai.da.common.config.FileProperties$ElPath",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties",
|
||||
"sourceMethod": "getMac()"
|
||||
},
|
||||
{
|
||||
"name": "file.sys",
|
||||
"type": "com.ai.da.common.config.FileProperties$ElPath",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties",
|
||||
"sourceMethod": "getSys()"
|
||||
},
|
||||
{
|
||||
"name": "file.windows",
|
||||
"type": "com.ai.da.common.config.FileProperties$ElPath",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties",
|
||||
"sourceMethod": "getWindows()"
|
||||
},
|
||||
{
|
||||
"name": "spring.security",
|
||||
"type": "com.ai.da.common.security.config.SecurityProperties",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "file.linux-domain",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.config.FileProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.security.auth-api",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.security.ignore-paths",
|
||||
"type": "java.lang.String[]",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.security.jwt-expiration",
|
||||
"type": "java.lang.Long",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"name": "spring.security.jwt-secret",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.security.jwt-token-header",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.security.jwt-token-prefix",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.ai.da.common.security.config.SecurityProperties"
|
||||
}
|
||||
],
|
||||
"hints": []
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
server.port=5566
|
||||
|
||||
#datasource
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=QWa998345
|
||||
|
||||
#security
|
||||
spring.security.jwtSecret=JWTSECRET
|
||||
spring.security.jwtTokenHeader=Authorization
|
||||
spring.security.jwtTokenPrefix=Bearer-
|
||||
## 24Сʱ
|
||||
spring.security.jwtExpiration=8640000000
|
||||
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
|
||||
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
||||
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**
|
||||
spring.security.authApi=/auth/login
|
||||
|
||||
|
||||
rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
|
||||
#mybatis
|
||||
mybatis-plus.global-config.banner=false
|
||||
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
|
||||
#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
file.mac.path=~/file/
|
||||
file.linux.path=/workspace/home/aida/file/
|
||||
#linux服务器域名(预览和下载用)
|
||||
file.linuxDomain=https://www.aida.com.hk/download/
|
||||
file.windows.path=D:\\upload\\
|
||||
spring.servlet.multipart.max-file-size = 5MB
|
||||
spring.servlet.multipart.max-request-size= 5MB
|
||||
#访问python服务的ip(对应环境)
|
||||
access.python.ip=http://43.198.80.117
|
||||
@@ -1,44 +0,0 @@
|
||||
server.port=5567
|
||||
|
||||
#datasource
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://18.167.251.121:33006/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
|
||||
#security
|
||||
spring.security.jwtSecret=JWTSECRET
|
||||
spring.security.jwtTokenHeader=Authorization
|
||||
spring.security.jwtTokenPrefix=Bearer-
|
||||
## 24Сʱ
|
||||
spring.security.jwtExpiration=8640000000
|
||||
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
|
||||
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
||||
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**
|
||||
spring.security.authApi=/auth/login
|
||||
|
||||
|
||||
rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
|
||||
#mybatis
|
||||
mybatis-plus.global-config.banner=false
|
||||
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
|
||||
#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
file.mac.path=~/file/
|
||||
file.linux.path=/workspace/home/aida/file/
|
||||
#linux服务器域名(预览和下载用)
|
||||
file.linuxDomain=http://18.162.111.141:5568/download/
|
||||
file.windows.path=D:\\upload\\
|
||||
|
||||
spring.servlet.multipart.max-file-size = 5MB
|
||||
spring.servlet.multipart.max-request-size= 5MB
|
||||
|
||||
#访问python服务的ip(对应环境)
|
||||
access.python.ip=http://18.167.251.121
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#<23><><EFBFBD><EFBFBD>application-test<73>ļ<EFBFBD>(<28><><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>)
|
||||
#spring.profiles.active=test
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>application-prod<6F>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
spring.profiles.active=test
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user