임산물현황 완료일거에요.

This commit is contained in:
주우성
2025-06-16 14:07:05 +09:00
parent 3ac0e7b0dd
commit c9085a6e91
14 changed files with 433 additions and 86 deletions

View File

@@ -0,0 +1,26 @@
package app.module.core.usecase.product.removeMonthForestProducts.adapters.persistence;
import app.module.core.config.application.util.CommonUtil;
import app.module.core.usecase.product.removeMonthForestProducts.adapters.persistence.model.RemoveMonthForestProductsParam;
import app.module.core.usecase.product.removeMonthForestProducts.ports.RemoveMonthForestProductsPortOut;
import app.module.core.usecase.product.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
@Repository
@RequiredArgsConstructor
class RemoveMonthForestProductsDao implements RemoveMonthForestProductsPortOut {
private final RemoveMonthForestProductsMapper mapper;
@Override
public void operate(RemoveMonthForestProductsCmd command) {
String loginUser = CommonUtil.getLoginUsername();;
LocalDateTime now = LocalDateTime.now();
mapper.deleteForestProducts(
new RemoveMonthForestProductsParam(command.getId(), command.getHouseholdSeq(), now, loginUser, now, loginUser));
}
}

View File

@@ -0,0 +1,9 @@
package app.module.core.usecase.product.removeMonthForestProducts.adapters.persistence;
import app.module.core.usecase.product.removeMonthForestProducts.adapters.persistence.model.RemoveMonthForestProductsParam;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface RemoveMonthForestProductsMapper {
void deleteForestProducts(RemoveMonthForestProductsParam param);
}

View File

@@ -0,0 +1,20 @@
package app.module.core.usecase.product.removeMonthForestProducts.adapters.persistence.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.Set;
@Getter
@Setter
@AllArgsConstructor
public class RemoveMonthForestProductsParam {
private Long id;
private Long householdSeq;
private LocalDateTime updatedAt;
private String updatedBy;
private LocalDateTime deletedAt;
private String deletedBy;
}

View File

@@ -0,0 +1,7 @@
package app.module.core.usecase.product.removeMonthForestProducts.ports;
import app.module.core.usecase.product.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
public interface RemoveMonthForestProductsPortIn {
void operate(RemoveMonthForestProductsCmd command);
}

View File

@@ -0,0 +1,7 @@
package app.module.core.usecase.product.removeMonthForestProducts.ports;
import app.module.core.usecase.product.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
public interface RemoveMonthForestProductsPortOut {
void operate(RemoveMonthForestProductsCmd command);
}

View File

@@ -0,0 +1,19 @@
package app.module.core.usecase.product.removeMonthForestProducts.ports.application;
import app.module.core.usecase.product.removeMonthForestProducts.ports.RemoveMonthForestProductsPortIn;
import app.module.core.usecase.product.removeMonthForestProducts.ports.RemoveMonthForestProductsPortOut;
import app.module.core.usecase.product.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
class RemoveMonthForestProductsService implements RemoveMonthForestProductsPortIn {
private final RemoveMonthForestProductsPortOut portOut;
@Override
public void operate(RemoveMonthForestProductsCmd command) {
portOut.operate(command);
}
}

View File

@@ -0,0 +1,17 @@
package app.module.core.usecase.product.removeMonthForestProducts.ports.application.domain;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import java.util.Set;
@Getter
@Setter
@AllArgsConstructor
@EqualsAndHashCode
public class RemoveMonthForestProductsCmd {
private Long id;
private Long householdSeq;
}

View File

@@ -0,0 +1,16 @@
<?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="app.module.core.usecase.product.removeMonthForestProducts.adapters.persistence.RemoveMonthForestProductsMapper">
<update id="deleteForestProducts">
/* deleteForestProducts : 게시물 삭제 */
UPDATE forest_product
SET <include refid="common.fields.DeleteBaseSet" />
WHERE
household_seq = #{householdSeq}
AND monthly_input_status_id = #{id}
</update>
</mapper>