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 com.rongyichuang.RycBackendApplication;
|
|
import java.util.List;
|
import java.util.Map;
|
|
@SpringBootTest(classes = RycBackendApplication.class)
|
public class CheckRatingItemTableStructureTest2 {
|
|
@Autowired
|
private JdbcTemplate jdbcTemplate;
|
|
@Test
|
public void checkTableStructure() {
|
try {
|
// 查询表结构
|
String sql = "DESCRIBE t_activity_player_rating_item";
|
List<Map<String, Object>> columns = jdbcTemplate.queryForList(sql);
|
|
System.out.println("=== t_activity_player_rating_item 表结构 ===");
|
for (Map<String, Object> column : columns) {
|
System.out.println("字段名: " + column.get("Field") +
|
", 类型: " + column.get("Type") +
|
", 是否为空: " + column.get("Null") +
|
", 键: " + column.get("Key") +
|
", 默认值: " + column.get("Default"));
|
}
|
|
} catch (Exception e) {
|
System.err.println("查询表结构失败: " + e.getMessage());
|
e.printStackTrace();
|
}
|
}
|
}
|