Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build/
src/main/resources/application.yml
src/main/resources/application.properties
.env
*.env
deploy-*
*TestController*
*TestService*
Expand Down
78 changes: 39 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
######### intellij 자체 λΉŒλ“œ ν›„ 데이터 μΆ”κ°€ ###############
# 1. 곡식 Tomcat 이미지 기반 (버전은 ν•„μš”μ— 맞게 μ‘°μ •)
########## intellij 자체 λΉŒλ“œ ν›„ 데이터 μΆ”κ°€ ###############
## 1. 곡식 Tomcat 이미지 기반 (버전은 ν•„μš”μ— 맞게 μ‘°μ •)
#FROM tomcat:9.0-jdk17
#
## 2. μ‹œκ°„λŒ€ μ„€μ • (ν•œκ΅­ μ‹œκ°„)
#ENV TZ=Asia/Seoul
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#
## 3. κΈ°μ‘΄ webapps 디렉토리 제거 (λΆˆν•„μš”ν•œ κΈ°λ³Έ μ•± 제거)
#RUN rm -rf /usr/local/tomcat/webapps/*
#
#COPY build/libs/plan-it-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war
#
#EXPOSE 8080


######## container 자체 λΉŒλ“œ ###############
# 1) Builder 단계: Gradle + JDK17둜 WAR λΉŒλ“œ
FROM gradle:7.6-jdk17 AS builder
WORKDIR /home/gradle/project

# ν”„λ‘œμ νŠΈ 파일 전체λ₯Ό 볡사 (μΊμ‹œ νš¨μœ¨λ³΄λ‹€ λ‹¨μˆœ ν˜Έν™˜μ„± μš°μ„ )
COPY --chown=gradle:gradle . .

# ν…ŒμŠ€νŠΈ μ œμ™Έν•˜κ³  WAR 생성
RUN gradle clean build -x test --no-daemon

# 2) Run 단계: Tomcat에 WAR 배포
FROM tomcat:9.0-jdk17

# 2. μ‹œκ°„λŒ€ μ„€μ • (ν•œκ΅­ μ‹œκ°„)
# ν•œκ΅­ μ‹œκ°„λŒ€ μ„€μ •
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone

# 3. κΈ°μ‘΄ webapps 디렉토리 제거 (λΆˆν•„μš”ν•œ κΈ°λ³Έ μ•± 제거)
# κΈ°λ³Έ μ›Ήμ•± 제거
RUN rm -rf /usr/local/tomcat/webapps/*

COPY build/libs/plan-it-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war
# Builder λ‹¨κ³„μ—μ„œ μƒμ„±λœ WARλ₯Ό ROOT.war둜 볡사
# λΉŒλ“œ κ²°κ³Όλ¬Ό μœ„μΉ˜κ°€ build/libs/*.war λΌλŠ” 점에 유의
COPY --from=builder /home/gradle/project/build/libs/*.war \
/usr/local/tomcat/webapps/ROOT.war

# μ»¨ν…Œμ΄λ„ˆ λ…ΈμΆœ 포트
EXPOSE 8080


######### container 자체 λΉŒλ“œ ###############
## 1) Builder 단계: Gradle + JDK17둜 WAR λΉŒλ“œ
#FROM gradle:7.6-jdk17 AS builder
#WORKDIR /home/gradle/project
#
## ν”„λ‘œμ νŠΈ 파일 전체λ₯Ό 볡사 (μΊμ‹œ νš¨μœ¨λ³΄λ‹€ λ‹¨μˆœ ν˜Έν™˜μ„± μš°μ„ )
#COPY --chown=gradle:gradle . .
#
## ν…ŒμŠ€νŠΈ μ œμ™Έν•˜κ³  WAR 생성
#RUN gradle clean build -x test --no-daemon
#
## 2) Run 단계: Tomcat에 WAR 배포
#FROM tomcat:9.0-jdk17
#
## ν•œκ΅­ μ‹œκ°„λŒ€ μ„€μ •
#ENV TZ=Asia/Seoul
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
# && echo $TZ > /etc/timezone
#
## κΈ°λ³Έ μ›Ήμ•± 제거
#RUN rm -rf /usr/local/tomcat/webapps/*
#
## Builder λ‹¨κ³„μ—μ„œ μƒμ„±λœ WARλ₯Ό ROOT.war둜 볡사
## λΉŒλ“œ κ²°κ³Όλ¬Ό μœ„μΉ˜κ°€ build/libs/*.war λΌλŠ” 점에 유의
#COPY --from=builder /home/gradle/project/build/libs/*.war \
# /usr/local/tomcat/webapps/ROOT.war
#
## μ»¨ν…Œμ΄λ„ˆ λ…ΈμΆœ 포트
#EXPOSE 8080
#
## Tomcat 기동
#CMD ["catalina.sh", "run"]
# Tomcat 기동
CMD ["catalina.sh", "run"]
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ dependencies {
implementation "org.springframework:spring-tx:${springVersion}"
implementation "org.springframework:spring-jdbc:${springVersion}"

implementation 'org.mybatis:mybatis:3.4.6'
implementation 'org.mybatis:mybatis-spring:1.3.2'
implementation 'org.mybatis:mybatis:3.5.14'
implementation 'org.mybatis:mybatis-spring:2.1.2'

implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4:1.16'
implementation 'org.apache.logging.log4j:log4j-api:2.0.1'
Expand Down Expand Up @@ -139,6 +139,8 @@ dependencies {
implementation "io.micrometer:micrometer-core:1.13.1"
implementation "io.micrometer:micrometer-registry-prometheus:1.13.1"
implementation "io.micrometer:micrometer-jakarta9:1.13.1"
implementation 'io.micrometer:micrometer-core:1.7.6'


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import woojooin.planit.domain.member.domain.MemberProduct;

@Data
@AllArgsConstructor
Expand All @@ -20,6 +21,7 @@ public class Action {
private String accountNumber;

private Long memberProductId;
private MemberProduct memberProduct;

private Integer allocatedRate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public interface ActionMapper {
List<Action> findActionsByGoalId(Long goalId);

int saveAll(List<Action> action);

Action findByMemberProductId(Long memberProductId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class IsaAccountProductEditReq {

@NonNull
private Long goalId;

@NonNull
private Long memberProductId;

private String accountType = "ISA";

@NonNull
private boolean checked;
}
41 changes: 20 additions & 21 deletions src/main/java/woojooin/planit/domain/goal/mapper/GoalMapper.java
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
package woojooin.planit.domain.goal.mapper;

import org.apache.ibatis.annotations.MapKey;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import woojooin.planit.domain.goal.domain.Goal; // λ³€κ²½λœ Goal VO μž„ν¬νŠΈ
import woojooin.planit.domain.goal.domain.Goal;
import woojooin.planit.domain.goal.domain.GoalProgress;

import woojooin.planit.domain.goal.dto.DepositAccountDto;
import woojooin.planit.domain.goal.dto.IsaProductDto;
import woojooin.planit.domain.goal.dto.res.GoalDepositResponse;
import woojooin.planit.domain.goal.isa.dto.res.IsaAccountProductRes;
import woojooin.planit.domain.goal.deposit.dto.res.DepositAccountRes;

import java.util.List;
import java.util.Map;

@Mapper
public interface GoalMapper {

int insertGoal(Goal goal);
Goal findById(@Param("id") long id);

int insertGoal(Goal goal);

Goal selectGoalById(@Param("memberId") Long memberId,@Param("goalId") Long goalId);
Goal selectGoalById(@Param("memberId") Long memberId, @Param("goalId") Long goalId);

List<Goal> selectAllGoals(Long memberId);
List<Goal> selectAllGoals(Long memberId);

int updateGoal(Goal goal);
int updateGoal(Goal goal);

int deleteGoal(@Param("goalId") Long goalId, @Param("memberId") Long memberId);
int deleteGoal(@Param("goalId") Long goalId, @Param("memberId") Long memberId);

int softDeleteActionsByGoalId(@Param("goalId") Long goalId, @Param("memberId") Long memberId);
int softDeleteActionsByGoalId(@Param("goalId") Long goalId, @Param("memberId") Long memberId);

List<IsaAccountProductRes> findAllocatedIsaByGoal(@Param("memberId") Long memberId, @Param("goalId") Long goalId);
List<IsaAccountProductRes> findAllocatedIsaByGoal(@Param("memberId") Long memberId, @Param("goalId") Long goalId);

List<GoalDepositResponse> findAllocatedDepositByGoal(@Param("memberId") Long memberId, @Param("goalId") Long goalId);
List<GoalDepositResponse> findAllocatedDepositByGoal(@Param("memberId") Long memberId,
@Param("goalId") Long goalId);

List<DepositAccountDto> selectDepositAccountsByGoalId(Long goalId);
List<DepositAccountDto> selectDepositAccountsByGoalId(Long goalId);

List<IsaProductDto> selectIsaProductsByGoalId(Long goalId);
List<IsaProductDto> selectIsaProductsByGoalId(Long goalId);

// λͺ©ν‘œ κΈˆμ•‘ 쑰회
Long selectGoalTargetAmount(Long goalId);
// λͺ©ν‘œ κΈˆμ•‘ 쑰회
Long selectGoalTargetAmount(Long goalId);

List<GoalProgress> selectGoalProgressByGoalId(@Param("goalId") Long goalId);
List<GoalProgress> selectGoalProgressByGoalId(@Param("goalId") Long goalId);

List<GoalProgress> selectDailyGoalProgressLast6Months(@Param("goalId") Long goalId);
List<GoalProgress> selectDailyGoalProgressLast6Months(@Param("goalId") Long goalId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ public class Member {
private Double liquid;
private Double growth;
private Double diversified;
private String fcmToken;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import woojooin.planit.domain.goal.action.domain.Action;
import woojooin.planit.domain.product.domain.ProductTypeCode;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MemberProduct {

private Long memberProductId;
private Long memberId;
private Long accountId;
private List<Action> actionList;
private Member member;

// ==== μƒν’ˆ 정보 ====
private ProductTypeCode productTypeCode; // μƒν’ˆμœ ν˜•μ½”λ“œ
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package woojooin.planit.domain.member.mapper;

import org.apache.ibatis.annotations.Param;

import woojooin.planit.domain.member.domain.Member;

public interface MemberMapper {
Member findById(Long memberId);
Member findByEmail(String email);
void insert(Member member);
void update(Member member);
void delete(Long memberId);

void updateInvestType(@Param("memberId") Long memberId, @Param("type") String type);

String findByConnectedIdString(@Param("memberId") Long memberId);

void updateConnectedId(@Param("memberId") Long memberId, @Param("connectedId") String connectedId);
String findInvestTypeById(@Param("memberId") Long memberId);

void updateIsaType(@Param("memberId") Long memberId, @Param("isaType") String isaType);
Member findById(Long memberId);

Member findByEmail(String email);

void insert(Member member);

void update(Member member);

void delete(Long memberId);

void updateInvestType(@Param("memberId") Long memberId, @Param("type") String type);

String findByConnectedIdString(@Param("memberId") Long memberId);

void updateConnectedId(@Param("memberId") Long memberId, @Param("connectedId") String connectedId);

String findInvestTypeById(@Param("memberId") Long memberId);

void updateIsaType(@Param("memberId") Long memberId, @Param("isaType") String isaType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
import woojooin.planit.domain.member.domain.MemberProduct;

public interface MemberProductMapper {

MemberProduct findById(@Param("id") Long memberProductId);

void insert(MemberProduct memberProduct);

void insertBatch(List<MemberProduct> memberProducts);

MemberProduct findByMemberId(@Param("memberProductId") Long memberProductId);
MemberProduct findByMemberProductId(@Param("memberProductId") Long memberProductId);

List<MemberProduct> select(Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.List;

import org.apache.ibatis.annotations.Param;

import woojooin.planit.domain.product.domain.Product;

public interface ProductMapper {
Expand All @@ -10,5 +12,8 @@ public interface ProductMapper {
Product selectBySrtnCd(String srtncd);

Product findByProductId(Long productId);

Product findByShortenCode(@Param("shortenCode") String shortenCode);

Long selectProductIdByItemName(String itemName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
@Mapper
public interface RebalanceMapper {

Rebalance findById(@Param("id") long id);

/** 단일 λ¦¬λ°ΈλŸ°μ‹± λ‚΄μ—­ μ €μž₯ */
int insert(Rebalance rebalance);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import woojooin.planit.domain.goal.domain.Goal;
import woojooin.planit.domain.member.domain.MemberProduct;
import woojooin.planit.domain.product.domain.Product;
import woojooin.planit.domain.rebalance.enums.InvestType;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Rebalance {

private Goal goal;
private Product product;
private MemberProduct memberProduct;

private Long rebalanceId;
private String productCode;
private Long memberProductId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class GoalMsg {

private Long memberId;
private Long goalId;
private String goalName;
private Integer achievementRate;
private Integer tryCount;
}
6 changes: 6 additions & 0 deletions src/main/resources/mapper/ActionMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<result property="updatedAt" column="updated_at"/>
</resultMap>

<select id="findByMemberProductId" parameterType="long" resultMap="ActionResultMap">
SELECT *
FROM action
WHERE member_product_id = #{memberProductId}
</select>

<select id="findActionsByGoalId" parameterType="long" resultMap="ActionResultMap">
SELECT *
FROM action
Expand Down
Loading