package com.rongyichuang;
|
|
import org.junit.jupiter.api.Test;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import java.util.List;
|
import java.util.Map;
|
|
@SpringBootTest(classes = RycBackendApplication.class)
|
public class CheckActivityPlayerRatingTableTest {
|
|
@Autowired
|
private JdbcTemplate jdbcTemplate;
|
|
@Test
|
public void checkTableStructure() {
|
try {
|
String sql1 = "DESCRIBE t_activity_player_rating";
|
List<Map<String, Object>> result1 = jdbcTemplate.queryForList(sql1);
|
|
System.out.println("=== t_activity_player_rating 表结构 ===");
|
for (Map<String, Object> row : result1) {
|
System.out.println("Field: " + row.get("Field") +
|
", Type: " + row.get("Type") +
|
", Null: " + row.get("Null") +
|
", Key: " + row.get("Key") +
|
", Default: " + row.get("Default"));
|
}
|
|
System.out.println("\n=== t_activity_player_rating_item 表结构 ===");
|
String sql2 = "DESCRIBE t_activity_player_rating_item";
|
List<Map<String, Object>> result2 = jdbcTemplate.queryForList(sql2);
|
|
for (Map<String, Object> row : result2) {
|
System.out.println("Field: " + row.get("Field") +
|
", Type: " + row.get("Type") +
|
", Null: " + row.get("Null") +
|
", Key: " + row.get("Key") +
|
", Default: " + row.get("Default"));
|
}
|
} catch (Exception e) {
|
System.err.println("检查表结构失败: " + e.getMessage());
|
e.printStackTrace();
|
}
|
}
|
}
|