Merge branch 'main' into 'develop'

Main

See merge request india/india_market_java!24
This commit is contained in:
Administrator
2024-04-30 16:19:23 +00:00
11 changed files with 75 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
stages:
# 构建
- build
- dockerize
- webhook
build:
@@ -37,6 +38,28 @@ build:
- mvn clean install -Dmaven.test.skip=true
- ls
- echo ">>>>>>Finish Building<<<<<<"
dockerize:
stage: dockerize
tags:
- hk2
dependencies:
- build
only:
- main
- develop
script:
- echo ">>>>>>Start Building Image<<<<<<"
- ls
- ls target
- echo $DOCKER_PASSWORD
- echo $CI_PIPELINE_ID
- docker build -t juyoutech/india_stock_market:latest .
- docker tag juyoutech/india_stock_market:latest juyoutech/india_stock_market:$CI_PIPELINE_ID
- docker tag juyoutech/india_stock_market:latest juyoutech/india_stock_market:$CI_COMMIT_BRANCH
- docker login -u juyoutech -p dckr_pat_8rg23IBA2kZMOCX4IJKApb8m5l8
- docker push juyoutech/india_stock_market:latest
- docker push juyoutech/india_stock_market:$CI_PIPELINE_ID
- docker push juyoutech/india_stock_market:$CI_COMMIT_BRANCH
webhook:
stage: webhook
only:

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM openjdk:8
RUN echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list \
&& echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/10no-check-valid
RUN apt-get update
#RUN apt-get install -y iputils-ping dnsutils vim net-tools --allow-unauthenticated
WORKDIR /app
COPY target/india_market_java.jar /app/app.jar
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
CMD ["docker-entrypoint.sh"]

21
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
export JAVA_OPTS="$JAVA_OPTS -XX:-OmitStackTraceInFastThrow \
-Dspring.redis.host=$REDIS_HOST \
-Dspring.redis.password=$REDIS_PASS \
-Dmarket.domain=$MARKET_HOST \
-Dspring.redis.port=$REDIS_PORT \
-Dspring.datasource.stock-market.url=jdbc:mysql://$MYSQL_HOST:$MYSQL_PORT/$MARKET_MYSQL_DB?useUnicode=true&autoReconnect=true&allowPublicKeyRetrieval=true&useSSL=true \
-Dspring.datasource.stock-market.username=$MYSQL_USER \
-Dspring.datasource.stock-market.password=$MYSQL_PASS \
-Dspring.datasource.stock.url=jdbc:mysql://$MYSQL_HOST:$MYSQL_PORT/$MYSQL_DB?useUnicode=true&autoReconnect=true&allowPublicKeyRetrieval=true&useSSL=true \
-Dspring.datasource.stock.username=$MYSQL_USER \
-Dspring.datasource.stock.password=$MYSQL_PASS
echo 'param:'$@
echo 'JAVA_OPTS:'$JAVA_OPTS
java $JAVA_OPTS -jar /app/app.jar $@
tail -f /dev/null

View File

@@ -20,7 +20,7 @@ import cn.stock.market.domain.basic.service.SiteArticleService;
import cn.stock.market.utils.ServerResponse;
@Controller
@RequestMapping({"/api/market/art/", "/api/hq/art/"})
@RequestMapping({"/market/api/market/art/","/market/api/market/art/","/api/market/art/", "/api/hq/art/"})
@Api(tags = "公告信息")
public class ArticleApiController extends BaseController {

View File

@@ -35,7 +35,7 @@ public class BTodayStockController {
@Autowired
private BtodayStockService btodayStockService;
@GetMapping("/api/bToday/kLine")
@GetMapping({"/market/api/bToday/kLine","/api/bToday/kLine"})
@ApiOperation(value = "股票详情K线图",httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name="exchange",value = "BSE或者NSE"),
@@ -140,7 +140,7 @@ public class BTodayStockController {
"fromredis: 标志是否来自 Redis 缓存false 表示不是", response = JSONObject.class),
})
@GetMapping("/api/bToday/stockDetail")
@GetMapping({"/market/api/bToday/stockDetail","/api/bToday/stockDetail"})
@EncryptFilter(decryptRequest = false)
public com.alibaba.fastjson.JSONObject getPriceChartCompanyPullView(
@RequestParam(value = "exchange") String exchange,

View File

@@ -25,7 +25,7 @@ import springfox.documentation.annotations.ApiIgnore;
* @created Dec 4, 2018 10:22:44 PM
*/
@RestController
@RequestMapping("/api/hq/")
@RequestMapping({"/market/api/hq/","/api/hq/"})
@ApiIgnore
public class InfoController {
@Value("${spring.application.name}")

View File

@@ -168,7 +168,7 @@ public class MoneyApiController {
"priceprevclose: 前一交易日的收盘价\n" +
"30DayAvg: 过去30天的平均", response = JSONObject.class),
})
@GetMapping("/api/market/money/getStockDetail")
@GetMapping({"/market/api/market/money/getStockDetail","/api/market/money/getStockDetail"})
@ResponseBody
@EncryptFilter(decryptRequest = false)
@@ -511,7 +511,7 @@ public class MoneyApiController {
@ApiResponse(code = 200, message = "" +
"股票推荐相关: top gainer", response = JSONObject.class),
})
@GetMapping("/api/market/money/getTopGainer")
@GetMapping({"/market/api/market/money/getTopGainer","/api/market/money/getTopGainer"})
@ResponseBody
@EncryptFilter(decryptRequest = false)
@@ -556,7 +556,7 @@ public class MoneyApiController {
@ApiResponse(code = 200, message = "" +
"股票推荐相关: TopLoser", response = JSONObject.class),
})
@GetMapping("/api/market/money/getTopLoser")
@GetMapping({"/market/api/market/money/getTopLoser","/api/market/money/getTopLoser"})
@ResponseBody
@EncryptFilter(decryptRequest = false)
@@ -609,7 +609,7 @@ public class MoneyApiController {
@ApiResponse(code = 200, message = "" +
"股票推荐相关: top active", response = JSONObject.class),
})
@GetMapping("/api/market/money/getTopActives")
@GetMapping({"/market/api/market/money/getTopActives","/api/market/money/getTopActives"})
@ResponseBody
@EncryptFilter(decryptRequest = false)
@@ -654,7 +654,7 @@ public class MoneyApiController {
@GetMapping("/api/market/money/history/kLine")
@GetMapping({"/market/api/market/money/history/kLine","/api/market/money/history/kLine"})
@ApiOperation(value = "获取kline的money数据源", notes = "获取kline的money数据源",response = StockHistoryResponse.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "symbol", value = "Stock symbol 对应的是NSEID 或者是BSEID", required = true, dataType = "String", paramType = "query"),

View File

@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -23,7 +24,7 @@ import java.net.URL;
public class MoneyProxyApiControl {
@RequestMapping(value = "/api/proxy/queryStockMoneyProxy",method = RequestMethod.GET)
@GetMapping({"/market/api/proxy/queryStockMoneyProxy","/api/proxy/queryStockMoneyProxy"})
public JSONObject queryStockByMoneyIdAndExchangeType(String scId,String exchangeType){
return stockByMoneyIdAndExchangeTypeFromHttp(scId,exchangeType);
}

View File

@@ -18,7 +18,7 @@ import cn.stock.market.domain.basic.service.SiteNewsService;
import cn.stock.market.utils.ServerResponse;
@Controller
@RequestMapping({"/api/market/news/", "/api/hq/news/"})
@RequestMapping({"/market/api/market/news/", "/market/api/hq/news/","/api/market/news/", "/api/hq/news/"})
@Api(tags="新闻资讯")
public class SiteNewsController {
private static final Logger log = LoggerFactory.getLogger(SiteNewsController.class);

View File

@@ -56,7 +56,7 @@ import springfox.documentation.annotations.ApiIgnore;
@Controller
@Api(value = "/StockApiController", tags = "股票行情")
@RequestMapping({"/api/market/stock/", "/api/hq/stock/"})
@RequestMapping({"/market/api/market/stock/", "/market/api/hq/stock/","/api/market/stock/", "/api/hq/stock/"})
public class StockApiController {
private static final Logger log = LoggerFactory.getLogger(StockApiController.class);

View File

@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@Api(value = "/TodayApiController", tags = "today股票行情")
@RequestMapping({"/api/market/today/"})
@RequestMapping({"/market/api/market/today/","/api/market/today/"})
public class TodayApiController {
@RequestMapping({"getTopGainers.do"})