Skip to content

Commit

Permalink
chore: 더미 데이터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaPol committed Jan 31, 2024
1 parent aeac7f0 commit 9b5a66c
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
public class AuthController {
private final AuthService authService;

@Operation(summary = "(실사용 X, 명세용) 로그인 url: /oauth2/authorization/{provider}", description = "provider는 kakao 혹은 apple, 현재는 kakao만 있음")
@GetMapping("/dummy/login")
public void dummy() {
}

@Operation(summary = "로그아웃 합니다.")
@PostMapping("/api/v1/auth/logout")
public CommonResponse<?> logout(@RequestBody RefreshTokenRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,38 @@ public class ItemController {
private final ItemService itemService;

// 관리자 권한
@Operation(summary = "상품 글을 작성합니다.")
@Operation(summary = "상품 글을 작성합니다.", description = """
itemCategoryType = [
CLOTHES,
BAG,
SHOES,
FASHION,
STUFF,
JEWELRY,
BEAUTY,
FOOD,
LIFE
]
""")
@PostMapping("/items")
public CommonResponse<?> createItem(@RequestBody ItemCreateRequest request) {
ItemResponse response = itemService.createItem(request);
return CommonResponse.ok(response);
}

@Operation(summary = "상품 글을 업데이트합니다.")
@Operation(summary = "상품 글을 업데이트합니다.", description = """
itemCategoryType = [
CLOTHES,
BAG,
SHOES,
FASHION,
STUFF,
JEWELRY,
BEAUTY,
FOOD,
LIFE
]
""")
@PutMapping("/items/{id}")
public CommonResponse<?> updateItem(@RequestParam Long id, @RequestBody ItemUpdateRequest request) {
ItemResponse response = itemService.updateItem(id, request);
Expand Down Expand Up @@ -67,7 +91,7 @@ public CommonResponse<?> getItems(@RequestParam(required = false, defaultValue =
return CommonResponse.ok(responses);
}

@Operation(summary = "상품 글의 상세 내용한을 읽어옵니다.")
@Operation(summary = "상품 글의 상세 내용을 읽어옵니다.")
@GetMapping("/items/{id}")
public CommonResponse<?> getItemDetail(@RequestParam Long id,
@AuthenticationPrincipal OAuth2UserDetails userDetails) {
Expand Down
24 changes: 24 additions & 0 deletions core/core-infra-qdsl/src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
insert into permission(id, name) values(1, 'ROLE_ADMIN');
insert into permission(id, name) values(2, 'ROLE_USER');

insert into groups(id, name) values(1, 'ADMIN_GROUP');
insert into groups(id, name) values(2, 'USER_GROUP');

insert into group_permission(id, groups_id, permission_id) values(1, 1, 1);
insert into group_permission(id, groups_id, permission_id) values(2, 2, 2);

insert into item(id, detail, redirect_url, category_type, price, refund, rating, thumbnail_url)
values (1, 'test', 'https://s.zigzag.kr/3HSmoWF6Xa?af=1', 'BEAUTY', 10800, 1000, 5.0, 'https://cf.product-image.s.zigzag.kr/original/d/2023/9/21/21909_202309210952510497_81140.jpeg?width=720&height=720&quality=80&format=webp');
insert into item_video(id, url, item_id) values (1, 'https://youtu.be/TDmzXuma4Lw?si=9RFwafiFgTUOMsvE', 1);

insert into item(id, detail, redirect_url, category_type, price, refund, rating, thumbnail_url)
values (2, 'test', 'https://s.zigzag.kr/3HSmoWF6Xa?af=1', 'FOOD', 10800, 1000, 5.0, 'https://cf.product-image.s.zigzag.kr/original/d/2023/9/21/21909_202309210952510497_81140.jpeg?width=720&height=720&quality=80&format=webp');
insert into item_video(id, url, item_id) values (2, 'https://youtu.be/TDmzXuma4Lw?si=9RFwafiFgTUOMsvE', 2);

insert into item(id, detail, redirect_url, category_type, price, refund, rating, thumbnail_url)
values (3, 'test', 'https://s.zigzag.kr/3HSmoWF6Xa?af=1', 'LIFE', 10800, 1000, 5.0, 'https://cf.product-image.s.zigzag.kr/original/d/2023/9/21/21909_202309210952510497_81140.jpeg?width=720&height=720&quality=80&format=webp');
insert into item_video(id, url, item_id) values (3, 'https://youtu.be/TDmzXuma4Lw?si=9RFwafiFgTUOMsvE', 3);

insert into item(id, detail, redirect_url, category_type, price, refund, rating, thumbnail_url)
values (4, 'test', 'https://s.zigzag.kr/3HSmoWF6Xa?af=1', 'BEAUTY', 10800, 1000, 5.0, 'https://cf.product-image.s.zigzag.kr/original/d/2023/9/21/21909_202309210952510497_81140.jpeg?width=720&height=720&quality=80&format=webp');
insert into item_video(id, url, item_id) values (4, 'https://youtu.be/TDmzXuma4Lw?si=9RFwafiFgTUOMsvE', 4);
8 changes: 0 additions & 8 deletions core/core-security/src/main/resources/data.sql

This file was deleted.

0 comments on commit 9b5a66c

Please sign in to comment.