import com.gic.haoban.manage.api.dto.anaylsis.ClerkShareGoodsLogDTO;
import com.gic.haoban.manage.api.dto.content.log.ClerkShareMaterialLogDTO;
import com.gic.haoban.manage.api.service.content.MaterialShareLogApiService;
import com.google.common.collect.Lists;
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 MUSI
 * @Date 2023/4/7 5:56 PM
 * @Description
 * @Version
 **/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
public class MaterialShareLogApiServiceTest {

    @Autowired
    MaterialShareLogApiService materialShareLogApiService;

    String eid = "ff8080815dacd3a2015dacd3ef5c0000";
    String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b";
    String staffId = "e608b51b267e4943b87e222a343b4f25";
    String clerkId = "300b60c7f8874ca2b9cc696ad6b6a480";
    //String memberId = "ff8080818147efc8018148d1759903c8";
    String memberId = "ff80808187210d2b018721e9cc6c0036";

    String materialId = "510923843246776342";

    @Test
    public void test(){
        ClerkShareMaterialLogDTO clerkShareMaterialLogDTO = new ClerkShareMaterialLogDTO();
        clerkShareMaterialLogDTO.setClerkId(clerkId);
        clerkShareMaterialLogDTO.setShareType(1);
        clerkShareMaterialLogDTO.setStoreId(staffId);
        clerkShareMaterialLogDTO.setStaffId(staffId);
        clerkShareMaterialLogDTO.setWxEnterpriseId(wxEid);
        clerkShareMaterialLogDTO.setEnterpriseId(eid);
        clerkShareMaterialLogDTO.setBizType(1);
        clerkShareMaterialLogDTO.setBizId(materialId);
        materialShareLogApiService.saveClerkShareMaterialLog(clerkShareMaterialLogDTO);
    }

    @Test
    public void saveClerkShareRecommendLog(){
        List<ClerkShareGoodsLogDTO> clerkShareGoodsLogDTOList = Lists.newArrayList();
        ClerkShareGoodsLogDTO clerkShareGoodsLogDTO = new ClerkShareGoodsLogDTO();
        clerkShareGoodsLogDTO.setClerkId(clerkId);
        clerkShareGoodsLogDTO.setShareType(1);
        clerkShareGoodsLogDTO.setStoreId(staffId);
        clerkShareGoodsLogDTO.setStaffId(staffId);
        clerkShareGoodsLogDTO.setWxEnterpriseId(wxEid);
        clerkShareGoodsLogDTO.setEnterpriseId(eid);
        clerkShareGoodsLogDTO.setBizType(2);
        clerkShareGoodsLogDTO.setBizId("8a80908c916e4e3e0191704c588200a4");

        clerkShareGoodsLogDTOList.add(clerkShareGoodsLogDTO);
        materialShareLogApiService.saveClerkShareRecommendLog(clerkShareGoodsLogDTOList);
    }
}
