Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week3주차 반영 #12

Merged
merged 13 commits into from
Sep 22, 2024
Merged
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# 코드 컨벤션

- angular code conventions을 기반으로 커밋 메세지 작성
- feat : 새로운 기능 추가
- fix : 버그 수정
- docs : 문서 변경
- style : 코드 스타일 변경 (포매팅 수정, 세미콜론 추가 등)
- refactor : 코드 리팩토링
- test : 테스트 코드 추가, 수정
- chore : 빌드 프로세스, 도구 설정 변경 등 기타 작업
- feat : 새로운 기능 추가
- fix : 버그 수정
- docs : 문서 변경
- style : 코드 스타일 변경 (포매팅 수정, 세미콜론 추가 등)
- refactor : 코드 리팩토링
- test : 테스트 코드 추가, 수정
- chore : 빌드 프로세스, 도구 설정 변경 등 기타 작업

---

Expand All @@ -44,25 +44,25 @@
- 로그인
- 코드로 참여
- 프로젝트(김도헌)
- 프로젝트 리스트 조회
- 프로젝트 기간 리스트 조회
- 프로젝트 조회
- 프로젝트 멤버 조회
- 프로젝트 생성
- 프로젝트 설정 수정
- 프로젝트 삭제
- 프로젝트 리스트 조회
- 프로젝트 기간 리스트 조회
- 프로젝트 조회
- 프로젝트 멤버 조회
- 프로젝트 생성
- 프로젝트 설정 수정
- 프로젝트 삭제
- 게스트(권순호)
- 게스트 생성
- 게스트 수정
- 게스트 삭제
- 프로젝트 내 게스트 추가
- 프로젝트 코드 메일로 전달
- 게스트 생성
- 게스트 수정
- 게스트 삭제
- 프로젝트 내 게스트 추가
- 프로젝트 코드 메일로 전달
- 태스크(조서영)
- 태스크 생성
- 태스크 삭제
- 태스크 수정
- 태스크 생성
- 태스크 삭제
- 태스크 수정
- 이벤트
- 독려 이메일 전달
- 각 게스트별 진행도 조회
- 태스크별 진행도 조회
- 독려 이메일 전달
- 각 게스트별 진행도 조회
- 태스크별 진행도 조회
- ...
13 changes: 13 additions & 0 deletions src/main/java/com/example/team1_be/DTO/AttendUrlResponseDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.team1_be.DTO;

public class AttendUrlResponseDTO {
String attendUrl;

public String getAttendUrl() {
return attendUrl;
}

public void setAttendUrl(String attendUrl) {
this.attendUrl = attendUrl;
}
}
41 changes: 41 additions & 0 deletions src/main/java/com/example/team1_be/DTO/TaskDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.example.team1_be.DTO;

public class TaskDto {

private Long id;
private String content;
private String name;
private Integer progress;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getContent() {
return content;
}

public void setContent(String content) {
this.content = content;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Integer getProgress() {
return progress;
}

public void setProgress(Integer progress) {
this.progress = progress;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.team1_be.controller;

import com.example.team1_be.DTO.AttendUrlResponseDTO;
import com.example.team1_be.service.AttendURLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AttendUrlController {

@Autowired
AttendURLService attendURLService;

@PostMapping("/generate-url")
public ResponseEntity<AttendUrlResponseDTO> generateUrl() {

AttendUrlResponseDTO attendUrlResponseDTO = new AttendUrlResponseDTO();
attendUrlResponseDTO.setAttendUrl(attendURLService.generateAttendURL());
return ResponseEntity.ok(attendUrlResponseDTO);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.example.team1_be.controller;

import com.example.team1_be.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/Member")
@RestController
public class MemberController {
@Autowired
MemberService memberService;

@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteMember(@PathVariable Long id) {
memberService.deleteMember(id);
return ResponseEntity.noContent().build();
}
}
21 changes: 21 additions & 0 deletions src/main/java/com/example/team1_be/controller/TaskController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.team1_be.controller;

import com.example.team1_be.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/project")
public class TaskController {

@Autowired
private TaskService taskService;

@DeleteMapping("/{project_id}/task/{task_id}")
public void createTask(@PathVariable Long project_id, Long task_id) {
taskService.deleteTask(project_id, task_id);
}
}
37 changes: 37 additions & 0 deletions src/main/java/com/example/team1_be/entity/MemberEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.example.team1_be.entity;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;

@Entity
public class MemberEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String email;

public MemberEntity(String email) {
this.email = email;
}
public MemberEntity() {}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}
}

94 changes: 26 additions & 68 deletions src/main/java/com/example/team1_be/entity/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,107 +2,65 @@

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToOne;
import java.time.LocalDateTime;

@Entity(name = "task")
public class Task extends BaseEntity{

public Task() {

}

public Task(String name, String remark, Integer progress, Integer isDelete, Project project,
Guest owner, LocalDateTime startDate, LocalDateTime endDate) {
this.name = name;
this.remark = remark;
this.progress = progress;
this.isDelete = isDelete;
this.project = project;
this.owner = owner;
this.startDate = startDate;
this.endDate = endDate;
}
public class Task {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "task_id")
private Long id;

@Column(name = "name")
private String name;
private String content;

@Column(name = "remark")
private String remark;
private String name;

@Column(name = "progress")
private Integer progress;

@Column(name = "is_delete")
private Integer isDelete;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "project_id")
private Project project;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "guest_id")
private Guest owner;

@Column(name = "start_date")
private LocalDateTime startDate;

@Column(name = "end_date")
private LocalDateTime endDate;

public Long getId() {
return id;
public Task(Long id, String content, String name, Integer progress) {
this.id = id;
this.content = content;
this.name = name;
this.progress = progress;
}

public String getName() {
return name;
}
public Task() {

public String getRemark() {
return remark;
}

public Integer getProgress() {
return progress;
public Long getId() {
return id;
}

public Integer getIsDelete() {
return isDelete;
public void setId(Long id) {
this.id = id;
}

public Project getProject() {
return project;
public String getContent() {
return content;
}

public Guest getOwner() {
return owner;
public void setContent(String content) {
this.content = content;
}

public LocalDateTime getStartDate() {
return startDate;
public String getName() {
return name;
}

public LocalDateTime getEndDate() {
return endDate;
public void setName(String name) {
this.name = name;
}

public void setOwner(Guest owner) {
this.owner = owner;
public Integer getProgress() {
return progress;
}

public void setProject(Project project) {
this.project = project;
public void setProgress(Integer progress) {
this.progress = progress;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.team1_be.repository;

import com.example.team1_be.entity.MemberEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;


@Repository
public interface MemberRepository extends JpaRepository<MemberEntity, Long> {
}
11 changes: 11 additions & 0 deletions src/main/java/com/example/team1_be/repository/TaskRepository.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.example.team1_be.repository;

import com.example.team1_be.entity.Task;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface TaskRepository extends JpaRepository<Task, Long> {

void deleteById(Long projectId, Long taskId);
}
Loading