Merge branch 'master' of
http://tolag3@vcs.iten.co.kr:9999/hylee/mjon_api
This commit is contained in:
parent
6f74a2f3f7
commit
bf1754e596
@ -2,8 +2,10 @@ package com.itn.mjonApi.mjon.api.inqry.mapper;
|
|||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @packageName : com.itn.mjonApi.mjon.api.inqry.service
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.service.mapper
|
||||||
* @fileName : PriceMapper.java
|
* @fileName : PriceMapper.java
|
||||||
* @author : JunHo Lee
|
* @author : JunHo Lee
|
||||||
* @date : 2023.05.15
|
* @date : 2023.05.15
|
||||||
@ -15,6 +17,15 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface PriceMapper {
|
public interface PriceMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @methodName : selectUserMoney
|
||||||
|
* @author : JunHo Lee
|
||||||
|
* @date : 2023.05.22
|
||||||
|
* @description :
|
||||||
|
* @param priceVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
double selectUserMoney(PriceVO priceVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
package com.itn.mjonApi.mjon.api.inqry.mapper.domain;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.itn.mjonApi.mjon.api.inqry.mapper.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PriceVO implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7865729705175845268L;
|
||||||
|
|
||||||
|
private String mberId; // 사용자 ID
|
||||||
|
|
||||||
|
private double shortPrice; // 단문 이용단가
|
||||||
|
private double longPrice; // 장문 이용단가
|
||||||
|
private double picturePrice; // 그림 이용단가
|
||||||
|
|
||||||
|
private double userMoney; // 잔액
|
||||||
|
|
||||||
|
private int shortSendPsbltEa; // 단문 발송 가능건 수
|
||||||
|
private int longSendPsbltEa; // 장문 발송 가능건 수
|
||||||
|
private int pictureSendPsbltEa; // 그림 발송 가능건 수
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
package com.itn.mjonApi.mjon.api.inqry.service;
|
package com.itn.mjonApi.mjon.api.inqry.service;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @packageName : com.itn.mjonApi.mjon.api.inqry.service
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.service
|
||||||
* @fileName : PriceService.java
|
* @fileName : PriceService.java
|
||||||
@ -13,6 +15,6 @@ package com.itn.mjonApi.mjon.api.inqry.service;
|
|||||||
*/
|
*/
|
||||||
public interface PriceService {
|
public interface PriceService {
|
||||||
|
|
||||||
|
double selectUserMoney(PriceVO priceVO) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.mapper.PriceMapper;
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO;
|
||||||
import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,5 +20,12 @@ import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class PriceServiceImpl implements PriceService {
|
public class PriceServiceImpl implements PriceService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PriceMapper priceMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double selectUserMoney(PriceVO priceVO) throws Exception {
|
||||||
|
return priceMapper.selectUserMoney(priceVO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class PriceVO implements Serializable{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -7865729705175845268L;
|
|
||||||
|
|
||||||
private String mberId; // 사용자 ID
|
|
||||||
|
|
||||||
// private double shortPrice; // 단문 이용단가
|
|
||||||
// private double longPrice; // 장문 이용단가
|
|
||||||
// private double picturePrice; // 그림 이용단가
|
|
||||||
|
|
||||||
// private double userMoney; // 잔액
|
|
||||||
|
|
||||||
// private int sendPsbltEa; //발송 가능건 수
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -2,13 +2,15 @@ package com.itn.mjonApi.mjon.api.inqry.web;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.msg.PlainResponse;
|
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceResponse;
|
||||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.PriceVO;
|
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO;
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@ -27,6 +29,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@RestController
|
@RestController
|
||||||
public class PriceRestController {
|
public class PriceRestController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PriceService priceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @methodName : selectPrice
|
* @methodName : selectPrice
|
||||||
* @author : JunHo Lee
|
* @author : JunHo Lee
|
||||||
@ -34,19 +39,26 @@ public class PriceRestController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/api/inqry/selectPrice")
|
@PostMapping("/api/inqry/selectPrice")
|
||||||
public ResponseEntity<PlainResponse> selectPrice(PriceVO priceVO){
|
public ResponseEntity<PriceResponse> selectPrice(PriceVO priceVO){
|
||||||
|
|
||||||
|
PriceVO resultVO = new PriceVO();
|
||||||
|
|
||||||
System.out.println(priceVO.getMberId());
|
System.out.println(priceVO.getMberId());
|
||||||
//1. 잔액
|
//1. 잔액
|
||||||
|
try {
|
||||||
|
// resultVO.builder()
|
||||||
System.out.println("mac commit test.");
|
// .userMoney(priceService.selectUserMoney(priceVO)).b;
|
||||||
|
resultVO = PriceVO.builder()
|
||||||
|
.userMoney(priceService.selectUserMoney(priceVO))
|
||||||
|
.build();
|
||||||
//2. 이용단가
|
//2. 이용단가
|
||||||
|
|
||||||
//3. 발송가능건수
|
//3. 발송가능건수
|
||||||
|
|
||||||
return ResponseEntity.ok(new PlainResponse(HttpStatus.OK, "test" , LocalDateTime.now(), ""));
|
} catch (Exception e) {
|
||||||
|
log.info("selectPrice Error [{}]", e.getMessage());
|
||||||
|
}
|
||||||
|
return ResponseEntity.ok(new PriceResponse(HttpStatus.OK, "test" , LocalDateTime.now(), resultVO.getUserMoney()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,17 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.itn.mjonApi.mjon.api.inqry.service.mapper.PriceMapper">
|
<mapper namespace="com.itn.mjonApi.mjon.api.inqry.mapper.PriceMapper">
|
||||||
|
|
||||||
|
<select id="selectUserMoney"
|
||||||
|
resultType="com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO"
|
||||||
|
>
|
||||||
|
|
||||||
|
SELECT a.MBER_ID AS mberId,
|
||||||
|
a.USER_MONEY AS userMoney
|
||||||
|
FROM lettngnrlmber a
|
||||||
|
WHERE a.MBER_ID = #{mberId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user