Skip to content

Commit

Permalink
#199 feat: chat mvc pattern 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
chaerlo127 committed Apr 12, 2023
1 parent 094a0e4 commit f6a32e0
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.codepatissier.keki.chat.controller;

import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SecurityRequirement(name = "Bearer")
@Tag(name = "chats", description = "상품 API")
@RestController
@RequestMapping(value = "/chats")
@RequiredArgsConstructor
public class ChatRoomController {
}
30 changes: 30 additions & 0 deletions src/main/java/com/codepatissier/keki/chat/entity/ChatRoom.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.codepatissier.keki.chat.entity;


import com.codepatissier.keki.common.BaseEntity;
import com.codepatissier.keki.common.entityListener.DessertEntityListener;
import com.codepatissier.keki.user.entity.User;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.*;

@Getter
@Entity
@NoArgsConstructor
@DynamicInsert
@EntityListeners(DessertEntityListener.class)
public class ChatRoom extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long chatRoomIdx;

@ManyToOne
@JoinColumn(nullable = false, name = "storeUserIdx")
private User store;

@ManyToOne
@JoinColumn(nullable = false, name = "userIdx")
private User user;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.codepatissier.keki.chat.repository;

import com.codepatissier.keki.chat.entity.ChatRoom;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface ChatRoomRepository extends JpaRepository<ChatRoom, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.codepatissier.keki.chat.service;

import org.springframework.stereotype.Service;

@Service
public class ChatService {
}

0 comments on commit f6a32e0

Please sign in to comment.