refactor: idgen 구조 추가
This commit is contained in:
parent
720d08ed0e
commit
4a3b517791
13
pom.xml
13
pom.xml
@ -36,11 +36,14 @@
|
||||
<artifactId>h2</artifactId>
|
||||
<!-- <scope>test</scope>-->
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.mariadb.jdbc</groupId>-->
|
||||
<!-- <artifactId>mariadb-java-client</artifactId>-->
|
||||
<!-- <scope>runtime</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.modelmapper/modelmapper -->
|
||||
<dependency>
|
||||
<groupId>org.modelmapper</groupId>
|
||||
<artifactId>modelmapper</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.itn.mjonApi.cmn.idgen.mapper;
|
||||
|
||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface IdgenMapper {
|
||||
|
||||
// @Select("select * from ids")
|
||||
List<IdgenVO> findByTableName(String tableName);
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.itn.mjonApi.mjon.member.mapper.domain;
|
||||
package com.itn.mjonApi.cmn.idgen.mapper.domain;
|
||||
/*
|
||||
table : mj_mymsg
|
||||
comment : '내문자 보관함';
|
||||
@ -6,12 +6,15 @@ package com.itn.mjonApi.mjon.member.mapper.domain;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MyMsgVO {
|
||||
public class IdgenVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7865729705175845268L;
|
||||
private Integer msgId; /*auto_increment comment '문자 고유아이디' primary key*/
|
||||
private String mberId; /*comment '회원 아이디'*/
|
||||
private String esntlId; /*null comment '회원고유 아이디'*/
|
||||
@ -1,6 +1,6 @@
|
||||
package com.itn.mjonApi.mjon.member.mapper;
|
||||
|
||||
import com.itn.mjonApi.mjon.member.mapper.domain.MyMsgVO;
|
||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@ -10,8 +10,8 @@ import java.util.List;
|
||||
public interface MyMsgMapper {
|
||||
|
||||
/**/
|
||||
List<MyMsgVO> findAll();
|
||||
List<IdgenVO> findAll();
|
||||
|
||||
@Select("select * from MJ_MYMSG")
|
||||
List<MyMsgVO> findAll_2();
|
||||
List<IdgenVO> findAll_2();
|
||||
}
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
package com.itn.mjonApi.mjon.member.service;
|
||||
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.member.mapper.domain.MyMsgVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MemberService {
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ package com.itn.mjonApi.mjon.member.service.impl;
|
||||
|
||||
import com.itn.mjonApi.cmn.msg.RestResponse;
|
||||
import com.itn.mjonApi.mjon.member.mapper.MyMsgMapper;
|
||||
import com.itn.mjonApi.mjon.member.mapper.domain.MyMsgVO;
|
||||
import com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO;
|
||||
import com.itn.mjonApi.mjon.member.service.MemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -17,15 +17,16 @@ public class MemberServiceImpl implements MemberService {
|
||||
@Autowired
|
||||
MyMsgMapper myMsgMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public RestResponse findAll() {
|
||||
List<MyMsgVO> MyMsgListVO = myMsgMapper.findAll();
|
||||
List<IdgenVO> MyMsgListVO = myMsgMapper.findAll();
|
||||
return new RestResponse(HttpStatus.OK, "성공", MyMsgListVO, LocalDateTime.now());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestResponse findAll2() {
|
||||
List<MyMsgVO> MyMsgListVO = myMsgMapper.findAll_2();
|
||||
List<IdgenVO> MyMsgListVO = myMsgMapper.findAll_2();
|
||||
return new RestResponse(HttpStatus.OK, "성공", MyMsgListVO, LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.itn.mjonApi.mjon.send.web;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* packageName : com.itn.mjonApi.mjon.send.web
|
||||
* fileName : SendRestController
|
||||
* author : hylee
|
||||
* date : 2023-02-15
|
||||
* description :
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* -----------------------------------------------------------
|
||||
* 2023-02-15 hylee 최초 생성
|
||||
*/
|
||||
@RestController
|
||||
public class SendRestController {
|
||||
|
||||
|
||||
}
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
<mapper namespace="com.itn.mjonApi.mjon.member.mapper.MyMsgMapper">
|
||||
|
||||
<select id="findAll" resultType="com.itn.mjonApi.mjon.member.mapper.domain.MyMsgVO">
|
||||
<select id="findAll" resultType="com.itn.mjonApi.cmn.idgen.mapper.domain.IdgenVO">
|
||||
SELECT
|
||||
*
|
||||
FROM MJ_MYMSG
|
||||
|
||||
Loading…
Reference in New Issue
Block a user