Skip to content

khsrla9806/fastcampus-toyproject2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšพ๏ธ ์•ผ๊ตฌ๊ด€๋ฆฌ ํ”„๋กœ๊ทธ๋žจ (FastCampus Toy Project)


๐Ÿง‘๐Ÿปโ€๐Ÿ’ป ํŒ€ ๊ตฌ์„ฑ


๊น€ํ›ˆ์„ญ
khsrla9806

๋ฐ•์žฅํฌ
jeanparkk



๐Ÿ› ๏ธ ํ”„๋กœ์ ํŠธ์— ์‚ฌ์šฉํ•œ ๊ธฐ์ˆ 



๐Ÿ™‹๐Ÿปโ€โ™‚๏ธ ํŒ€์› ์—ญํ• 

๊น€ํ›ˆ์„ญ

  • ํ…Œ์ด๋ธ” SQL ์„ค๊ณ„
  • Player, OutPlayer ๋ชจ๋ธ, DAO ์„ค๊ณ„
  • PlayerService, OutPlayerService ๊ตฌํ˜„
  • Player, OutPlayer View ๊ตฌํ˜„
  • ์ „์ฒด ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ ๋ฐ ๋ฆฌํŽ™ํ† ๋ง

๋ฐ•์žฅํฌ

  • ํ…Œ์ด๋ธ” SQL ์„ค๊ณ„
  • Stadium, Team ๋ชจ๋ธ, DAO ์„ค๊ณ„
  • StadiumService, TeamService ๊ตฌํ˜„
  • Stadium, Team View ๊ตฌํ˜„
  • ์ „์ฒด ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ ๋ฐ ๋ฆฌํŽ™ํ† ๋ง



๐Ÿ–ฅ๏ธ ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐ์„ธํŒ…

๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์Šคํ‚ค๋งˆ/ํ…Œ์ด๋ธ” ์ƒ์„ฑ

create database baseball;
use baseball;

create table stadium(
  id int primary key auto_increment,
  name varchar(20),
  created_at timestamp
);

create table team (
  id int primary key auto_increment,
  stadium_id int,
  name varchar(20),
  created_at timestamp,
  foreign key(stadium_id) references stadium(id)
);

create table player(
  id int primary key auto_increment,
  team_id int,
  name varchar(20),
  position varchar(10),
  created_at timestamp,
  unique(team_id, position),
  foreign key (team_id) references team(id)
);

create table out_player(
  id int primary key auto_increment,
  player_id int,
  reason varchar(255),
  created_at timestamp,
  foreign key(player_id) references player(id)
);

์˜์กด์„ฑ ์ถ”๊ฐ€

dependencies {
    implementation 'org.assertj:assertj-core:3.24.2'
    compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.28'
    annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.28'
    implementation 'com.mysql:mysql-connector-j:8.0.32'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

DBConnection ์ƒ์„ฑ

public class DBConnection {
    public static Connection getConnection(){
        String url = "jdbc:mysql://localhost:3306/baseball";
        String username = "root";
        String password = "root1234";

        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            Connection connection = DriverManager.getConnection(url, username, password);
            return connection;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

DBCOnnection ์—ฐ๋™ ํ…Œ์ŠคํŠธ

class DBConnectionTest {
    @Test
    @DisplayName("DB Connection ํ…Œ์ŠคํŠธ")
    void DBConnectionTest() {
        // Given & When
        Connection connection = DBConnection.getConnection();

        // Then
        assertThat(connection).isNotNull();
    }
}



โœ‹๐Ÿป ๊นƒํ—ˆ๋ธŒ ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ๊ทœ์น™

feat: ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€ํ–ˆ์„ ๋•Œ
fix: ๋ฒ„๊ทธ๋‚˜ ์˜ค๋ฅ˜ ์ˆ˜์ •ํ–ˆ์„ ๋•Œ
refactor: ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋งํ–ˆ์„ ๋•Œ
chore: ์•ฝ๊ฐ„ ์• ๋งคํ•œ ๊ธฐํƒ€ ๋ณ€๊ฒฝ์‚ฌํ•ญ
docs: ๋ฆฌ๋“œ๋ฏธ ํŒŒ์ผ์ด๋‚˜ md ํŒŒ์ผ ์ˆ˜์ •ํ•  ๋•Œ (๋ฌธ์„œ์ž‘์—…)



๐Ÿ™Œ๐Ÿป ํ˜‘์—… ๊ทœ์น™

  • ๊ฐ์ž ์ž‘์—… ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ๋งก์€ ์ž‘์—…์„ ์ง„ํ–‰
  • ์ž‘์—…์ด ๋๋‚˜๋ฉด develop ๋ธŒ๋žœ์น˜๋กœ Pull Request๋ฅผ ์š”์ฒญ
  • ๋ชจ๋‘ PR์ด ๋๋‚˜๋ฉด ๋ชจ์—ฌ์„œ ์ฝ”๋“œ ๋…ผ์˜ ํ›„์— merge ์ง„ํ–‰
  • ๋ชจ๋“  ์ž‘์—…์ด ๋๋‚œ ํ›„ develop ๋ธŒ๋žœ์น˜์—์„œ ๊ฐ์ž ์ „์ฒด ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ
  • ๋ชจ๋“  ํ…Œ์ŠคํŠธ ์™„๋ฃŒ ์‹œ main ๋ธŒ๋žœ์น˜๋กœ merge

About

๐Ÿ–ฅ๏ธ JDK11 + Gradle + JDBC + MySQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages