-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fefd1cc
commit b7a6add
Showing
16 changed files
with
305 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,40 +2,25 @@ use genti; | |
|
||
set @adminId := 1; | ||
set @userId := 2; | ||
set @emptyUserId := 3; | ||
set @creatorUserId := 4; | ||
set @emptyCreatorId := 5; | ||
set @oauthFirstJoinUserId := 6; | ||
set @deactivatedUserId := 7; | ||
set @deactivatedCreatorId := 8; | ||
|
||
set @creatorId := 1; | ||
|
||
insert ignore into user (id, created_at, modified_at, deleted_at, email, email_verified, introduction, | ||
last_login_social_platform, login_id, nickname, password, roles, user_status, | ||
username, profile_picture_id) | ||
|
||
VALUES (1, localtime, localtime, null, '[email protected]', true, null, 'GOOGLE', null, '어드민테스트1_닉네임', null, | ||
'ROLE_ADMIN,ROLE_MANAGER,ROLE_CREATOR,ROLE_USER', | ||
'ACTIVATED', '어드민이름', null), | ||
(2, localtime, localtime, null, '[email protected]', true, '유저_소개1', 'GOOGLE', null, '유저테스트1_닉네임', null, | ||
'ROLE_USER', | ||
'ACTIVATED', '유저이름1', null), | ||
(3, localtime, localtime, null, '[email protected]', true, '유저_소개2', 'GOOGLE', null, '유저테스트1_닉네임', | ||
null, | ||
'ROLE_USER', 'ACTIVATED', '유저이름2', null), | ||
(4, localtime, localtime, null, '[email protected]', true, '공급자_소개', 'GOOGLE', null, '유저테스트2_닉네임', | ||
null, | ||
'ROLE_CREATOR', 'ACTIVATED', '공급자이름1', null), | ||
(5, localtime, localtime, null, '[email protected]', true, '공급자_소개2', 'GOOGLE', null, | ||
'공급자테스트2_닉네임', null, 'ROLE_CREATOR', 'ACTIVATED', '공급자이름2', null), | ||
(6, localtime, localtime, null, '[email protected]', true, '최초가입자_소개', 'GOOGLE', null, | ||
'최초가입자_닉네임', null, 'ROLE_OAUTH_FIRST_JOIN,ROLE_USER', 'ACTIVATED', '최초가입자이름', null), | ||
(7, localtime, localtime, null, '[email protected]', true, '최초가입자_소개', 'GOOGLE', null, | ||
'비활성화된유저_닉네임', null, 'ROLE_USER', 'DEACTIVATED', '비활성화된유저이름', null), | ||
(8, localtime, localtime, null, '[email protected]', true, '최초가입자_소개', 'GOOGLE', | ||
null, | ||
'비활성화된공급자_닉네임', null, 'ROLE_CREATOR', 'DEACTIVATED', '비활성화된공급자이름', null); | ||
set @emptyUserId := 3; # 아무 사진 생성 요청하지 않은 유저의 UserId | ||
set @creatorUserId := 4; # 공급자 UserId | ||
set @emptyCreatorId := 5; # 사진 생성 요청 매칭되지 않은 공급자의 UserId | ||
set @oauthFirstJoinUserId := 6; # 첫 회원가입 유저 - FE에서는 크게 신경쓸 일 없을 것 같긴 합니다. | ||
set @deactivatedUserId := 7; # 비활성화된 유저의 UserId | ||
set @deactivatedCreatorId := 8; # 비활성화된 공급자의 CreatorId | ||
|
||
set @creatorId := 1; # 공급자의 CreatorId | ||
|
||
insert ignore into user (id, created_at, modified_at, deleted_at, email, email_verified, introduction, last_login_social_platform, login_id, nickname, password, roles, user_status, username, profile_picture_id) | ||
|
||
VALUES (1, localtime, localtime, null, '[email protected]', true, null, 'GOOGLE', null, '어드민테스트1_닉네임', null, 'ROLE_ADMIN,ROLE_MANAGER,ROLE_CREATOR,ROLE_USER','ACTIVATED', '어드민이름', null), | ||
(2, localtime, localtime, null, '[email protected]', true, '유저_소개1', 'GOOGLE', null, '유저테스트1_닉네임', null, 'ROLE_USER', 'ACTIVATED', '유저이름1', null), | ||
(3, localtime, localtime, null, '[email protected]', true, '유저_소개2', 'GOOGLE', null, '유저테스트1_닉네임', null, 'ROLE_USER', 'ACTIVATED', '유저이름2', null), | ||
(4, localtime, localtime, null, '[email protected]', true, '공급자_소개', 'GOOGLE', null, '유저테스트2_닉네임', null, 'ROLE_CREATOR', 'ACTIVATED', '공급자이름1', null), | ||
(5, localtime, localtime, null, '[email protected]', true, '공급자_소개2', 'GOOGLE', null, '공급자테스트2_닉네임', null, 'ROLE_CREATOR', 'ACTIVATED', '공급자이름2', null), | ||
(6, localtime, localtime, null, '[email protected]', true, '최초가입자_소개', 'GOOGLE', null, '최초가입자_닉네임', null, 'ROLE_OAUTH_FIRST_JOIN,ROLE_USER', 'ACTIVATED', '최초가입자이름', null), | ||
(7, localtime, localtime, null, '[email protected]', true, '최초가입자_소개', 'GOOGLE', null, '비활성화된유저_닉네임', null, 'ROLE_USER', 'DEACTIVATED', '비활성화된유저이름', null), | ||
(8, localtime, localtime, null, '[email protected]', true, '최초가입자_소개', 'GOOGLE', null, '비활성화된공급자_닉네임', null, 'ROLE_CREATOR', 'DEACTIVATED', '비활성화된공급자이름', null); | ||
|
||
insert ignore into creator (id, user_id, workable, created_at, modified_at) | ||
values (1, 4, true, localtime, localtime), | ||
|
@@ -60,19 +45,13 @@ values (1, LOCALTIME, LOCALTIME, 'user_face_picture_url1', 2), | |
|
||
|
||
|
||
insert ignore into picture_generate_request (id, creator_id, picture_pose_id, requester_id, prompt, camera_angle, | ||
request_status, shot_coverage, created_at, modified_at) | ||
VALUES (1, null, 4, 2, 'prompt_test_1', '위에서 촬영', 'BEFORE_WORK', '얼굴만 클로즈업', '2000-01-01 07:00:00', localtime), | ||
(2, null, 3, 2, 'prompt_test_2', '같은 높이에서 촬영', 'CANCELED', '허리 위로 촬영', '2020-01-01 07:00:00', | ||
localtime), | ||
(3, 1, 2, 2, 'prompt_test_3', '아래에서 촬영', 'IN_PROGRESS', '무릎 위로 촬영', '2000-01-01 07:00:00', | ||
localtime), | ||
(4, 1, 2, 2, 'prompt_test_4', '아래에서 촬영', 'IN_PROGRESS', '무릎 위로 촬영', '2000-01-01 07:00:00', | ||
localtime), | ||
(5, 1, 2, 2, 'prompt_test_5', '아래에서 촬영', 'IN_PROGRESS', '무릎 위로 촬영', '2000-01-01 07:00:00', | ||
localtime), | ||
(6, 1, 2, 2, 'prompt_test_6', '아래에서 촬영', 'REPORTED', '무릎 위로 촬영', '2000-01-01 07:00:00', | ||
localtime), | ||
insert ignore into picture_generate_request (id, creator_id, picture_pose_id, requester_id, prompt, camera_angle, request_status, shot_coverage, created_at, modified_at) | ||
VALUES (1, null, 4, 2, 'prompt_test_1', '위에서 촬영', 'CREATED', '얼굴만 클로즈업', '2000-01-01 07:00:00', localtime), | ||
(2, null, 3, 2, 'prompt_test_2', '같은 높이에서 촬영', 'CANCELED', '허리 위로 촬영', '2020-01-01 07:00:00', localtime), | ||
(3, 1, 2, 2, 'prompt_test_3', '아래에서 촬영', 'ASSIGNING', '무릎 위로 촬영', '2000-01-01 07:00:00', localtime), | ||
(4, 1, 2, 2, 'prompt_test_4', '아래에서 촬영', 'IN_PROGRESS', '무릎 위로 촬영', '2000-01-01 07:00:00', localtime), | ||
(5, 1, 2, 2, 'prompt_test_5', '아래에서 촬영', 'IN_PROGRESS', '무릎 위로 촬영', '2000-01-01 07:00:00', localtime), | ||
(6, 1, 2, 2, 'prompt_test_6', '아래에서 촬영', 'REPORTED', '무릎 위로 촬영', '2000-01-01 07:00:00', localtime), | ||
(7, 1, 1, 2, 'prompt_test_7', '위에서 촬영', 'COMPLETED', '전신 촬영', '2020-01-01 07:00:00', localtime), | ||
(8, 1, 1, 2, 'prompt_test_7', '위에서 촬영', 'REPORTED', '전신 촬영', '2020-01-01 07:00:00', localtime); | ||
|
||
|
@@ -103,8 +82,6 @@ values (1, 1), | |
(8, 8), | ||
(8, 9); | ||
|
||
|
||
|
||
insert ignore into picture_generate_response (id, created_at, modified_at, status, creator_id, request_id) | ||
values (1, localtime, localtime, 'BEFORE_WORK', 1, 3), | ||
(2, localtime, localtime, 'SUBMITTED_FIRST', 1, 4), | ||
|
@@ -117,21 +94,18 @@ insert ignore into report (id, created_at, modified_at, content, report_status, | |
values (1, localtime, localtime, '변태자식이 본인 발가락 사진을 보낸 것 같습니다.', 'NOT_RESOLVED', 4), | ||
(2, localtime, localtime, '모르는 사람 얼굴이에요', 'RESOLVED', 6); | ||
|
||
insert ignore into picture_created_by_creator (id, created_at, modified_at, url, picture_generate_response_id, | ||
uploaded_by) | ||
insert ignore into picture_created_by_creator (id, created_at, modified_at, url, picture_generate_response_id, uploaded_by) | ||
values (1, localtime, localtime, '얼굴 완성 전 url 1', 2, 4), | ||
(2, localtime, localtime, '얼굴 완성 전 url 2', 3, 4), | ||
(3, localtime, localtime, '얼굴 완성 전 url 3', 4, 4); | ||
|
||
insert ignore into picture_completed (id, created_at, modified_at, url, picture_generate_response_id, user_id, | ||
uploaded_by) | ||
insert ignore into picture_completed (id, created_at, modified_at, url, picture_generate_response_id, user_id, uploaded_by) | ||
values (1, localtime, localtime, '얼굴 완성 사진 url 1', 3, 2, 1), | ||
(2, localtime, localtime, '얼굴 완성 사진 url 2', 4, 2, 1), | ||
(3, localtime, localtime, '얼굴 완성 사진 url 3', 5, 2, 1), | ||
(4, localtime, localtime, '얼굴 완성 사진 url 4', 6, 2, 1); | ||
|
||
insert ignore into response_example (id, created_at, modified_at, example_picture_url, example_prompt, prompt_only, | ||
uploaded_by) | ||
insert ignore into response_example (id, created_at, modified_at, example_picture_url, example_prompt, prompt_only, uploaded_by) | ||
values (1, localtime, localtime, '/EXAMPLE/벚꽃벤치여자.png', '벚꽃 벤치 여자', false, 1), | ||
(2, localtime, localtime, '/EXAMPLE/한강잠수부.png', '한강잠수부', false, 1), | ||
(3, localtime, localtime, null, '프롬프트만있음 사진은 없고', true, 1); | ||
|
46 changes: 0 additions & 46 deletions
46
src/main/java/com/gt/genti/adapter/in/web/AdminPictureController.java
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
src/main/java/com/gt/genti/adapter/in/web/AdminPictureGenerateController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import static com.gt.genti.other.util.ApiUtils.*; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.gt.genti.application.service.PictureGenerateWorkService; | ||
import com.gt.genti.dto.PictureGenerateResponseAdminSubmitDto; | ||
import com.gt.genti.dto.UpdatePictureUrlRequestDto; | ||
import com.gt.genti.other.auth.UserDetailsImpl; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/api/admin/picture-generate-responses") | ||
@RequiredArgsConstructor | ||
public class AdminPictureGenerateController { | ||
private final PictureGenerateWorkService pictureGenerateWorkService; | ||
|
||
@PostMapping("/{pictureGenerateResponseId}/submit") | ||
public ResponseEntity<ApiResult<PictureGenerateResponseAdminSubmitDto>> submit( | ||
@PathVariable Long pictureGenerateResponseId) { | ||
return success(pictureGenerateWorkService.submitFinal(pictureGenerateResponseId)); | ||
} | ||
|
||
@PostMapping("/{pictureGenerateResponseId}/pictures") | ||
public ResponseEntity<ApiResult<Boolean>> updatePictureList( | ||
@AuthenticationPrincipal UserDetailsImpl userDetails, | ||
@RequestBody List<UpdatePictureUrlRequestDto> reuqestDtoList, | ||
@PathVariable Long pictureGenerateResponseId) { | ||
return success(pictureGenerateWorkService.updatePictureListCreatedByAdmin(userDetails.getId(), reuqestDtoList, | ||
pictureGenerateResponseId)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.