Skip to content

Conversation

@geniusYoo
Copy link
Contributor

Related issue 🛠

Work Description ✏️

1. 운영 관련 테이블 추가

  • 운영에 관련된 정보들을 담을 테이블인 OperationConfig를 추가했어요.
  • 어떤 뷰(기능)에서 쓰이는 지 명시할 operationConfigCategory와 해당 값의 타입을 명시할 operationConfigType 을 포함했어요.
  • 변수명에 해당하는 key와 사용처인 operationConfigCategory와 같은 값은 DB에 존재할 수 없도록 제약 조건을 추가했어요.
  • 예를 들어, 플로팅 버튼에 들어가는 제목을 해당 테이블에 추가한다고 가정할게요. 그렇다면 아래와 같이 구성하면 돼요.
    • operationConfigCategoryFLOATING_BUTTON
    • operationConfigTypeTEXT
    • keytitle
    • value플로팅 버튼 이름
// OperationConfig
@Table(name = "operation_configs" ,
        uniqueConstraints = {
            @UniqueConstraint(
                    name = "uk_operation_config_category_key",
                    columnNames = {"operation_config_category", "key"}
            )
})

public class OperationConfig extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false)
    private String key;

    @Column(nullable = false)
    private String value;

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    private OperationConfigType operationConfigType;

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    private OperationConfigCategory operationConfigCategory;

    @Column(nullable = false)
    private String description;
}

// OperationConfigCategory
public enum OperationConfigCategory {
    FLOATING_BUTTON
}

// OperationConfigType
public enum OperationConfigType {
    DEEP_LINK,
    WEB_LINK,
    TEXT,
    IMAGE_URL
}

2. 플로팅 버튼 정보 조회 api

controller

  • 유저 정보가 필요하기 때문에 AuthenticationPrincipal을 사용했어요. WebSecurityConfig에서는 비회원이어도 조회는 가능하도록 whiteList에 추가해두었어요.
    @Operation(summary = "플로팅 버튼 정보 조회")
    @ApiResponses({
    @ApiResponse(responseCode = "200", description = "success"),
    @ApiResponse(responseCode = "401", description = "token error", content = @Content),
    @ApiResponse(responseCode = "500", description = "server error", content = @Content)
    })
    @GetMapping("/floating-button")
    public ResponseEntity<FloatingButtonResponse> getFloatingButtonInfo(
    @AuthenticationPrincipal User user
    ) {
    return ResponseEntity.ok(
    homeFacade.getFloatingButtonInfo(user)
    );

facade

  • 노출 여부는 다음과 같이 정리했어요.

    • 비회원 (user==null) : isActive false
    • 활동기수 : app-service 테이블 FLOATING_BUTTON row의 active_user value
    • 비활동기수 : app-service 테이블 FLOATING_BUTTON row의 inactive_user value
    • 활동/비활동 기수의 플로팅 버튼 노출 여부는 app-service 테이블의 값으로 토글링할 수 있도록 구현했어요.
  • 노출 여부를 정했으면, 플로팅 버튼에 띄울 카테고리를 쿼리에 넣어 OperationConfig 테이블을 조회하여, Map 형태로 구성했어요.

  • 빌드된 Map을 각 Dto에 주입하여 리턴하도록 했어요.

    @Transactional(readOnly = true)
    public FloatingButtonResponse getFloatingButtonInfo(User user) {
    boolean isActive = false;
    if (user != null) {
    UserStatus userStatus = playgroundAuthService.getPlaygroundUserActiveInfo(
    user.getPlaygroundToken(),
    user.getPlaygroundId()
    ).status();
    isActive = userStatus == UserStatus.ACTIVE ?
    appServiceService.getAppService(AppServiceName.FLOATING_BUTTON.getServiceName()).getActiveUser() :
    appServiceService.getAppService(AppServiceName.FLOATING_BUTTON.getServiceName()).getInactiveUser();
    }
    Map<String, String> operationConfigMap = operationConfigService.getOperationConfigByOperationConfigType(OperationConfigCategory.FLOATING_BUTTON).stream()
    .collect(Collectors.toMap(OperationConfig::getKey, OperationConfig::getValue));
    return FloatingButtonResponse.of(
    operationConfigMap.get("imageUrl"),
    operationConfigMap.get("title"),
    operationConfigMap.get("expandedSubTitle"),
    operationConfigMap.get("collapsedSubtitle"),
    operationConfigMap.get("actionButtonName"),
    operationConfigMap.get("linkUrl"),
    isActive
    );
    }
    }

service

response dto

additional

  • 앱 서비스 진입 여부 조회 api에서 플로팅 버튼에 관련한 내용은 제외되도록 필터 메서드에 조건을 추가했어요.

    .filter(appService -> !(
    AppServiceName.of(appService.getServiceName()).equals(AppServiceName.OTHERS) ||
    AppServiceName.of(appService.getServiceName()).equals(AppServiceName.FLOATING_BUTTON)))

  • 홈 화면의 서비스들 (솝탬프, 콕찌르기, 솝마디)이 dev, prod가 순서가 동일하지 않은 이슈가 있었는데, 이는 createdAt reversed로 정렬하고 있었어요. 이는 간단하게 createdAt을 수정해서 순서를 똑바로 맞춰줬어요.

  • FAB 딥링크는 임시로 home/soptamp로 지정했어요.

Trouble Shooting ⚽️

Related ScreenShot 📷

Uncompleted Tasks 😅

To Reviewers 📢

@geniusYoo geniusYoo self-assigned this May 19, 2025
@geniusYoo geniusYoo added the ✨ Feat 새로운 피쳐 생성 label May 19, 2025
@height
Copy link

height bot commented May 19, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new API to retrieve information for the floating button feature, along with supporting domain changes for operation configuration.

  • Added a new FloatingButtonResponse DTO and corresponding GET endpoint in HomeController
  • Added an OperationConfig entity, repository, and service to provide configuration data for floating button
  • Updated service and facade logic to determine the floating button’s active status based on user status, and adjusted filtering in app service entries

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
FloatingButtonResponse.java New DTO created for floating button response data
HomeController.java Added GET mapping and Swagger annotations for floating button info
OperationConfigRepository.java Introduced repository method for fetching operation configs by category
AppServiceRepository.java Updated query method for app service lookup
HomeFacade.java Added method to assemble floating button info using operation configs and user status
WebSecurityConfig.java Updated URL whitelist to include new floating button endpoint
OperationConfigType.java, OperationConfigCategory.java, OperationConfig.java New domain classes and enums for operation configuration
OperationConfigService.java Added service method to retrieve operation configuration for a specific category
AppServiceService.java Updated filtering to exclude FLOATING_BUTTON and added retrieval method for app service info
AppServiceName.java Added FLOATING_BUTTON constant to enum

Copy link
Collaborator

@hyerinhwang-sailin hyerinhwang-sailin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

운영용 설정 데이터를 확장성 있게 관리할 수 있도록 고민하신 게 보여 좋네요!
이후 추가할 데이터들 관리가 덕분에 용이해질 듯합니다~ 👏👏

@geniusYoo geniusYoo merged commit e7e6660 into dev May 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feat 새로운 피쳐 생성 size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] FAB 정보 조회 api 추가

2 participants