/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.api.test;

import com.crunii.micro.common.dto.PageReq;
import com.crunii.micro.service.sysmgr.dto.pub.PubC;
import com.crunii.micro.service.sysmgr.dto.pub.PubReq;
import com.crunii.micro.service.sysmgr.service.PublishService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Commit;

import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 田平 create 2019年6月14日上午11:28:58
 */
public class PublishServiceTest extends SysmgrBaseTest {

	@Autowired
	private PublishService publishService;

	@Test
	@Commit
	public void testCreate() {
		PubC pubC = new PubC();
		pubC.setDisableTime(new Date());
		pubC.setEnableTime(new Date());
		pubC.setPubContent("1231");
		pubC.setPubDesc("desc");
		pubC.setPubIcon("icon");
		pubC.setPubName("test");
		pubC.setPubType("News");
		pubC.setSortId(1);
		publishService.createPub(pubC);
	}

	//@Test
	public void testpagePub() {

		PageReq<PubReq> req = new PageReq<PubReq>();
		PubReq pubReq = new PubReq();
		pubReq.setPubName("t");
		pubReq.setState(1);
		pubReq.setPubType("News");
		req.setQuery(pubReq);
		publishService.pagePub(req).getResult().stream().forEach(System.out::println);

	}

}
