Merge branch 'tolag'

This commit is contained in:
leejunho 2023-05-16 15:59:21 +09:00
commit f1bf0b7625
5 changed files with 105 additions and 6 deletions

View File

@ -13,4 +13,6 @@ package com.itn.mjonApi.mjon.api.inqry.service;
*/
public interface PriceService {
}

View File

@ -0,0 +1,58 @@
package com.itn.mjonApi.mjon.api.inqry.service.mapper.domain;
import lombok.Getter;
import lombok.Setter;
import org.springframework.http.HttpStatus;
import java.time.LocalDateTime;
import java.util.List;
@Setter
@Getter
public class PriceResponse {
//private HttpStatus status;
private int resultCode;
private String message;
private LocalDateTime localDateTime;
private Object object;
private List<?> objectList;
/*
* 200-OK : 정상접속
* 401-Unauthorized : 인증실패
*
* */
public PriceResponse(HttpStatus status, String message, LocalDateTime timestamp) {
this.resultCode = status.value();
checkMessage(status, message);
this.localDateTime = timestamp;
}
public PriceResponse(HttpStatus status, String message, LocalDateTime timestamp, Object object) {
this.resultCode = status.value();
checkMessage(status, message);
this.object= object;
this.localDateTime = timestamp;
}
public PriceResponse(HttpStatus status, String message, LocalDateTime timestamp, List<?> objectList) {
this.resultCode = status.value();
checkMessage(status, message);
this.objectList = objectList;
this.localDateTime = timestamp;
}
private void checkMessage(HttpStatus status, String message) {
if ("".equals(message)){ this.message = status.name();
}else { this.message = message; }
}
}

View File

@ -0,0 +1,24 @@
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; //발송 가능건
}

View File

@ -8,6 +8,7 @@ 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 lombok.extern.slf4j.Slf4j;
@ -27,16 +28,22 @@ import lombok.extern.slf4j.Slf4j;
public class PriceRestController {
/**
* @methodName : selectSpamTxtChkAjax
* @methodName : selectPrice
* @author : JunHo Lee
* @date : 2023.05.15
* @param mjonMsgVO
* @date : 2023.05.16
* @return
*/
@PostMapping("/api/selectPrice")
public ResponseEntity<PlainResponse> selectPrice(){
@PostMapping("/api/inqry/selectPrice")
public ResponseEntity<PlainResponse> selectPrice(PriceVO priceVO){
System.out.println(priceVO.getMberId());
//1. 잔액
//2. 이용단가
//3. 발송가능건수
return ResponseEntity.ok(new PlainResponse(HttpStatus.OK, "test" , LocalDateTime.now(), ""));
}

View File

@ -0,0 +1,8 @@
<?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.itn.mjonApi.mjon.api.inqry.service.mapper.PriceMapper">
</mapper>