Skip to content

Commit

Permalink
fix: 의견보내기 항목에 email 항목에 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 24, 2024
1 parent 8c77485 commit c6c74a5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sql/discussion.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ CREATE TABLE `discussion`
(
`id` bigint NOT NULL AUTO_INCREMENT,
`uid` bigint NOT NULL COMMENT 'uid',
`email` varchar(512) DEFAULT NULL COMMENT '이메일',
`type` varchar(32) NOT NULL COMMENT '문의하기 유형',
`title` varchar(512) NOT NULL COMMENT '문의하기 제목',
`content` text NOT NULL COMMENT '문의하기 본문',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '생성일',
`modified_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정일',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '생성일',
`modified_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정일',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=200000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE INDEX idx__uid ON discussion (uid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class DiscussionService(
suspend fun create(user: AuthUser, request: DiscussionRequest): DiscussionResponse {
val discussion = Discussion(
uid = user.uid,
email = request.email,
type = request.type,
title = request.title,
content = request.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Discussion(
@Column(name = "uid")
val uid: Long,

@Column(name = "email")
val email: String? = null,

@Column(name = "type")
@Enumerated(EnumType.STRING)
val type: DiscussionType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.hero.alignlab.domain.discussion.model.request
import com.hero.alignlab.domain.discussion.domain.vo.DiscussionType

data class DiscussionRequest(
/** 이메일, nullable하게 데이터를 받음. */
val email: String? = null,
/** 문의하기 유형 */
val type: DiscussionType,
/** 문의하기 제목 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import java.time.LocalDateTime
data class DiscussionResponse(
val id: Long,
val uid: Long,
val email: String?,
val type: DiscussionType,
val title: String,
val content: String,
Expand All @@ -18,6 +19,7 @@ data class DiscussionResponse(
return DiscussionResponse(
id = discussion.id,
uid = discussion.uid,
email = discussion.email,
type = discussion.type,
title = discussion.title,
content = discussion.content,
Expand Down

0 comments on commit c6c74a5

Please sign in to comment.