-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ng-user-for-AB-Test Grouping A/B Test User - used in SDUI
- Loading branch information
Showing
21 changed files
with
124 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
API-Server/src/main/java/swm/hkcc/LGTM/app/modules/serverDrivenUI/constant/ABTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package swm.hkcc.LGTM.app.modules.serverDrivenUI.constant; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum ABTest { | ||
HOME_SCREEN_SEQUENCE_TEST("homeScreenSequenceTest"), // 홈화면에서 어떤 view type들의 순서가 success metric 을 향상시키는지 테스트 | ||
HOME_SCREEN_RECOMMENDATION_FEATURE_TEST("homeScreenRecommendationFeatureTest"), // 홈화면에서 어떤 추천 기능이 success metric 을 향상시키는지 테스트 | ||
; | ||
private final String testName; | ||
} |
2 changes: 1 addition & 1 deletion
2
...GTM/app/modules/serverDrivenUI/Theme.java → ...odules/serverDrivenUI/constant/Theme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../app/modules/serverDrivenUI/ViewType.java → ...les/serverDrivenUI/constant/ViewType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
API-Server/src/main/java/swm/hkcc/LGTM/app/modules/serverDrivenUI/domain/ABTestService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package swm.hkcc.LGTM.app.modules.serverDrivenUI.domain; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional | ||
public class ABTestService { | ||
private final ABTestUserGroupRepository abTestUserGroupRepository; | ||
|
||
public String getGroupName(Long memberId, String testName) { | ||
return abTestUserGroupRepository.findGroupNameByMemberIdAndTestName(memberId, testName) | ||
.orElse("A"); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...Server/src/main/java/swm/hkcc/LGTM/app/modules/serverDrivenUI/domain/ABTestUserGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package swm.hkcc.LGTM.app.modules.serverDrivenUI.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Builder | ||
@ToString | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
public class ABTestUserGroup { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long abTestUserGroupId; | ||
|
||
@Column(nullable = false) | ||
private Long memberId; | ||
|
||
@Column(nullable = false) | ||
private String testName; | ||
|
||
@Column(nullable = false) | ||
private String groupName; | ||
} |
12 changes: 12 additions & 0 deletions
12
.../main/java/swm/hkcc/LGTM/app/modules/serverDrivenUI/domain/ABTestUserGroupRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package swm.hkcc.LGTM.app.modules.serverDrivenUI.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
import java.util.Optional; | ||
|
||
public interface ABTestUserGroupRepository extends JpaRepository<ABTestUserGroup, Long> { | ||
@Query("select a.groupName from ABTestUserGroup a where a.memberId = ?1 and a.testName = ?2") | ||
Optional<String> findGroupNameByMemberIdAndTestName(Long memberId, String testName); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...main/java/swm/hkcc/LGTM/app/modules/serverDrivenUI/exception/UserABTestGroupNotFound.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package swm.hkcc.LGTM.app.modules.serverDrivenUI.exception; | ||
|
||
import swm.hkcc.LGTM.app.global.constant.ResponseCode; | ||
import swm.hkcc.LGTM.app.global.exception.GeneralException; | ||
|
||
public class UserABTestGroupNotFound extends GeneralException { | ||
public UserABTestGroupNotFound() { | ||
super(ResponseCode.USER_AB_TEST_GROUP_NOT_FOUND); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters