parent
a70b362410
commit
b649967128
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="远程mysql数据库" uuid="8a8ed4eb-9b24-489c-b26e-b4705aafb513">
|
||||
<driver-ref>mysql.8</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<imported>true</imported>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://47.122.61.54:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
package com.gary.exercise.config;
|
||||
|
||||
import cn.hutool.core.io.resource.ClassPathResource;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
*定义文件的路径和地址
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix ="excel" )
|
||||
public class FileConfig {
|
||||
private final String fileName="exercise.xlsx";
|
||||
private final String sheetNumber="Sheet1";
|
||||
private final String filePath=new ClassPathResource(fileName).getFile().getAbsolutePath();
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.gary.exercise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*用来描述比赛事件 统一返回格式
|
||||
*/
|
||||
@Data
|
||||
public class GameEvent {
|
||||
|
||||
private String classMessage;//节数信息
|
||||
LeftTime time;//剩余时间
|
||||
ActionDto lakerActionDto;//湖人队动作
|
||||
|
||||
ActionDto wolvesActionDto;//森林狼队动作
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.gary.exercise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*个人得分统计
|
||||
*/
|
||||
@Data
|
||||
public class Human {
|
||||
private String name; //姓名
|
||||
private int points; // 得分
|
||||
private int rebounds; // 篮板
|
||||
private int assists; // 助攻
|
||||
private int blocks; // 盖帽
|
||||
private int steals; // 抢断
|
||||
private int fouls; // 犯规
|
||||
private int twoPoints; // 2分球数
|
||||
private int threePoints; // 3分球数
|
||||
private int freeThrows; // 罚球数
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.gary.exercise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*用来描述比赛剩余时间
|
||||
*/
|
||||
@Data
|
||||
public class LeftTime {
|
||||
|
||||
int minute;
|
||||
|
||||
int second;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.gary.exercise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScoreDto {
|
||||
|
||||
private int laker_score;//湖人对比分
|
||||
private int wolf_score;//森林狼队比分
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
server:
|
||||
port: 9090
|
||||
|
||||
|
||||
# 数据库
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://47.122.61.54:3306/nba_visualization?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
|
||||
username: root
|
||||
password: GHLgjw168168+
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
hikari:
|
||||
max-lifetime: 27000000 # 7.5 小时(毫秒)
|
||||
|
||||
|
Binary file not shown.
@ -1,27 +1,28 @@
|
||||
package com.gary.exercise;
|
||||
|
||||
import cn.hutool.core.io.resource.ClassPathResource;
|
||||
import com.gary.exercise.service.ExerciseService;
|
||||
import com.gary.exercise.service.impl.ExerciseServiceImpl;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@SpringBootTest
|
||||
class ExerciseApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
ExerciseService service = new ExerciseServiceImpl();
|
||||
String filepath = "D:\\data\\coding files\\java\\exercise\\src\\main\\resources\\exercise.xlsx"; // 替换为实际路径
|
||||
int line = 3; // 读取第2行数据
|
||||
Map<String,String>result=service.getDetailInformation(filepath,line);
|
||||
/* List<String> result = service.readExcelByLine(filepath, line);*/
|
||||
System.out.println("读取结果:"+result);
|
||||
private final ExerciseService exerciseService;
|
||||
|
||||
private final int hang =1;
|
||||
|
||||
ExerciseApplicationTests(ExerciseService exerciseService) {
|
||||
this.exerciseService = exerciseService;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
server:
|
||||
port: 9090
|
||||
|
||||
|
||||
# 数据库
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://47.122.61.54:3306/nba_visualization?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
|
||||
username: root
|
||||
password: GHLgjw168168+
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
hikari:
|
||||
max-lifetime: 27000000 # 7.5 小时(毫秒)
|
||||
|
||||
|
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.
Loading…
Reference in new issue