mirror of
https://github.com/won-ktds/smarketing-backend.git
synced 2026-06-12 20:39:09 +00:00
add: init project
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
dependencies {
|
||||
implementation project(':common')
|
||||
|
||||
implementation 'com.mysql:mysql-connector-j'
|
||||
|
||||
// HTTP Client for external API
|
||||
implementation 'org.springframework.boot:spring-boot-starter-webflux'
|
||||
}
|
||||
|
||||
//external:
|
||||
// ai:
|
||||
// api-url: ${EXTERNAL_AI_URL:https://api.openai.com/v1}
|
||||
// api-key: ${EXTERNAL_AI_KEY:your-api-key}
|
||||
|
||||
bootJar {
|
||||
archiveFileName = "ai-recommend-service.jar"
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,11 +6,11 @@ import com.won.smarketing.recommend.presentation.dto.MarketingTipRequest;
|
||||
import com.won.smarketing.recommend.presentation.dto.MarketingTipResponse;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* AI 마케팅 추천을 위한 REST API 컨트롤러
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 상세 AI 마케팅 팁 응답 DTO
|
||||
* AI 마케팅 팁과 함께 생성 시 사용된 환경 데이터도 포함합니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "상세 AI 마케팅 팁 응답")
|
||||
public class DetailedMarketingTipResponse {
|
||||
|
||||
@Schema(description = "팁 ID", example = "1")
|
||||
private Long tipId;
|
||||
|
||||
@Schema(description = "AI 생성 마케팅 팁 내용 (100자 이내)")
|
||||
private String tipContent;
|
||||
|
||||
@Schema(description = "팁 생성 시간", example = "2024-01-15T10:30:00")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "팁 생성 시 참고된 날씨 정보")
|
||||
private WeatherInfoDto weatherInfo;
|
||||
|
||||
@Schema(description = "팁 생성 시 참고된 매장 정보")
|
||||
private StoreInfoDto storeInfo;
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 에러 응답 DTO
|
||||
* AI 추천 서비스에서 발생하는 에러 정보를 전달합니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "에러 응답")
|
||||
public class ErrorResponseDto {
|
||||
|
||||
@Schema(description = "에러 코드", example = "AI_SERVICE_ERROR")
|
||||
private String errorCode;
|
||||
|
||||
@Schema(description = "에러 메시지", example = "AI 서비스 연결에 실패했습니다")
|
||||
private String message;
|
||||
|
||||
@Schema(description = "에러 발생 시간", example = "2024-01-15T10:30:00")
|
||||
private LocalDateTime timestamp;
|
||||
|
||||
@Schema(description = "요청 경로", example = "/api/recommendation/marketing-tips")
|
||||
private String path;
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* AI 마케팅 팁 생성을 위한 내부 요청 DTO
|
||||
* 애플리케이션 계층에서 AI 서비스 호출 시 사용됩니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "AI 마케팅 팁 생성 내부 요청")
|
||||
public class MarketingTipGenerationRequest {
|
||||
|
||||
@NotNull(message = "매장 정보는 필수입니다")
|
||||
@Schema(description = "매장 정보", required = true)
|
||||
private StoreInfoDto storeInfo;
|
||||
|
||||
@Schema(description = "현재 날씨 정보")
|
||||
private WeatherInfoDto weatherInfo;
|
||||
|
||||
@Schema(description = "팁 생성 옵션", example = "일반")
|
||||
private String tipType;
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* AI 마케팅 팁 생성 요청 DTO
|
||||
* 매장 정보를 기반으로 개인화된 마케팅 팁을 요청할 때 사용됩니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "AI 마케팅 팁 생성 요청")
|
||||
public class MarketingTipRequest {
|
||||
|
||||
@NotNull(message = "매장 ID는 필수입니다")
|
||||
@Positive(message = "매장 ID는 양수여야 합니다")
|
||||
@Schema(description = "매장 ID", example = "1", required = true)
|
||||
private Long storeId;
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* AI 마케팅 팁 생성 응답 DTO
|
||||
* AI가 생성한 개인화된 마케팅 팁 정보를 전달합니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "AI 마케팅 팁 생성 응답")
|
||||
public class MarketingTipResponse {
|
||||
|
||||
@Schema(description = "팁 ID", example = "1")
|
||||
private Long tipId;
|
||||
|
||||
@Schema(description = "AI 생성 마케팅 팁 내용 (100자 이내)",
|
||||
example = "오늘 같은 비 오는 날에는 따뜻한 음료와 함께 실내 분위기를 강조한 포스팅을 올려보세요. #비오는날카페 #따뜻한음료 해시태그로 감성을 어필해보세요!")
|
||||
private String tipContent;
|
||||
|
||||
@Schema(description = "팁 생성 시간", example = "2024-01-15T10:30:00")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 매장 정보 DTO
|
||||
* AI 마케팅 팁 생성 시 매장 특성을 반영하기 위한 정보입니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "매장 정보")
|
||||
public class StoreInfoDto {
|
||||
|
||||
@Schema(description = "매장명", example = "카페 원더풀")
|
||||
private String storeName;
|
||||
|
||||
@Schema(description = "업종", example = "카페")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "매장 위치", example = "서울시 강남구")
|
||||
private String location;
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.won.smarketing.recommend.presentation.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 날씨 정보 DTO
|
||||
* AI 마케팅 팁 생성 시 참고되는 환경 데이터입니다.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "날씨 정보")
|
||||
public class WeatherInfoDto {
|
||||
|
||||
@Schema(description = "기온 (섭씨)", example = "23.5")
|
||||
private Double temperature;
|
||||
|
||||
@Schema(description = "날씨 상태", example = "맑음")
|
||||
private String condition;
|
||||
|
||||
@Schema(description = "습도 (%)", example = "65.0")
|
||||
private Double humidity;
|
||||
}
|
||||
@@ -19,6 +19,12 @@ spring:
|
||||
dialect: org.hibernate.dialect.PostgreSQLDialect
|
||||
format_sql: true
|
||||
|
||||
ai:
|
||||
service:
|
||||
url: ${AI_SERVICE_URL:http://localhost:8080/ai}
|
||||
timeout: ${AI_SERVICE_TIMEOUT:30000}
|
||||
|
||||
|
||||
external:
|
||||
claude-ai:
|
||||
api-key: ${CLAUDE_AI_API_KEY:your-claude-api-key}
|
||||
|
||||
Reference in New Issue
Block a user