From 09fd9690f842594f2cc171889167bdd4907e4b68 Mon Sep 17 00:00:00 2001 From: LEEYONGJAE Date: Fri, 6 Sep 2024 16:20:57 +0900 Subject: [PATCH] =?UTF-8?q?[myInfo]=20=EB=82=B4=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=ED=8C=9D=EC=97=85=20API=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qcast/biz/myInfo/MyInfoController.java | 32 +++++++++++++++ .../qcast/biz/myInfo/MyInfoMapper.java | 18 +++++++++ .../qcast/biz/myInfo/MyInfoService.java | 26 ++++++++++++ .../qcast/biz/myInfo/dto/MyInfoRequest.java | 13 ++++++ .../qcast/biz/myInfo/dto/MyInfoResponse.java | 40 +++++++++++++++++++ .../resources/mappers/myInfo/myInfoMapper.xml | 21 ++++++++++ 6 files changed, 150 insertions(+) create mode 100644 src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java create mode 100644 src/main/java/com/interplug/qcast/biz/myInfo/MyInfoMapper.java create mode 100644 src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java create mode 100644 src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoRequest.java create mode 100644 src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoResponse.java create mode 100644 src/main/resources/mappers/myInfo/myInfoMapper.xml diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java new file mode 100644 index 00000000..8b6b937d --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java @@ -0,0 +1,32 @@ +package com.interplug.qcast.biz.myInfo; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; +import com.interplug.qcast.biz.myInfo.dto.MyInfoRequest; +import com.interplug.qcast.biz.myInfo.dto.MyInfoResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@RestController +@RequestMapping("/api/my-info") +@RequiredArgsConstructor +@Tag(name = "MyInfoController", description = "내 정보 조회 API") +public class MyInfoController { + + private final MyInfoService myInfoService; + + @Operation(description = "사용자 ID의 정보를 조회한다.") + @GetMapping("/my-profile") + @ResponseStatus(HttpStatus.OK) + public MyInfoResponse getMyInfo(@ModelAttribute MyInfoRequest myInfoRequest) { + return myInfoService.getMyInfo(myInfoRequest); + } + +} diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoMapper.java b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoMapper.java new file mode 100644 index 00000000..102eca99 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoMapper.java @@ -0,0 +1,18 @@ +package com.interplug.qcast.biz.myInfo; + +import org.apache.ibatis.annotations.Mapper; +import com.interplug.qcast.biz.myInfo.dto.MyInfoRequest; +import com.interplug.qcast.biz.myInfo.dto.MyInfoResponse; + +@Mapper +public interface MyInfoMapper { + + /** + * ※ 사용자 정보 조회 + * + * @param myInfoRequest + * @return + */ + MyInfoResponse selectMyInfo(MyInfoRequest myInfoRequest); + +} diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java new file mode 100644 index 00000000..35f2d93e --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java @@ -0,0 +1,26 @@ +package com.interplug.qcast.biz.myInfo; + +import org.springframework.stereotype.Service; +import com.interplug.qcast.biz.myInfo.dto.MyInfoRequest; +import com.interplug.qcast.biz.myInfo.dto.MyInfoResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +@RequiredArgsConstructor +public class MyInfoService { + + private final MyInfoMapper myInfoMapper; + + /** + * ※ 사용자 정보 조회 + * + * @param userId + * @return MyInfoResponse + */ + public MyInfoResponse getMyInfo(MyInfoRequest myInfoRequest) { + return myInfoMapper.selectMyInfo(myInfoRequest); + } + +} diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoRequest.java b/src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoRequest.java new file mode 100644 index 00000000..fc7c0642 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoRequest.java @@ -0,0 +1,13 @@ +package com.interplug.qcast.biz.myInfo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class MyInfoRequest { + + /** 사용자ID */ + private String userId; + +} diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoResponse.java b/src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoResponse.java new file mode 100644 index 00000000..2b421002 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/myInfo/dto/MyInfoResponse.java @@ -0,0 +1,40 @@ +package com.interplug.qcast.biz.myInfo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class MyInfoResponse { + + /** 사용자ID */ + private String userId; + + /** 비밀번호 */ + private String password; + + /** 담당자명 */ + private String name; + + /** 담당자명 후리가나 */ + private String nameKana; + + /** 부서명 */ + private String category; + + /** 전화번호 */ + private String tel; + + /** fax번호 */ + private String fax; + + /** 이메일 주소 */ + private String mail; + + /** GROUD ID */ + private String groupId; + + /** GROUD 명 */ + private String groupName; + +} diff --git a/src/main/resources/mappers/myInfo/myInfoMapper.xml b/src/main/resources/mappers/myInfo/myInfoMapper.xml new file mode 100644 index 00000000..dae5591b --- /dev/null +++ b/src/main/resources/mappers/myInfo/myInfoMapper.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file