Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into Feature-frontMarkup
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhminme committed Mar 2, 2022
2 parents 6c28438 + 49b5ffc commit e67d2c1
Show file tree
Hide file tree
Showing 99 changed files with 3,702 additions and 26 deletions.
96 changes: 94 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,94 @@
.DS_Store
node_modules
node_modules
bower_components

*.sublime*

psd
thumb
sketch

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
./MenuCanvas/xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
./MenuCanvas/*.xcscmblueprint
./MenuCanvas/*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
./MenuCanvas/build/
./MenuCanvas/DerivedData/
./MenuCanvas/*.moved-aside
./MenuCanvas/*.pbxuser
!default.pbxuser
./MenuCanvas/*.mode1v3
!default.mode1v3
./MenuCanvas/*.mode2v3
!default.mode2v3
./MenuCanvas/*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
./MenuCanvas/*.hmap

## App packaging
./MenuCanvas/*.ipa
./MenuCanvas/*.dSYM.zip
./MenuCanvas/*.dSYM

## Playgrounds
./MenuCanvas/timeline.xctimeline
./MenuCanvas/playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

./MenuCanvas/.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
./MenuCanvas/Pods
# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

./MenuCanvas/Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# End of https://www.toptal.com/developers/gitignore/api/swift,cocoapods,git,java,react,kotlin,database
94 changes: 94 additions & 0 deletions .gitignore~parent of 8fdfc7d (apply .gitignore)
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
node_modules
bower_components

*.sublime*

psd
thumb
sketch

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# End of https://www.toptal.com/developers/gitignore/api/swift,cocoapods,git,java,react,kotlin,database
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 오더캔버스
# 메뉴 캔버스

## 손쉽게 이쁜 디지털 메뉴판을 만들어보세요.

Expand Down
75 changes: 74 additions & 1 deletion backend/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
buildscript {
ext {
queryDslVersion = "5.0.0"
}
}
plugins {
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'application'
id "org.asciidoctor.convert" version "1.5.9.2"
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}

group = 'com.hummingbird'
Expand All @@ -19,6 +26,18 @@ repositories {
mavenCentral()
}

//ext {
// // Snippet 의 생성 위치를 지정
// snippetsDir = file('build/generated-snippets')
//}
//
//asciidoctor {
// // Snippets 디렉토리를 Input 디렉토리로 설정
// inputs.dir snippetsDir
// // 문서 생성 전 테스트가 실행되도록 test 에 종속 설정
// dependsOn test
//}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
Expand All @@ -28,15 +47,69 @@ dependencies {
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

//swagger-ui
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'

//springboot validation
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'

//fcm
implementation 'com.google.firebase:firebase-admin:8.1.0'

// test code 에도 lombok 적용
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

/*
https://young-bin.tistory.com/92
asciidocker 에 대한 spring-restdocs-asciidocker 의존성 추가
Maven 처럼 build/generated-snippets 밑에 생성된 Snippet 을 .adoc 파일이 자동으로
가리키도록 하는 설정 추가.
operation 블록 매크로 사용 가능
*/
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// Maven 과 같이 test Scope 에 대한 mockMvc 의존성을 추가 (WebClient, Assured 사용가능)
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
//querydsl 추가
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}"
}

test {
useJUnitPlatform()
// Snippets 디렉토리를 출력으로 작업하도록 설정
// outputs.dir snippetsDir
}

bootRun {
mainClassName = 'com.hummingbird.backend.BackendApplication'
}

bootJar {
mainClassName = 'com.hummingbird.backend.BackendApplication'
}
// 빌드 전 문서 생성 확인
// dependsOn asciidoctor
// // 생성된 문서를 static/docs 에 복사
// from ("${asciidoctor.outputDir}/html5") {
// into 'static/docs'
// }
}
//querydsl start
def querydslDir = "$buildDir/generated/querydsl" as Object

querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main.java.srcDir querydslDir
}
configurations {
querydsl.extendsFrom compileClasspath
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
//querydsl end
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package com.hummingbird.backend;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@EnableJpaRepositories
@EnableJpaAuditing
@SpringBootApplication
public class BackendApplication {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.hummingbird.backend.category.controller;

import com.hummingbird.backend.category.dto.CreateCategoryDto;
import com.hummingbird.backend.category.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CategoryController {
private CategoryService categoryService;

@Autowired
public CategoryController(CategoryService categoryService) {
this.categoryService = categoryService;
}

@PostMapping("/category/new")
public Long createCategory(@RequestBody CreateCategoryDto dto, @RequestParam("menuId") Long menuId){
return categoryService.create(dto,menuId);
}

@PostMapping("/category/update")
public Long updateCategory(Long id,String name){
return categoryService.update(id, name);
}

@PostMapping("/category/delete")
public boolean deleteCategory(Long id) {
return categoryService.delete(id);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.hummingbird.backend.category.domain;

import com.hummingbird.backend.food.domain.Food;
import com.hummingbird.backend.menu.domain.Menu;
import lombok.*;

import javax.persistence.*;

import java.util.ArrayList;
import java.util.List;

import static javax.persistence.FetchType.*;

@Getter
@Entity
@ToString
@Setter
@NoArgsConstructor
public class Category {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

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

@ManyToOne(fetch = LAZY)
@JoinColumn(name = "menu_id")
private Menu menu;

@OneToMany(mappedBy = "category",cascade = CascadeType.REMOVE)
private List<Food> foodList = new ArrayList<>();

@Builder
public Category(Long id, String name, Menu menu) {
this.id = id;
this.name = name;
this.menu = menu;
}

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

0 comments on commit e67d2c1

Please sign in to comment.