[myInfo] 내 정보 조회 팝업 API 추가

This commit is contained in:
LEEYONGJAE 2024-09-06 16:20:57 +09:00
parent 46a8344b0a
commit 09fd9690f8
6 changed files with 150 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.interplug.qcast.biz.myInfo.MyInfoMapper">
<select id="selectMyInfo" parameterType="com.interplug.qcast.biz.myInfo.dto.MyInfoRequest" resultType="com.interplug.qcast.biz.myInfo.dto.MyInfoResponse">
/* sqlid : com.interplug.qcast.myInfo.selectMyInfo (사용자 정보 조회) */
select u.user_id
, u.password
, u.name
, u.name_kana
, u.category
, u.tel
, u.fax
, u.mail
, g.group_id
, g.group_name
from m_user u inner join m_group g
on u.group_id = g.group_id
where u.user_id = #{userId}
</select>
</mapper>