| | |
| | | import com.yeshi.buwan.domain.jump.JumpDetail; |
| | | import com.yeshi.buwan.domain.jump.JumpTypeEnum; |
| | | import com.yeshi.buwan.domain.recommend.FloatAD; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import org.json.JSONObject; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | |
| | | @Test |
| | | public void addJumpDetail() { |
| | | JumpDetail detail = new JumpDetail(); |
| | | detail.setActivity(""); |
| | | detail.setActivity("com.weikou.beibeivideo.ui.mine.BrowserActivity"); |
| | | detail.setController(""); |
| | | detail.setType(JumpTypeEnum.baichuan); |
| | | detail.setType(JumpTypeEnum.web); |
| | | jumpDetailDao.save(detail); |
| | | } |
| | | |
| | |
| | | public void addFloatAd() { |
| | | JumpDetail detail = jumpDetailDao.selectByType(JumpTypeEnum.baichuan); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", "https://s.click.taobao.com/2K0Nxtv"); |
| | | params.put("url", "https://s.click.taobao.com/kYgxJvu"); |
| | | FloatAD ad = new FloatAD(); |
| | | ad.setId(StringUtil.Md5(System.currentTimeMillis() + "")); |
| | | ad.setJumpDetail(detail); |
| | | ad.setParams(params.toString()); |
| | | ad.setPicture("http://ec-1255749512.file.myqcloud.com/img/FloatAD/5cba7bfd927e4c1d958808acd22bab58.png"); |
| | | ad.setPicture("https://ec-1255749512.cos.ap-guangzhou.myqcloud.com/resource/s11/float.png"); |
| | | ad.setShow(true); |
| | | ad.setShowStartTime(new Date(TimeUtil.convertToTimeTemp("2020-10-21","yyyy-MM-dd"))); |
| | | ad.setShowEndTime(new Date(TimeUtil.convertToTimeTemp("2020-11-12","yyyy-MM-dd"))); |
| | | ad.setWeight(1); |
| | | floatADDao.save(ad); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getFloatAd() { |
| | | floatADDao.list(true, new Date(), 1, 1); |
| | | } |
| | | } |