From f7b2baec57a19039ca85880bbba4e17fe27f0511 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 10 三月 2021 18:21:13 +0800 Subject: [PATCH] 删除冗余代码,初步优化首页的推荐专题,3.8.7之后在我的里面添加VIP分类 --- src/test/java/com/hxh/spring/test/ConfigTest.java | 44 ++++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/test/java/com/hxh/spring/test/ConfigTest.java b/src/test/java/com/hxh/spring/test/ConfigTest.java index 9c7aa56..ce101e0 100644 --- a/src/test/java/com/hxh/spring/test/ConfigTest.java +++ b/src/test/java/com/hxh/spring/test/ConfigTest.java @@ -1,26 +1,42 @@ package com.hxh.spring.test; -import com.yeshi.buwan.domain.Config; -import com.yeshi.buwan.service.imp.ConfigService; -import com.yeshi.buwan.util.BeanUtil; +import com.yeshi.buwan.dao.system.SystemConfigDao; +import com.yeshi.buwan.domain.system.SystemConfig; +import com.yeshi.buwan.job.AdJob; +import com.yeshi.buwan.service.inter.system.SystemConfigService; +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 java.util.List; +import javax.annotation.Resource; +import java.util.Date; +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = {"classpath:spring.xml"}) +@WebAppConfiguration public class ConfigTest { - @Test - public void test1() { - ConfigService configService = BeanUtil.getBean(ConfigService.class); - List<Config> configList = configService.getConfig(44L, 1); - } + @Resource + private SystemConfigService systemConfigService; + + @Resource + private SystemConfigDao systemConfigDao; + @Test - public void test2(){ - String resourceName = "鐖卞鑹�"; - if (resourceName.indexOf("鐖卞鑹�") > -1 || resourceName.indexOf("鎼滅嫄") > -1 || resourceName.indexOf("鑵捐") > -1 || resourceName.indexOf("涔愯") > -1 || resourceName.indexOf("AcFun") > -1 || resourceName.indexOf("椋庤") > -1) { - System.out.println(resourceName); - } + public void addSystemConfig() { + SystemConfig systemConfig = new SystemConfig(); + systemConfig.setBeizhu(""); + systemConfig.setKey("iqiyi_update_video_name"); + systemConfig.setName("鐖卞鑹虹壒娈婃洿鏂扮殑瑙嗛鍚嶇О"); + systemConfig.setValue("銆婂崸搴曘��,娌″叧绯伙紝鏄潚鏄ュ晩锛�,灞辨捣鎯咃紙鍘熷0鐗堬級,鎴戠殑鏃朵唬锛屼綘鐨勬椂浠�,浣犲ソ锛屽畨鎬�"); + systemConfig.setCreateTime(new Date()); + systemConfig.setId(SystemConfig.createId(systemConfig.getKey())); + systemConfigDao.save(systemConfig); } + } -- Gitblit v1.8.0