Merge branch 'tolag'
This commit is contained in:
commit
820fa2d58a
@ -2,8 +2,10 @@ package com.itn.mjonApi.mjon.api.inqry.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
|
||||
* @author : JunHo Lee
|
||||
* @date : 2023.05.15
|
||||
@ -15,6 +17,15 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
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.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;
|
||||
|
||||
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO;
|
||||
|
||||
/**
|
||||
* @packageName : com.itn.mjonApi.mjon.api.inqry.service
|
||||
* @fileName : PriceService.java
|
||||
@ -13,6 +15,6 @@ package com.itn.mjonApi.mjon.api.inqry.service;
|
||||
*/
|
||||
public interface PriceService {
|
||||
|
||||
|
||||
double selectUserMoney(PriceVO priceVO) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
/**
|
||||
@ -17,5 +20,12 @@ import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
||||
*/
|
||||
@Service
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.itn.mjonApi.cmn.msg.PlainResponse;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.PriceVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceResponse;
|
||||
import com.itn.mjonApi.mjon.api.inqry.mapper.domain.PriceVO;
|
||||
import com.itn.mjonApi.mjon.api.inqry.service.PriceService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -27,6 +29,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
public class PriceRestController {
|
||||
|
||||
@Autowired
|
||||
private PriceService priceService;
|
||||
|
||||
/**
|
||||
* @methodName : selectPrice
|
||||
* @author : JunHo Lee
|
||||
@ -34,19 +39,26 @@ public class PriceRestController {
|
||||
* @return
|
||||
*/
|
||||
@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());
|
||||
//1. 잔액
|
||||
|
||||
|
||||
System.out.println("mac commit test.");
|
||||
try {
|
||||
// resultVO.builder()
|
||||
// .userMoney(priceService.selectUserMoney(priceVO)).b;
|
||||
resultVO = PriceVO.builder()
|
||||
.userMoney(priceService.selectUserMoney(priceVO))
|
||||
.build();
|
||||
//2. 이용단가
|
||||
|
||||
//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"
|
||||
"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>
|
||||
Loading…
Reference in New Issue
Block a user