-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
34 changed files
with
356 additions
and
335 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
src/main/java/com/Han2m/portLogistics/admin/controller/AccountEditController.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/main/java/com/Han2m/portLogistics/admin/controller/AdminController.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,46 @@ | ||
package com.Han2m.portLogistics.admin.controller; | ||
|
||
import com.Han2m.portLogistics.admin.dto.LoginRequestDto; | ||
import com.Han2m.portLogistics.admin.dto.TokenDto; | ||
import com.Han2m.portLogistics.admin.dto.UserEditPasswordDto; | ||
import com.Han2m.portLogistics.admin.dto.UserRequestDto; | ||
import com.Han2m.portLogistics.admin.service.AccountService; | ||
import com.Han2m.portLogistics.admin.service.LoginService; | ||
import com.Han2m.portLogistics.exception.ApiResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import static com.Han2m.portLogistics.exception.ApiResponse.successResponse; | ||
import static com.Han2m.portLogistics.exception.ApiResponse.successResponseNoContent; | ||
|
||
@Tag(name = "관리자 등록/로그인 API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api") | ||
public class AdminController { | ||
private final LoginService loginService; | ||
private final AccountService accountService; | ||
|
||
@Operation(summary = "직원 계정 생성") | ||
@PostMapping("/worker/{workerId}/account") | ||
public ApiResponse<?> addUser(@PathVariable Long workerId, @RequestBody UserRequestDto userRequestDto) { | ||
accountService.addUser(workerId, userRequestDto); | ||
return successResponseNoContent(); | ||
} | ||
|
||
@Operation(summary = "계정 로그인") | ||
@PostMapping("/login") | ||
public ApiResponse<TokenDto> login(@RequestBody LoginRequestDto loginRequestDto) { | ||
TokenDto token = loginService.login(loginRequestDto); | ||
return successResponse(token); | ||
} | ||
|
||
@Operation(summary = "계정 비밀번호 변경") | ||
@PutMapping("/worker/password") | ||
public ApiResponse<?> editPassword(@RequestBody UserEditPasswordDto userEditPasswordDto) { | ||
accountService.editAccount(userEditPasswordDto); | ||
return successResponseNoContent(); | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
src/main/java/com/Han2m/portLogistics/admin/controller/LoginController.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/main/java/com/Han2m/portLogistics/admin/controller/SignupController.java
This file was deleted.
Oops, something went wrong.
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
11 changes: 0 additions & 11 deletions
11
src/main/java/com/Han2m/portLogistics/admin/dto/LoginResponseDto.java
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/main/java/com/Han2m/portLogistics/admin/dto/UserEditPasswordDto.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,8 @@ | ||
package com.Han2m.portLogistics.admin.dto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class UserEditPasswordDto { | ||
private String password; | ||
} |
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
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
41 changes: 0 additions & 41 deletions
41
src/main/java/com/Han2m/portLogistics/config/DefaultUserConfig.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.