Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ out/

### VS Code ###
.vscode/
db/
Binary file modified db/data/aria_log.00000001
Binary file not shown.
Binary file modified db/data/aria_log_control
Binary file not shown.
Binary file added db/data/eatUs/reservation.frm
Binary file not shown.
Binary file added db/data/eatUs/reservation.ibd
Binary file not shown.
Binary file modified db/data/eatUs/user.frm
Binary file not shown.
Binary file modified db/data/eatUs/user.ibd
Binary file not shown.
Binary file modified db/data/eatUs/user_roles.frm
Binary file not shown.
Binary file modified db/data/eatUs/user_roles.ibd
Binary file not shown.
221 changes: 191 additions & 30 deletions db/data/ib_buffer_pool
Original file line number Diff line number Diff line change
@@ -1,29 +1,193 @@
59,4
59,3
59,2
59,1
59,0
57,5
57,4
58,3
58,2
58,1
58,0
57,3
57,2
57,1
57,0
56,4
56,3
56,2
56,1
56,0
54,5
54,4
54,3
54,2
54,1
54,0
0,439
115,4
115,3
115,2
115,1
115,0
113,5
113,4
114,3
114,2
114,1
114,0
113,3
113,2
113,1
113,0
112,3
112,2
112,1
112,0
111,4
111,3
111,2
111,1
111,0
109,5
109,4
110,3
110,2
110,1
110,0
109,3
109,2
109,1
109,0
108,3
108,2
108,1
108,0
107,4
107,3
107,2
107,1
107,0
105,5
105,4
106,3
106,2
106,1
106,0
105,3
105,2
105,1
105,0
104,3
104,2
104,1
104,0
103,4
103,3
103,2
103,1
103,0
101,5
101,4
102,3
102,2
102,1
102,0
101,3
101,2
101,1
101,0
100,3
100,2
100,1
100,0
0,438
99,4
99,3
99,2
99,1
99,0
97,5
97,4
98,3
98,2
98,1
98,0
97,3
97,2
97,1
97,0
96,3
96,2
96,1
96,0
0,437
95,4
95,3
95,2
95,1
95,0
93,5
93,4
94,3
94,2
94,1
94,0
93,3
93,2
93,1
93,0
92,3
92,2
92,1
92,0
0,436
91,4
91,3
91,2
91,1
91,0
89,5
89,4
90,3
90,2
90,1
90,0
89,3
89,2
89,1
89,0
88,3
88,2
88,1
88,0
87,4
87,3
87,2
87,1
87,0
85,5
85,4
86,3
86,2
86,1
86,0
85,3
85,2
85,1
85,0
84,3
84,2
84,1
84,0
83,4
83,3
83,2
83,1
83,0
81,5
81,4
82,3
82,2
82,1
82,0
81,3
81,2
81,1
81,0
80,3
80,2
80,1
80,0
79,4
79,3
79,2
79,1
79,0
77,5
77,4
77,3
77,2
77,1
77,0
76,3
76,2
76,1
76,0
4,3
2,3
1,3
Expand Down Expand Up @@ -220,7 +384,6 @@
0,207
0,368
0,206
0,325
0,205
0,323
0,204
Expand All @@ -236,7 +399,6 @@
0,199
0,319
0,198
0,362
0,197
0,318
0,196
Expand Down Expand Up @@ -276,9 +438,8 @@
0,51
0,353
0,50
0,311
0,435
0,49
0,310
0,48
0,309
0,47
Expand Down
Binary file modified db/data/ib_logfile0
Binary file not shown.
Binary file modified db/data/ibdata1
Binary file not shown.
Binary file modified db/data/mysql/innodb_index_stats.ibd
Binary file not shown.
Binary file modified db/data/mysql/innodb_table_stats.ibd
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-ui.html").permitAll()
.antMatchers("/auth/**").permitAll()
.antMatchers("/admin/**").permitAll()
.antMatchers("/reservation/**").permitAll()
.anyRequest().authenticated()
.and()
.sessionManagement()
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/example/eatusapi/account/entity/User.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.example.eatusapi.account.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
Expand All @@ -14,7 +12,7 @@
import java.util.List;
import java.util.stream.Collectors;

@javax.persistence.Entity
@Entity
@Data
@Builder
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.example.eatusapi.reservation.controller;

import com.example.eatusapi.reservation.dto.ResDto;
import com.example.eatusapi.reservation.dto.ResQueryDto;
import com.example.eatusapi.reservation.entity.Reservation;
import com.example.eatusapi.reservation.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Date;

@RestController
@RequestMapping("/reservation")
public class ReservationController {

@Autowired
private ReservationService reservationService;

@PostMapping
public Reservation reservation(@RequestBody @Valid ResDto resDto) {
return reservationService.reserve(resDto);
}

@PostMapping("/info")
public Reservation reservationInfo(@RequestBody ResQueryDto resQueryDto) {
return reservationService.getResrvation(resQueryDto);
}

@PostMapping("/cancel")
public Reservation cancelReservation(@RequestBody ResDto resDto ) {
return reservationService.cancel(resDto);
}
}
20 changes: 20 additions & 0 deletions src/main/java/com/example/eatusapi/reservation/dto/ResDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.eatusapi.reservation.dto;

import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotBlank;
import java.sql.Date;


@Component
@Getter
@Setter
public class ResDto {
String placename;
Date date;
String food;
@NotBlank
String member;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.eatusapi.reservation.dto;

import lombok.Data;
import org.springframework.stereotype.Component;

import java.sql.Date;

@Component
@Data
public class ResQueryDto {
private Date date;
private String placename;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.example.eatusapi.reservation.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.sql.Date;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@Setter
@DynamicInsert
@Table(name = "reservation")
public class Reservation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
long id;
@NotNull
String placename;
@NotNull
Date date;
@NotNull
String food;
@NotNull
int currentmember;
@Column(name = "member_1")
String member1;
@Column(name = "member_2")
String member2;
@Column(name = "member_3")
String member3;
@Column(name = "member_4")
String member4;
@Column(name = "member_5")
String member5;
}
Loading