package com.caliverse.admin.domain.service;

import com.caliverse.admin.global.common.constants.AdminConstants;
import com.caliverse.admin.logs.logservice.businesslogservice.BusinessLogUserItemHistoryService;
import org.springframework.stereotype.Service;

import com.caliverse.admin.global.common.utils.CommonUtils;

import java.util.Map;

@Service
public class UserItemService {

    private final BusinessLogUserItemHistoryService historyService;

    public UserItemService(BusinessLogUserItemHistoryService hstoryService){
        this.historyService = hstoryService;
    }


    public String getUserItemHistory(Map<String, String> requestParams){
        
        //페이징 처리
        //requestParams =
        CommonUtils.pageSetting(requestParams);

        //몽고 DB 에서 호출 할수 있도록 처리
        String startDate = requestParams.get(AdminConstants.INDICATORS_KEY_START_DATE);
        String endDate = requestParams.get(AdminConstants.INDICATORS_KEY_END_DATE);
        String itemId = requestParams.get(AdminConstants.INDICATORS_KEY_ITEM_ID);

        //UserItemService.class 바꿔야 한다.
        historyService.loadBusinessLogData(startDate, endDate, itemId, UserItemService.class);

        return "";
    }
}
