import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.chat.GroupChatActivityInviteLogDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatActivityRewardLogDTO;
import com.gic.haoban.manage.api.qdto.chat.GroupChatActivityInviteLogQDTO;
import com.gic.haoban.manage.api.qdto.chat.GroupChatActivityRewardLogQDTO;
import com.gic.haoban.manage.api.service.chat.GroupChatActivityLogApiService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * @author shangfeng
 * @date 2024-10-08 14:46:55
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
public class GroupChatInviteActivityTest {

    @Autowired
    private GroupChatActivityLogApiService groupChatActivityLogApiService;


    @Test
    public void queryMaxBatchInviteLog(){
        GroupChatActivityInviteLogQDTO inviteLogQDTO = new GroupChatActivityInviteLogQDTO();
        inviteLogQDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
        inviteLogQDTO.setChatActivityId(716721754221821953L);
//        inviteLogQDTO.setInviteType(1);
        inviteLogQDTO.setSortFiled("create_time");
        inviteLogQDTO.setSortType("desc");
        inviteLogQDTO.setInviterMemberId("ff808081906def5201907645bfc7005a");
        ServiceResponse<List<GroupChatActivityInviteLogDTO>> listServiceResponse = groupChatActivityLogApiService.queryMaxBatchInviteLog(inviteLogQDTO);
        System.out.println(listServiceResponse.getResult());
    }

    @Test
    public void queryInviteLogDetails(){
        GroupChatActivityInviteLogQDTO inviteLogQDTO = new GroupChatActivityInviteLogQDTO();
        inviteLogQDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
        inviteLogQDTO.setChatActivityId(716721754221821953L);
        inviteLogQDTO.setInviterMemberId("ff808081906def5201907645bfc7005a");
        inviteLogQDTO.setSortFiled("create_time");
        inviteLogQDTO.setSortType("desc");
        ServiceResponse<Page<GroupChatActivityInviteLogDTO>> listServiceResponse = groupChatActivityLogApiService.queryInviteLogDetails(inviteLogQDTO);
        System.out.println(listServiceResponse.getResult());
    }

    @Test
    public void queryRewardLogDetails(){
        GroupChatActivityRewardLogQDTO inviteLogQDTO = new GroupChatActivityRewardLogQDTO();
        inviteLogQDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
        inviteLogQDTO.setChatActivityId(716721754221821953L);
        inviteLogQDTO.setMemberId("ff808081906def5201907645bfc7005a");
        ServiceResponse<Page<GroupChatActivityRewardLogDTO>> listServiceResponse = groupChatActivityLogApiService.queryRewardLogDetails(inviteLogQDTO);
        System.out.println(listServiceResponse.getResult());
    }

}
