Commit e8807a94b3a2b5842cbd35a19338b1fb25a74aad
1 parent
b5258714
update
Showing
10 changed files
with
249 additions
and
414 deletions
pom.xml
| ... | ... | @@ -194,20 +194,8 @@ |
| 194 | 194 | </dependencies> |
| 195 | 195 | |
| 196 | 196 | <build> |
| 197 | - <resources> | |
| 198 | - <resource> | |
| 199 | - <!-- 指定配置文件所在的resource目录 --> | |
| 200 | - <directory>src/main/resources</directory> | |
| 201 | - <includes> | |
| 202 | - <include>application.properties</include> | |
| 203 | - <include>application-${environment}.properties</include> | |
| 204 | - <include>logback-${environment}.xml</include> | |
| 205 | - </includes> | |
| 206 | - <filtering>true</filtering> | |
| 207 | - </resource> | |
| 208 | - </resources> | |
| 209 | 197 | <!-- 指定打包名称--> |
| 210 | - <finalName>cnlive_shenhe_${environment}-0.0.1-SNAPSHOT</finalName> | |
| 198 | + <finalName>cnlive_shenhe</finalName> | |
| 211 | 199 | <plugins> |
| 212 | 200 | <plugin> |
| 213 | 201 | <groupId>org.springframework.boot</groupId> |
| ... | ... | @@ -240,28 +228,4 @@ |
| 240 | 228 | </plugins> |
| 241 | 229 | </build> |
| 242 | 230 | |
| 243 | - <!--分别设置开发,测试,生产环境--> | |
| 244 | - <profiles> | |
| 245 | - <!-- 开发环境 --> | |
| 246 | - <profile> | |
| 247 | - <id>dev</id> | |
| 248 | - <activation> | |
| 249 | - <activeByDefault>true</activeByDefault> | |
| 250 | - </activation> | |
| 251 | - <properties> | |
| 252 | - <environment>dev</environment> | |
| 253 | - </properties> | |
| 254 | - </profile> | |
| 255 | - <!-- 生产环境 --> | |
| 256 | - <profile> | |
| 257 | - <id>pro</id> | |
| 258 | - <activation> | |
| 259 | - <activeByDefault>false</activeByDefault> | |
| 260 | - </activation> | |
| 261 | - <properties> | |
| 262 | - <environment>pro</environment> | |
| 263 | - </properties> | |
| 264 | - </profile> | |
| 265 | - </profiles> | |
| 266 | - | |
| 267 | 231 | </project> | ... | ... |
src/main/java/com/cnlive/shenhe/ShenheApplication.java
| ... | ... | @@ -9,6 +9,7 @@ import org.slf4j.Logger; |
| 9 | 9 | import org.slf4j.LoggerFactory; |
| 10 | 10 | import org.springframework.beans.factory.annotation.Value; |
| 11 | 11 | import org.springframework.boot.ApplicationRunner; |
| 12 | +import org.springframework.boot.SpringApplication; | |
| 12 | 13 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 13 | 14 | import org.springframework.boot.builder.SpringApplicationBuilder; |
| 14 | 15 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| ... | ... | @@ -16,6 +17,10 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer |
| 16 | 17 | import org.springframework.context.annotation.Bean; |
| 17 | 18 | import org.springframework.context.annotation.Configuration; |
| 18 | 19 | import org.springframework.stereotype.Controller; |
| 20 | +import org.springframework.ui.Model; | |
| 21 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 22 | +import org.springframework.web.servlet.ModelAndView; | |
| 23 | + | |
| 19 | 24 | import tk.mybatis.spring.annotation.MapperScan; |
| 20 | 25 | |
| 21 | 26 | import java.net.InetAddress; |
| ... | ... | @@ -24,33 +29,24 @@ import java.util.HashMap; |
| 24 | 29 | import java.util.Map; |
| 25 | 30 | |
| 26 | 31 | @SpringBootApplication |
| 27 | -@MapperScan(basePackages = {"com.cnlive.shenhe.mapper"}) | |
| 32 | +@MapperScan(basePackages= {"com.cnlive.shenhe.mapper"}) | |
| 28 | 33 | public class ShenheApplication extends SpringBootServletInitializer { |
| 29 | 34 | |
| 30 | 35 | //url的前缀 |
| 31 | 36 | private static final String CAS_SERVER_URL_PREFIX = "https://user.cnlive.com/OpenSSO2"; |
| 32 | 37 | private static final String CAS_SERVER_LOGIN_URL = "https://user.cnlive.com/OpenSSO2/login"; |
| 33 | 38 | //本机的名称 |
| 34 | - private static final String SERVER_NAME = "http://test.shen.cnlive.com:82"; | |
| 39 | + private static final String SERVER_NAME = "http://shen.cnlive.com:81"; | |
| 35 | 40 | |
| 36 | 41 | //登录入口 |
| 37 | - private static final String SERVICE_LOGIN = "http://test.shen.cnlive.com:82/users/login"; | |
| 42 | + private static final String SERVICE_LOGIN = "http://shen.cnlive.com:81/users/login"; | |
| 38 | 43 | |
| 39 | 44 | //登出 |
| 40 | - private static final String SERVICE_LOGINOUT = "http://test.shen.cnlive.com:82/users/logout"; | |
| 41 | - | |
| 42 | - public static void main(String[] args) { | |
| 43 | -// SpringApplication.run(ShenheApplication.class, args); | |
| 44 | - SpringApplicationBuilder builder = new SpringApplicationBuilder(ShenheApplication.class); | |
| 45 | - builder.headless(true).run(args); | |
| 46 | - // 设置Headless模式,linux系统下 | |
| 47 | - System.setProperty("java.awt.headless", "true"); | |
| 48 | - } | |
| 45 | + private static final String SERVICE_LOGINOUT = "http://shen.cnlive.com:81/users/logout"; | |
| 49 | 46 | |
| 50 | 47 | |
| 51 | 48 | /** |
| 52 | 49 | * 用于实现单点登出功能 |
| 53 | - * | |
| 54 | 50 | * @return |
| 55 | 51 | */ |
| 56 | 52 | @Bean |
| ... | ... | @@ -59,7 +55,7 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 59 | 55 | registration.setFilter(new SingleSignOutFilter()); |
| 60 | 56 | // 设定匹配的路径 |
| 61 | 57 | registration.addUrlPatterns("/*"); |
| 62 | - Map<String, String> initParameters = new HashMap<String, String>(); | |
| 58 | + Map<String,String> initParameters = new HashMap<String, String>(); | |
| 63 | 59 | initParameters.put("casServerUrlPrefix", CAS_SERVER_URL_PREFIX); |
| 64 | 60 | registration.setInitParameters(initParameters); |
| 65 | 61 | // 设定加载的顺序 |
| ... | ... | @@ -69,7 +65,6 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 69 | 65 | |
| 70 | 66 | /** |
| 71 | 67 | * 该过滤器负责用户的认证工作 |
| 72 | - * | |
| 73 | 68 | * @return |
| 74 | 69 | */ |
| 75 | 70 | @Bean |
| ... | ... | @@ -78,7 +73,7 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 78 | 73 | registration.setFilter(new AuthenticationFilter()); |
| 79 | 74 | // 设定匹配的路径 |
| 80 | 75 | registration.addUrlPatterns("/*"); |
| 81 | - Map<String, String> initParameters = new HashMap<String, String>(); | |
| 76 | + Map<String,String> initParameters = new HashMap<String, String>(); | |
| 82 | 77 | initParameters.put("casServerLoginUrl", CAS_SERVER_LOGIN_URL); |
| 83 | 78 | initParameters.put("service", SERVICE_LOGIN); |
| 84 | 79 | initParameters.put("ignorePattern", "/api/*|/logging/*"); |
| ... | ... | @@ -91,7 +86,6 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 91 | 86 | |
| 92 | 87 | /** |
| 93 | 88 | * 该过滤器负责对Ticket的校验工作 |
| 94 | - * | |
| 95 | 89 | * @return |
| 96 | 90 | */ |
| 97 | 91 | @Bean |
| ... | ... | @@ -100,10 +94,10 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 100 | 94 | registration.setFilter(new Cas20ProxyReceivingTicketValidationFilter()); |
| 101 | 95 | // 设定匹配的路径 |
| 102 | 96 | registration.addUrlPatterns("/*"); |
| 103 | - Map<String, String> initParameters = new HashMap<String, String>(); | |
| 97 | + Map<String,String> initParameters = new HashMap<String, String>(); | |
| 104 | 98 | initParameters.put("casServerUrlPrefix", CAS_SERVER_URL_PREFIX); |
| 105 | 99 | initParameters.put("serverName", SERVER_NAME); |
| 106 | - initParameters.put("encoding", "utf-8"); | |
| 100 | + initParameters.put("encoding","utf-8"); | |
| 107 | 101 | registration.setInitParameters(initParameters); |
| 108 | 102 | // 设定加载的顺序 |
| 109 | 103 | registration.setOrder(3); |
| ... | ... | @@ -113,8 +107,7 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 113 | 107 | |
| 114 | 108 | /** |
| 115 | 109 | * 该过滤器负责实现HttpServletRequest请求的包裹, |
| 116 | - * 比如允许开发者通过HttpServletRequest的getRemoteUser()方法获得SSO登录用户的登录名,可选配置。 | |
| 117 | - * | |
| 110 | + * 比如允许开发者通过HttpServletRequest的getRemoteUser()方法获得SSO登录用户的登录名,可选配置。 | |
| 118 | 111 | * @return |
| 119 | 112 | */ |
| 120 | 113 | @Bean |
| ... | ... | @@ -130,8 +123,7 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 130 | 123 | |
| 131 | 124 | /** |
| 132 | 125 | * 该过滤器使得开发者可以通过org.jasig.cas.client.util.AssertionHolder来获取 |
| 133 | - * 用户的登录名。比如AssertionHolder.getAssertion().getPrincipal().getName()。 | |
| 134 | - * | |
| 126 | + * 用户的登录名。比如AssertionHolder.getAssertion().getPrincipal().getName()。 | |
| 135 | 127 | * @return |
| 136 | 128 | */ |
| 137 | 129 | @Bean |
| ... | ... | @@ -145,6 +137,136 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 145 | 137 | return registration; |
| 146 | 138 | } |
| 147 | 139 | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + /** | |
| 154 | + * 登录过滤器 | |
| 155 | + * @return | |
| 156 | + */ | |
| 157 | + /* @Bean | |
| 158 | + public FilterRegistrationBean filterSingleRegistration() { | |
| 159 | + FilterRegistrationBean registration = new FilterRegistrationBean(); | |
| 160 | + registration.setFilter(new SingleSignOutFilter()); | |
| 161 | + // 设定匹配的路径 | |
| 162 | + registration.addUrlPatterns("/*"); | |
| 163 | + Map<String,String> initParameters = new HashMap<String, String>(); | |
| 164 | + initParameters.put("casServerUrlPrefix", CAS_SERVER_URL_PREFIX); | |
| 165 | + registration.setInitParameters(initParameters); | |
| 166 | + // 设定加载的顺序 | |
| 167 | + registration.setOrder(1); | |
| 168 | + return registration; | |
| 169 | + } | |
| 170 | + | |
| 171 | + *//** | |
| 172 | + * 过滤验证器 | |
| 173 | + * @return | |
| 174 | + *//* | |
| 175 | + @Bean | |
| 176 | + public FilterRegistrationBean filterValidationRegistration() { | |
| 177 | + FilterRegistrationBean registration = new FilterRegistrationBean(); | |
| 178 | + registration.setFilter(new Cas30ProxyReceivingTicketValidationFilter()); | |
| 179 | + // 设定匹配的路径 | |
| 180 | + registration.addUrlPatterns("/*"); | |
| 181 | + Map<String,String> initParameters = new HashMap<String, String>(); | |
| 182 | + initParameters.put("casServerUrlPrefix", CAS_SERVER_URL_PREFIX); | |
| 183 | + initParameters.put("serverName", SERVER_NAME); | |
| 184 | + initParameters.put("useSession", "true"); | |
| 185 | + registration.setInitParameters(initParameters); | |
| 186 | + // 设定加载的顺序 | |
| 187 | + registration.setOrder(1); | |
| 188 | + return registration; | |
| 189 | + } | |
| 190 | + | |
| 191 | + *//** | |
| 192 | + * 授权过滤器 | |
| 193 | + * @return | |
| 194 | + *//* | |
| 195 | + *//*@Bean | |
| 196 | + public FilterRegistrationBean filterAuthenticationRegistration() { | |
| 197 | + FilterRegistrationBean registration = new FilterRegistrationBean(); | |
| 198 | + registration.setFilter(new AuthenticationFilter()); | |
| 199 | + // 设定匹配的路径 | |
| 200 | + registration.addUrlPatterns("/*"); | |
| 201 | + Map<String,String> initParameters = new HashMap<String, String>(); | |
| 202 | + initParameters.put("casServerLoginUrl", CAS_SERVER_URL_PREFIX); | |
| 203 | + initParameters.put("server", SERVICE_LOGIN); | |
| 204 | + | |
| 205 | + //initParameters.put("ignorePattern", ".*"); | |
| 206 | + //表示过滤所有 | |
| 207 | + //initParameters.put("ignoreUrlPatternType", "com.cnlive.shenhe.config.SimpleUrlPatternMatcherStrategy"); | |
| 208 | + | |
| 209 | + registration.setInitParameters(initParameters); | |
| 210 | + // 设定加载的顺序 | |
| 211 | + registration.setOrder(1); | |
| 212 | + return registration; | |
| 213 | + }*//* | |
| 214 | + | |
| 215 | + *//** | |
| 216 | + * wraper过滤器 | |
| 217 | + * @return | |
| 218 | + *//* | |
| 219 | + @Bean | |
| 220 | + public FilterRegistrationBean filterWrapperRegistration() { | |
| 221 | + FilterRegistrationBean registration = new FilterRegistrationBean(); | |
| 222 | + registration.setFilter(new HttpServletRequestWrapperFilter()); | |
| 223 | + // 设定匹配的路径 | |
| 224 | + registration.addUrlPatterns("/*"); | |
| 225 | + // 设定加载的顺序 | |
| 226 | + registration.setOrder(1); | |
| 227 | + return registration; | |
| 228 | + } | |
| 229 | + | |
| 230 | + *//** | |
| 231 | + * 添加监听器 | |
| 232 | + * @return | |
| 233 | + *//* | |
| 234 | + @Bean | |
| 235 | + public ServletListenerRegistrationBean<EventListener> singleSignOutListenerRegistration(){ | |
| 236 | + ServletListenerRegistrationBean<EventListener> registrationBean = new ServletListenerRegistrationBean<EventListener>(); | |
| 237 | + registrationBean.setListener(new SingleSignOutHttpSessionListener()); | |
| 238 | + registrationBean.setOrder(1); | |
| 239 | + return registrationBean; | |
| 240 | + } | |
| 241 | + | |
| 242 | + *//** | |
| 243 | + * 设定首页 | |
| 244 | + *//* | |
| 245 | + @Configuration | |
| 246 | + public class DefaultView extends WebMvcConfigurerAdapter { | |
| 247 | + | |
| 248 | + @Override | |
| 249 | + public void addViewControllers(ViewControllerRegistry registry) { | |
| 250 | + //设定首页为index | |
| 251 | + registry.addViewController("/").setViewName("forward:/users/index"); | |
| 252 | + | |
| 253 | + //设定匹配的优先级 | |
| 254 | + registry.setOrder(Ordered.HIGHEST_PRECEDENCE); | |
| 255 | + | |
| 256 | + //添加视图控制类 | |
| 257 | + super.addViewControllers(registry); | |
| 258 | + } | |
| 259 | + }*/ | |
| 260 | + | |
| 261 | + | |
| 262 | + public static void main(String[] args) { | |
| 263 | +// SpringApplication.run(ShenheApplication.class, args); | |
| 264 | + SpringApplicationBuilder builder=new SpringApplicationBuilder(ShenheApplication.class); | |
| 265 | + builder.headless(true).run(args); | |
| 266 | + // 设置Headless模式,linux系统下 | |
| 267 | + System.setProperty("java.awt.headless", "true"); | |
| 268 | + } | |
| 269 | + | |
| 148 | 270 | /** |
| 149 | 271 | * 配置内部类 |
| 150 | 272 | */ |
| ... | ... | @@ -165,7 +287,6 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 165 | 287 | */ |
| 166 | 288 | @Value("${server.port}") |
| 167 | 289 | private String port; |
| 168 | - | |
| 169 | 290 | /** |
| 170 | 291 | * 启动成功 |
| 171 | 292 | */ |
| ... | ... | @@ -184,4 +305,4 @@ public class ShenheApplication extends SpringBootServletInitializer { |
| 184 | 305 | } |
| 185 | 306 | |
| 186 | 307 | } |
| 187 | 308 | -} |
| 309 | +} | |
| 188 | 310 | \ No newline at end of file | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| ... | ... | @@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory; |
| 24 | 24 | import org.springframework.beans.factory.annotation.Autowired; |
| 25 | 25 | import org.springframework.beans.factory.annotation.Value; |
| 26 | 26 | import org.springframework.stereotype.Service; |
| 27 | +import org.springframework.util.StringUtils; | |
| 27 | 28 | import tk.mybatis.mapper.entity.Example; |
| 28 | 29 | |
| 29 | 30 | import java.text.ParseException; |
| ... | ... | @@ -39,7 +40,7 @@ import java.util.UUID; |
| 39 | 40 | @Service |
| 40 | 41 | public class VideosServiceImpl { |
| 41 | 42 | |
| 42 | - private static Logger logger = LoggerFactory.getLogger(VideofilterServiceImpl.class); | |
| 43 | + private static Logger logger = LoggerFactory.getLogger(VideofilterServiceImpl.class); | |
| 43 | 44 | @Autowired |
| 44 | 45 | ShyVideosMapper shyVideosMapper; |
| 45 | 46 | @Autowired |
| ... | ... | @@ -113,7 +114,7 @@ public class VideosServiceImpl { |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | 116 | public PageInfo<ShyVideos> getListContent(VideosDTO videosDTO) { |
| 116 | - logger.info("接受桉树列表为,VideosDTO:{}",JSON.toJSONString(videosDTO)); | |
| 117 | + logger.info("接受桉树列表为,VideosDTO:{}", JSON.toJSONString(videosDTO)); | |
| 117 | 118 | Example example = new Example(ShyVideos.class); |
| 118 | 119 | Example.Criteria criteria = example.createCriteria(); |
| 119 | 120 | Example.Criteria criteria2 = example.createCriteria(); |
| ... | ... | @@ -285,7 +286,6 @@ public class VideosServiceImpl { |
| 285 | 286 | public List<ShyVideos> findByCondition(VideosDTO videosDTO) { |
| 286 | 287 | Example example = new Example(ShyVideos.class); |
| 287 | 288 | Example.Criteria criteria = example.createCriteria(); |
| 288 | - Example.Criteria criteria2 = example.createCriteria(); | |
| 289 | 289 | if (CommonUtils.isNotEmpty(videosDTO.getOrderByClause())) { |
| 290 | 290 | example.setOrderByClause(videosDTO.getOrderByClause()); |
| 291 | 291 | } |
| ... | ... | @@ -464,8 +464,8 @@ public class VideosServiceImpl { |
| 464 | 464 | //初始化一个审核状态 |
| 465 | 465 | //审核类型,1:免审,2:机审,3:人工审 |
| 466 | 466 | Integer shenheType = 3; |
| 467 | - //如果当前sp是免审sp | |
| 468 | - if (sites.contains(shyVideo.getSpid()) || shyActivities.contains(Integer.valueOf(source))) { | |
| 467 | + //如果当前sp是免审sp source有传空的时候 默认给0 | |
| 468 | + if (sites.contains(shyVideo.getSpid()) || shyActivities.contains(StringUtils.isEmpty(source) ? "0" : Integer.valueOf(source))) { | |
| 469 | 469 | logger.info("进入已经免审渠道:{}", source); |
| 470 | 470 | //免审 |
| 471 | 471 | shenheType = 1; | ... | ... |
src/main/java/com/cnlive/shenhe/utils/YiDunAntiFraudUtil.java
| ... | ... | @@ -81,6 +81,7 @@ public class YiDunAntiFraudUtil { |
| 81 | 81 | private final static String URL_RESULT = "https://as.dun.163yun.com/v1/crawler/callback/results"; |
| 82 | 82 | |
| 83 | 83 | public static void main(String[] args) { |
| 84 | + | |
| 84 | 85 | // Map<String, String> params = new HashMap<String, String>(5); |
| 85 | 86 | // // 1.设置公共参数 |
| 86 | 87 | // params.put("secretId", SECRETID); |
| ... | ... | @@ -97,26 +98,26 @@ public class YiDunAntiFraudUtil { |
| 97 | 98 | //getTextFilter("王八蛋"); |
| 98 | 99 | |
| 99 | 100 | //智能图片识别审核测试 |
| 100 | - JSONArray jsonArray = new JSONArray(); | |
| 101 | - JSONObject image1 = new JSONObject(); | |
| 102 | - image1.put("name", UUID.randomUUID()); | |
| 103 | - image1.put("type", 1); | |
| 104 | - image1.put("data", "http://article-bj.bj.bcebos.com//20200326/7f3d23bbb28421e6e2a6f131273554fb_15.jpg?authorization=bce-auth-v1%2F1eda661c3697440eaaca912ccb6f959c%2F2020-03-30T05%3A42%3A21Z%2F604800%2F%2F39f195e2327ef87270bd095fa64dfdcadad6f01a0d6dc6a4313306f164591cc5"); | |
| 105 | - jsonArray.add(image1); | |
| 106 | - JSONObject image2 = new JSONObject(); | |
| 107 | - image2.put("name", UUID.randomUUID()); | |
| 108 | - image2.put("type", 1); | |
| 109 | - image2.put("data", "http://test.qnvod.cnlive.com/shen/802/2020/03/01/8a8a878c6dce5cfe017096cd07940c84/000002.jpg"); | |
| 110 | - jsonArray.add(image2); | |
| 111 | - JSONObject image3 = new JSONObject(); | |
| 112 | - image3.put("name", UUID.randomUUID()); | |
| 113 | - image3.put("type", 1); | |
| 114 | - image3.put("data", "https://wjj.ys2.cnliveimg.com/769/img/0/2020/03/21/158474856886077030277.jpg"); | |
| 115 | - jsonArray.add(image3); | |
| 116 | - System.out.println(jsonArray); | |
| 117 | - JSONObject imagesFilter = getImagesFilter(jsonArray.toString()); | |
| 101 | +// JSONArray jsonArray = new JSONArray(); | |
| 102 | +// JSONObject image1 = new JSONObject(); | |
| 103 | +// image1.put("name", UUID.randomUUID()); | |
| 104 | +// image1.put("type", 1); | |
| 105 | +// image1.put("data", "http://article-bj.bj.bcebos.com//20200326/7f3d23bbb28421e6e2a6f131273554fb_15.jpg?authorization=bce-auth-v1%2F1eda661c3697440eaaca912ccb6f959c%2F2020-03-30T05%3A42%3A21Z%2F604800%2F%2F39f195e2327ef87270bd095fa64dfdcadad6f01a0d6dc6a4313306f164591cc5"); | |
| 106 | +// jsonArray.add(image1); | |
| 107 | +// JSONObject image2 = new JSONObject(); | |
| 108 | +// image2.put("name", UUID.randomUUID()); | |
| 109 | +// image2.put("type", 1); | |
| 110 | +// image2.put("data", "http://test.qnvod.cnlive.com/shen/802/2020/03/01/8a8a878c6dce5cfe017096cd07940c84/000002.jpg"); | |
| 111 | +// jsonArray.add(image2); | |
| 112 | +// JSONObject image3 = new JSONObject(); | |
| 113 | +// image3.put("name", UUID.randomUUID()); | |
| 114 | +// image3.put("type", 1); | |
| 115 | +// image3.put("data", "https://wjj.ys2.cnliveimg.com/769/img/0/2020/03/21/158474856886077030277.jpg"); | |
| 116 | +// jsonArray.add(image3); | |
| 117 | +// System.out.println(jsonArray); | |
| 118 | +// JSONObject imagesFilter = getImagesFilter(jsonArray.toString()); | |
| 118 | 119 | // System.out.println(image1); |
| 119 | - System.out.println(imagesFilter); | |
| 120 | +// System.out.println(imagesFilter); | |
| 120 | 121 | |
| 121 | 122 | |
| 122 | 123 | //智能网页识别审核测试 | ... | ... |
src/main/resources/application-dev.properties deleted
100644 → 0
| 1 | -server.port=82 | |
| 2 | - | |
| 3 | -spring.datasource.url=jdbc:mysql://120.92.102.31:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 4 | -spring.datasource.username=root | |
| 5 | -spring.datasource.password=M345sdfss4! | |
| 6 | - | |
| 7 | -logging.config=classpath:logback-dev.xml | |
| 8 | - | |
| 9 | -#logback\u65e5\u5fd7\u4e2d\u4f7f\u7528 | |
| 10 | -spring.application.name=cnlive_shenhe_test | |
| 11 | -spring.application.home=/usr/local/test_cnlive_shenhe/cnlive_shenhe/log | |
| 12 | - | |
| 13 | -#\u672c\u673a\u5730\u5740 | |
| 14 | -spring.localhost.url=http://test.shen.cnlive.com | |
| 15 | - | |
| 16 | -#\u62bd\u5e27\u5e38\u91cf | |
| 17 | -avsmple_url=http://test.transcode.cnlive.com/api/request | |
| 18 | -avsmple_callback=http://test.shen.cnlive.com/api/avsample/callback | |
| 19 | - | |
| 20 | -#\u540c\u6b65\u76f4\u64ad\u4e91\u4fe1\u606f | |
| 21 | -live_url=http://test.bc.cnlive.com/bokong/activity/activityShenHe | |
| 22 | - | |
| 23 | -#\u62bd\u5e27\u5b58\u653ebucket\u548c\u57df\u540d | |
| 24 | -qn_bucket=cnlivetest | |
| 25 | -qn_domain=http://test.qnvod.cnlive.com | |
| 26 | -ks_bucket=cnlive-test | |
| 27 | -ks_domain=http://test.wideo.cnlive.com | |
| 28 | - | |
| 29 | -#\u56fe\u7247\u5b58\u653e\u6839\u8def\u5f84 | |
| 30 | -yiDun_audio_callback=http://test.shen.cnlive.com/api/audio/callbackAudio | |
| 31 | 0 | \ No newline at end of file |
src/main/resources/application-pro.properties deleted
100644 → 0
| 1 | -server.port=81 | |
| 2 | - | |
| 3 | -spring.datasource.url=jdbc:mysql://10.137.192.7:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 4 | -spring.datasource.username=admin | |
| 5 | -spring.datasource.password=83BwiCoq | |
| 6 | - | |
| 7 | -logging.config=classpath:logback-pro.xml | |
| 8 | - | |
| 9 | -#logback\u65e5\u5fd7\u4e2d\u4f7f\u7528 | |
| 10 | -spring.application.name=cnlive_shenhe | |
| 11 | -spring.application.home=/usr/local/cnlive_shenhe/log | |
| 12 | - | |
| 13 | -#\u672c\u673a\u5730\u5740 | |
| 14 | -spring.localhost.url=http://shen.cnlive.com | |
| 15 | - | |
| 16 | -#\u62bd\u5e27\u5e38\u91cf | |
| 17 | -avsmple_url=http://transcode.cnlive.com/api/request | |
| 18 | -avsmple_callback=http://shen.cnlive.com/api/avsample/callback | |
| 19 | - | |
| 20 | -#\u540c\u6b65\u76f4\u64ad\u4e91\u4fe1\u606f | |
| 21 | -live_url=http://bc.cnlive.com/bokong/activity/activityShenHe | |
| 22 | - | |
| 23 | -#\u62bd\u5e27\u5b58\u653ebucket\u548c\u57df\u540d | |
| 24 | -qn_bucket=mam-sxzg-82 | |
| 25 | -qn_domain=http://sxzg.ys2.cnliveimg.com | |
| 26 | -ks_bucket=mam-sxzg-82 | |
| 27 | -ks_domain=http://sxzg.ys1.cnliveimg.com | |
| 28 | - | |
| 29 | -#\u56fe\u7247\u5b58\u653e\u6839\u8def\u5f84 |
src/main/resources/application.properties
| 1 | -spring.profiles.active=@environment@ | |
| 1 | +#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 2 | +#spring.datasource.username=root | |
| 3 | +#spring.datasource.password=nbLdyO.79 | |
| 2 | 4 | |
| 3 | -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver | |
| 5 | +#\u91d1\u5c71\u4e00\u533a\u6570\u636e\u5e93 | |
| 6 | +#spring.datasource.url=jdbc:mysql://10.137.192.2:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 7 | +#spring.datasource.username=admin | |
| 8 | +#spring.datasource.password=Sre#45iU7kJ | |
| 9 | + | |
| 10 | +#\u91d1\u5c71\u516d\u533a\u6570\u636e\u5e93 | |
| 11 | +spring.datasource.url=jdbc:mysql://10.137.192.7:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 12 | +spring.datasource.username=admin | |
| 13 | +spring.datasource.password=83BwiCoq | |
| 14 | + | |
| 15 | +spring.datasource.driver-class-name=com.mysql.jdbc.Driver | |
| 4 | 16 | |
| 5 | 17 | server.tomcat.protocol_header=x-forwarded-proto |
| 6 | 18 | server.use-forward-headers=true |
| ... | ... | @@ -15,52 +27,85 @@ spring.http.encoding.enabled=true |
| 15 | 27 | spring.http.encoding.force=true |
| 16 | 28 | |
| 17 | 29 | spring.thymeleaf.mode=LEGACYHTML5 |
| 18 | -spring.thymeleaf.cache=false | |
| 19 | 30 | #spring.thymeleaf.encoding=UTF-8 |
| 20 | 31 | #spring.thymeleaf.content-type=text/html |
| 32 | +#\u5f00\u53d1\u65f6\u5173\u95ed\u7f13\u5b58,\u4e0d\u7136\u6ca1\u6cd5\u770b\u5230\u5b9e\u65f6\u9875\u9762 | |
| 33 | +spring.thymeleaf.cache=false | |
| 34 | + | |
| 35 | +#\u6253\u5370\u8fd0\u884c\u65f6\u7684sql | |
| 36 | +#logging.level.com.cnlive.shenhe.mapper=debug | |
| 21 | 37 | |
| 22 | 38 | mybatis.mapper-locations=classpath:mapper/*.xml |
| 23 | 39 | mybatis.type-aliases-package=com.cnlive.shenhe.entity |
| 40 | +server.port=81 | |
| 24 | 41 | |
| 25 | -#rabbitmq\u76F8\u5173\u914D\u7F6E | |
| 26 | -spring.rabbitmq.host=10.254.174.131 | |
| 42 | +#rabbitmq\u76f8\u5173\u914d\u7f6e | |
| 43 | +spring.rabbitmq.host=10.254.176.11 | |
| 27 | 44 | spring.rabbitmq.port=5672 |
| 28 | -spring.rabbitmq.username=test | |
| 29 | -spring.rabbitmq.password=p3~amKKt9 | |
| 30 | - | |
| 45 | +spring.rabbitmq.username=admin | |
| 46 | +spring.rabbitmq.password=fA{5Uikx7 | |
| 47 | +# \u5f00\u542f\u53d1\u9001\u786e\u8ba4 | |
| 31 | 48 | spring.rabbitmq.publisher-confirms=true |
| 49 | +# \u5f00\u542f\u53d1\u9001\u5931\u8d25\u9000\u56de | |
| 32 | 50 | spring.rabbitmq.publisher-returns=true |
| 51 | +# \u5f00\u542fACK | |
| 33 | 52 | spring.rabbitmq.listener.direct.acknowledge-mode=manual |
| 34 | 53 | spring.rabbitmq.listener.simple.acknowledge-mode=manual |
| 35 | 54 | |
| 36 | -#\u5173\u95EDspringboot\u63D0\u4F9B\u7684\u9ED8\u8BA4ico | |
| 55 | +#\u8bdd\u9898\u8bc4\u8bba\u5206\u4eabh5 | |
| 56 | +#topic_comment_shareH5=http://wjjh5test.cnlive.com/cnShareTopic.html?tid= | |
| 57 | + | |
| 58 | +#\u5173\u95edspringboot\u63d0\u4f9b\u7684\u9ed8\u8ba4ico | |
| 37 | 59 | spring.mvc.favicon.enabled = false |
| 38 | 60 | |
| 39 | -#\u8BC4\u8BBA\u7981\u8A00\u548C\u89E3\u7981\u4F7F\u7528API | |
| 61 | +#\u8bc4\u8bba\u7981\u8a00\u548c\u89e3\u7981\u4f7f\u7528API | |
| 40 | 62 | speak_comment=http://comment.cnlive.com/services/commentForTopic/muted |
| 41 | 63 | |
| 64 | +#logback\u65e5\u5fd7\u4e2d\u4f7f\u7528 | |
| 65 | +spring.application.name=cnlive_shenhe | |
| 66 | +spring.application.home=/usr/local/cnlive_shenhe/log | |
| 67 | + | |
| 42 | 68 | sync_users_api=http://api.cnlive.com/open/api2/inner2/shenhe/getuser |
| 43 | 69 | sync_users_app_key=314a9dd4-a9b7-4c12-bbbe-1150a36491ae |
| 44 | 70 | |
| 45 | -#\u7528\u6237\u4E91\u8BF7\u6C42\u67E5\u8BE2\u7528\u6237\u4FE1\u606F | |
| 71 | +#\u7528\u6237\u4e91\u8bf7\u6c42\u67e5\u8be2\u7528\u6237\u4fe1\u606f | |
| 46 | 72 | queryUserByMobile=http://user.api.cnlive.com/CnliveM2/user/readUserByUserName.action?userName= |
| 47 | 73 | queryUserByUserId=http://user.api.cnlive.com/CnliveM2/user/readUserByUid.action?uid= |
| 48 | 74 | |
| 49 | -#\u70B9\u64AD\u4E91\u9700\u8981\u7684\u5E38\u91CF | |
| 75 | +#\u70b9\u64ad\u4e91\u9700\u8981\u7684\u5e38\u91cf | |
| 50 | 76 | url=http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify |
| 51 | 77 | platformKey =AUDIT |
| 52 | 78 | platformValue=10011438 |
| 53 | 79 | |
| 54 | -#\u62BD\u5E27\u5E38\u91CF | |
| 80 | +#\u672c\u673a\u5730\u5740 | |
| 81 | +spring.localhost.url=http://shen.cnlive.com | |
| 82 | + | |
| 83 | +#\u62bd\u5e27\u5e38\u91cf | |
| 55 | 84 | avsmple_appKey=1eac30dfbee311e7a2f0fa163e771cf9 |
| 56 | 85 | avsmple_appSecret=28ce1e1fbee311e7a2f0fa163e771cf92ea58ebfbee311e7a2f0fa163e771cf9 |
| 86 | +avsmple_url=http://transcode.cnlive.com/api/request | |
| 87 | +avsmple_callback=http://shen.cnlive.com/api/avsample/callback | |
| 57 | 88 | |
| 58 | -#\u90AE\u4EF6\u4F7F\u7528\u5E38\u91CF | |
| 89 | +#\u540c\u6b65\u76f4\u64ad\u4e91\u4fe1\u606f | |
| 90 | +live_url=http://bc.cnlive.com/bokong/activity/activityShenHe | |
| 91 | + | |
| 92 | +#\u90ae\u4ef6\u4f7f\u7528\u5e38\u91cf | |
| 59 | 93 | email_app_id=769_jetja50p18 |
| 60 | 94 | email_app_key=ad101b9152817a79b5c33c3617b96ff91385096ff3b4ba |
| 61 | 95 | email_send_URL=http://sms.cnlive.com/CnliveM3/email/sendMoreVarEmail.action |
| 62 | 96 | |
| 63 | -#\u56FE\u7247\u5B58\u653E\u6839\u8DEF\u5F84 | |
| 97 | +#\u62bd\u5e27\u5b58\u653ebucket\u548c\u57df\u540d | |
| 98 | +#qn_bucket=cnlivetest | |
| 99 | +#qn_domain=http://test.qnvod.cnlive.com | |
| 100 | +#ks_bucket=cnlive-test | |
| 101 | +#ks_domain=http://test.wideo.cnlive.com | |
| 102 | + | |
| 103 | +qn_bucket=mam-sxzg-82 | |
| 104 | +qn_domain=http://sxzg.ys2.cnliveimg.com | |
| 105 | +ks_bucket=mam-sxzg-82 | |
| 106 | +ks_domain=http://sxzg.ys1.cnliveimg.com | |
| 107 | + | |
| 108 | +#\u56fe\u7247\u5b58\u653e\u6839\u8def\u5f84 | |
| 64 | 109 | desdir=shen |
| 65 | -#yiDun_audio_callback=http://test.shen.cnlive.com/api/audio/ | |
| 66 | -#cms_getVideoAndLiveId=http://cmstest.cnlive.com:8768/contentApi/getBeanByIdcallbackAudio | |
| 110 | +yiDun_audio_callback=http://shen.cnlive.com/api/audio/callbackAudio | |
| 111 | +cms_getVideoAndLiveId=http://cms.cnlive.com:8768/contentApi/getBeanById | ... | ... |
src/main/resources/logback-pro.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<!-- | |
| 3 | -scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。 | |
| 4 | -scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒当scan为true时,此属性生效。默认的时间间隔为1分钟。 | |
| 5 | -debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 | |
| 6 | ---> | |
| 7 | -<configuration scan="false" scanPeriod="60 seconds" debug="false"> | |
| 8 | - <!--日志文件主目录:这里${user.home}为当前服务器用户主目录--> | |
| 9 | -<!-- <property name="LOG_HOME" value="/usr/local/test_cnlive_shenhe/cnlive_shenhe/log" /> --> | |
| 10 | - <springProperty scope="context" name="LOG_HOME" source="spring.application.home"/> | |
| 11 | - <!-- 定义日志文件名称 --> | |
| 12 | -<!-- <property name="appName" value="appName" source="spring.application.name"></property> --> | |
| 13 | - <!--日志文件名称:这里spring.application.name表示工程名称--> | |
| 14 | - <springProperty scope="context" name="APP_NAME" source="spring.application.name"/> | |
| 15 | - <!-- ch.qos.logback.core.ConsoleAppender 表示控制台输出 --> | |
| 16 | - <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> | |
| 17 | - <!-- | |
| 18 | - 日志输出格式: | |
| 19 | - %d表示日期时间, | |
| 20 | - %thread表示线程名, | |
| 21 | - %-5level:级别从左显示5个字符宽度 | |
| 22 | - %logger{50} 表示logger名字最长50个字符,否则按照句点分割。 | |
| 23 | - %msg:日志消息, | |
| 24 | - %n是换行符 | |
| 25 | - --> | |
| 26 | - <layout class="ch.qos.logback.classic.PatternLayout"> | |
| 27 | - <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | |
| 28 | - </layout> | |
| 29 | - </appender> | |
| 30 | - | |
| 31 | - <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 --> | |
| 32 | - <appender name="appLogAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 33 | - <!-- 指定日志文件的名称 --> | |
| 34 | -<!-- <file>${LOG_HOME}/%d{yyyyMMdd}/${APP_NAME}.log</file> --> | |
| 35 | - <!-- | |
| 36 | - 当发生滚动时,决定 RollingFileAppender 的行为,涉及文件移动和重命名 | |
| 37 | - TimeBasedRollingPolicy: 最常用的滚动策略,它根据时间来制定滚动策略,既负责滚动也负责出发滚动。 | |
| 38 | - --> | |
| 39 | - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 40 | - <!-- | |
| 41 | - 滚动时产生的文件的存放位置及文件名称 %d{yyyy-MM-dd}:按天进行日志滚动 | |
| 42 | - %i:当文件大小超过maxFileSize时,按照i进行文件滚动 | |
| 43 | - --> | |
| 44 | - <fileNamePattern>${LOG_HOME}/%d{yyyyMMdd}/${APP_NAME}.log</fileNamePattern> | |
| 45 | - <!-- | |
| 46 | - 可选节点,控制保留的归档文件的最大数量,超出数量就删除旧文件。假设设置每天滚动, | |
| 47 | - 且maxHistory是365,则只保存最近365天的文件,删除之前的旧文件。注意,删除旧文件是, | |
| 48 | - 那些为了归档而创建的目录也会被删除。 | |
| 49 | - --> | |
| 50 | - <MaxHistory>30</MaxHistory> | |
| 51 | - <!-- | |
| 52 | - 当日志文件超过maxFileSize指定的大小是,根据上面提到的%i进行日志文件滚动 注意此处配置SizeBasedTriggeringPolicy是无法实现按文件大小进行滚动的,必须配置timeBasedFileNamingAndTriggeringPolicy | |
| 53 | - --> | |
| 54 | -<!-- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> --> | |
| 55 | -<!-- <maxFileSize>100MB</maxFileSize> --> | |
| 56 | -<!-- </timeBasedFileNamingAndTriggeringPolicy> --> | |
| 57 | - </rollingPolicy> | |
| 58 | - <!-- 日志输出格式: --> | |
| 59 | - <layout class="ch.qos.logback.classic.PatternLayout"> | |
| 60 | - <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | |
| 61 | - </layout> | |
| 62 | - </appender> | |
| 63 | - | |
| 64 | - <!-- | |
| 65 | - logger主要用于存放日志对象,也可以定义日志类型、级别 | |
| 66 | - name:表示匹配的logger类型前缀,也就是包的前半部分 | |
| 67 | - level:要记录的日志级别,包括 TRACE < DEBUG < INFO < WARN < ERROR | |
| 68 | - additivity:作用在于children-logger是否使用 rootLogger配置的appender进行输出, | |
| 69 | - false:表示只用当前logger的appender-ref,true: | |
| 70 | - 表示当前logger的appender-ref和rootLogger的appender-ref都有效 | |
| 71 | - --> | |
| 72 | - <!-- hibernate logger --> | |
| 73 | - <logger name="com.yuanqinnan" level="debug" /> | |
| 74 | - <!-- Spring framework logger --> | |
| 75 | - <logger name="org.springframework" level="debug" additivity="false"></logger> | |
| 76 | - | |
| 77 | - | |
| 78 | - | |
| 79 | - <!-- | |
| 80 | - root与logger是父子关系,没有特别定义则默认为root,任何一个类只会和一个logger对应, | |
| 81 | - 要么是定义的logger,要么是root,判断的关键在于找到这个logger,然后判断这个logger的appender和level。 | |
| 82 | - --> | |
| 83 | - <root level="info"> | |
| 84 | - <appender-ref ref="stdout" /> | |
| 85 | - <appender-ref ref="appLogAppender" /> | |
| 86 | - </root> | |
| 87 | -</configuration> | |
| 88 | 0 | \ No newline at end of file |
src/main/resources/logback-dev.xml renamed to src/main/resources/logback-spring.xml
| ... | ... | @@ -6,10 +6,10 @@ debug嚗迨撅扯挽蝵桐蛹true嚗logback敹縑嚗 |
| 6 | 6 | --> |
| 7 | 7 | <configuration scan="false" scanPeriod="60 seconds" debug="false"> |
| 8 | 8 | <!--敹辣銝餌敶${user.home}銝箏銝餌敶--> |
| 9 | -<!-- <property name="LOG_HOME" value="/usr/local/test_cnlive_shenhe/cnlive_shenhe/log" /> --> | |
| 9 | + <!-- <property name="LOG_HOME" value="/usr/local/test_cnlive_shenhe/cnlive_shenhe/log" /> --> | |
| 10 | 10 | <springProperty scope="context" name="LOG_HOME" source="spring.application.home"/> |
| 11 | 11 | <!-- 摰敹辣妍 --> |
| 12 | -<!-- <property name="appName" value="appName" source="spring.application.name"></property> --> | |
| 12 | + <!-- <property name="appName" value="appName" source="spring.application.name"></property> --> | |
| 13 | 13 | <!--敹辣妍嚗pring.application.name銵函內撌亦妍--> |
| 14 | 14 | <springProperty scope="context" name="APP_NAME" source="spring.application.name"/> |
| 15 | 15 | <!-- ch.qos.logback.core.ConsoleAppender 銵函內颲 --> |
| ... | ... | @@ -19,7 +19,7 @@ debug嚗迨撅扯挽蝵桐蛹true嚗logback敹縑嚗 |
| 19 | 19 | %d銵函內嚗 |
| 20 | 20 | %thread銵函內蝥輻 |
| 21 | 21 | %-5level嚗漣隞椰蝷5銝芸泵摰賢漲 |
| 22 | - %logger{50} 銵函內logger50銝芸泵嚗 | |
| 22 | + %logger{50} 銵函內logger50銝芸泵嚗 | |
| 23 | 23 | %msg嚗敹嚗 |
| 24 | 24 | %n銵泵 |
| 25 | 25 | --> |
| ... | ... | @@ -28,40 +28,40 @@ debug嚗迨撅扯挽蝵桐蛹true嚗logback敹縑嚗 |
| 28 | 28 | </layout> |
| 29 | 29 | </appender> |
| 30 | 30 | |
| 31 | - <!-- 皛霈啣辣嚗敹扇敶辣嚗泵葵隞嗆嚗敹扇敶隞辣 --> | |
| 31 | + <!-- 皛霈啣辣嚗敹扇敶辣嚗泵葵隞嗆嚗敹扇敶隞辣 --> | |
| 32 | 32 | <appender name="appLogAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 33 | 33 | <!-- 敹辣妍 --> |
| 34 | -<!-- <file>${LOG_HOME}/%d{yyyyMMdd}/${APP_NAME}.log</file> --> | |
| 34 | + <!-- <file>${LOG_HOME}/%d{yyyyMMdd}/${APP_NAME}.log</file> --> | |
| 35 | 35 | <!-- |
| 36 | 36 | 敶嚗摰 RollingFileAppender 蛹嚗辣蝘餃 |
| 37 | 37 | TimeBasedRollingPolicy嚗 撣貊蝑嚗摰蝑嚗韐提皛銋提 |
| 38 | 38 | --> |
| 39 | 39 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 40 | 40 | <!-- |
| 41 | - 皛鈭抒辣雿蔭辣妍 %d{yyyy-MM-dd}嚗予餈敹 | |
| 41 | + 皛鈭抒辣雿蔭辣妍 %d{yyyy-MM-dd}嚗予餈敹 | |
| 42 | 42 | %i嚗辣憭批axFileSize嚗i餈辣皛 |
| 43 | 43 | --> |
| 44 | 44 | <fileNamePattern>${LOG_HOME}/%d{yyyyMMdd}/${APP_NAME}.log</fileNamePattern> |
| 45 | - <!-- | |
| 45 | + <!-- | |
| 46 | 46 | 嚗靽﹝辣憭扳停辣挽霈曄蔭瘥予皛嚗 |
| 47 | 47 | 銝axHistory365嚗靽餈365憭拍辣嚗銋辣釣辣嚗 |
| 48 | 48 | 鈭蛹鈭﹝遣敶◤ |
| 49 | 49 | --> |
| 50 | 50 | <MaxHistory>30</MaxHistory> |
| 51 | - <!-- | |
| 51 | + <!-- | |
| 52 | 52 | 敶敹辣頞axFileSize之撠嚗銝%i餈敹辣皛 瘜冽迨憭蔭SizeBasedTriggeringPolicy辣憭批◆蔭timeBasedFileNamingAndTriggeringPolicy |
| 53 | 53 | --> |
| 54 | -<!-- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> --> | |
| 55 | -<!-- <maxFileSize>100MB</maxFileSize> --> | |
| 56 | -<!-- </timeBasedFileNamingAndTriggeringPolicy> --> | |
| 54 | + <!-- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> --> | |
| 55 | + <!-- <maxFileSize>100MB</maxFileSize> --> | |
| 56 | + <!-- </timeBasedFileNamingAndTriggeringPolicy> --> | |
| 57 | 57 | </rollingPolicy> |
| 58 | - <!-- 敹撘 --> | |
| 58 | + <!-- 敹撘 --> | |
| 59 | 59 | <layout class="ch.qos.logback.classic.PatternLayout"> |
| 60 | 60 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| 61 | 61 | </layout> |
| 62 | 62 | </appender> |
| 63 | 63 | |
| 64 | - <!-- | |
| 64 | + <!-- | |
| 65 | 65 | logger銝餉鈭敹笆鞊∴隞亙敹掩漣 |
| 66 | 66 | name嚗”蝷箏ogger蝐餃嚗停 |
| 67 | 67 | level嚗扇敶敹漣嚗 TRACE < DEBUG < INFO < WARN < ERROR |
| ... | ... | @@ -76,9 +76,9 @@ debug嚗迨撅扯挽蝵桐蛹true嚗logback敹縑嚗 |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | |
| 79 | - <!-- | |
| 79 | + <!-- | |
| 80 | 80 | root銝ogger摮蝟鳴瓷摰恕銝氳oot嚗遙雿銝芰掩隡銝泓ogger撖孵 |
| 81 | - 閬摰ogger嚗root嚗鈭餈葵logger嚗餈葵loggerppenderevel | |
| 81 | + 閬摰ogger嚗root嚗鈭餈葵logger嚗餈葵loggerppenderevel | |
| 82 | 82 | --> |
| 83 | 83 | <root level="info"> |
| 84 | 84 | <appender-ref ref="stdout" /> | ... | ... |
src/main/resources/logback.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<configuration> | |
| 3 | - <!--<include resource="org/springframework/boot/logging/logback/base.xml"/>--> | |
| 4 | - <!-- 项目的appid --> | |
| 5 | - <property name="APP_ID" value="demo"/> | |
| 6 | - <property name="LOG_PATH" value="log"></property> | |
| 7 | - | |
| 8 | - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
| 9 | - <encoder> | |
| 10 | - <pattern>%d{yyyy-MM-dd HH:mm:ss} %-4relative [%thread] %-5level %logger{35} - %msg %n</pattern> | |
| 11 | - </encoder> | |
| 12 | - </appender> | |
| 13 | - | |
| 14 | - <appender name="FILE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 15 | - <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
| 16 | - <level>DEBUG</level> | |
| 17 | - </filter> | |
| 18 | - <file>${LOG_PATH}/${APP_ID}/access.log</file> | |
| 19 | - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 20 | - <fileNamePattern>${LOG_PATH}/${APP_ID}/access.log.%d{yyyy-MM-dd}.zip</fileNamePattern> | |
| 21 | - <!-- maxHistory配置了日志在服务器上面只存留十个备份 --> | |
| 22 | - <maxHistory>10</maxHistory> | |
| 23 | - </rollingPolicy> | |
| 24 | - <encoder> | |
| 25 | - <pattern>%d{yyyy-MM-dd HH:mm:ss} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
| 26 | - </encoder> | |
| 27 | - </appender> | |
| 28 | - | |
| 29 | - <appender name="FILE_DEBUG" | |
| 30 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 31 | - <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
| 32 | - <level>DEBUG</level> | |
| 33 | - <onMatch>ACCEPT</onMatch> | |
| 34 | - <onMismatch>DENY</onMismatch> | |
| 35 | - </filter> | |
| 36 | - <file>${LOG_PATH}/${APP_ID}/access_debug.log</file> | |
| 37 | - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 38 | - <fileNamePattern>${LOG_PATH}/${APP_ID}/access_debug.log.%d{yyyy-MM-dd}.zip</fileNamePattern> | |
| 39 | - <!-- maxHistory配置了日志在服务器上面只存留十个备份 --> | |
| 40 | - <maxHistory>10</maxHistory> | |
| 41 | - </rollingPolicy> | |
| 42 | - <encoder> | |
| 43 | - <pattern>%d{yyyy-MM-dd HH:mm:ss} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
| 44 | - </encoder> | |
| 45 | - </appender> | |
| 46 | - | |
| 47 | - <appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 48 | - <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
| 49 | - <level>INFO</level> | |
| 50 | - <onMatch>ACCEPT</onMatch> | |
| 51 | - <onMismatch>DENY</onMismatch> | |
| 52 | - </filter> | |
| 53 | - <file>${LOG_PATH}/${APP_ID}/access_info.log</file> | |
| 54 | - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 55 | - <fileNamePattern>${LOG_PATH}/${APP_ID}/access_info.log.%d{yyyy-MM-dd}.zip</fileNamePattern> | |
| 56 | - <!-- maxHistory配置了日志在服务器上面只存留十个备份 --> | |
| 57 | - <maxHistory>10</maxHistory> | |
| 58 | - </rollingPolicy> | |
| 59 | - <encoder> | |
| 60 | - <pattern>%d{yyyy-MM-dd HH:mm:ss} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
| 61 | - </encoder> | |
| 62 | - </appender> | |
| 63 | - | |
| 64 | - <appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 65 | - <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
| 66 | - <level>WARN</level> | |
| 67 | - <onMatch>ACCEPT</onMatch> | |
| 68 | - <onMismatch>DENY</onMismatch> | |
| 69 | - </filter> | |
| 70 | - <file>${LOG_PATH}/${APP_ID}/access_warn.log</file> | |
| 71 | - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 72 | - <fileNamePattern>${LOG_PATH}/${APP_ID}/access_warn.log.%d{yyyy-MM-dd}.zip</fileNamePattern> | |
| 73 | - <!-- maxHistory配置了日志在服务器上面只存留十个备份 --> | |
| 74 | - <maxHistory>10</maxHistory> | |
| 75 | - </rollingPolicy> | |
| 76 | - <encoder> | |
| 77 | - <pattern>%d{yyyy-MM-dd HH:mm:ss} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
| 78 | - </encoder> | |
| 79 | - </appender> | |
| 80 | - | |
| 81 | - <appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 82 | - <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
| 83 | - <level>ERROR</level> | |
| 84 | - <onMatch>ACCEPT</onMatch> | |
| 85 | - <onMismatch>DENY</onMismatch> | |
| 86 | - </filter> | |
| 87 | - <file>${LOG_PATH}/${APP_ID}/access_error.log</file> | |
| 88 | - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 89 | - <fileNamePattern>${LOG_PATH}/${APP_ID}/access_error.log.%d{yyyy-MM-dd}.zip</fileNamePattern> | |
| 90 | - <!-- maxHistory配置了日志在服务器上面只存留十个备份 --> | |
| 91 | - <maxHistory>10</maxHistory> | |
| 92 | - </rollingPolicy> | |
| 93 | - <encoder> | |
| 94 | - <pattern>%d{yyyy-MM-dd HH:mm:ss} %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
| 95 | - </encoder> | |
| 96 | - </appender> | |
| 97 | - | |
| 98 | - | |
| 99 | - <appender name="ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender"> | |
| 100 | - <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | |
| 101 | - <discardingThreshold>0</discardingThreshold> | |
| 102 | - <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | |
| 103 | - <queueSize>512</queueSize> | |
| 104 | - <appender-ref ref="FILE_LOG"/> | |
| 105 | - </appender> | |
| 106 | - <appender name="ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender"> | |
| 107 | - <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | |
| 108 | - <discardingThreshold>0</discardingThreshold> | |
| 109 | - <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | |
| 110 | - <queueSize>512</queueSize> | |
| 111 | - <appender-ref ref="FILE_LOG"/> | |
| 112 | - </appender> | |
| 113 | - <appender name="ASYNC_LOG_DEBUG" class="ch.qos.logback.classic.AsyncAppender"> | |
| 114 | - <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | |
| 115 | - <discardingThreshold>0</discardingThreshold> | |
| 116 | - <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | |
| 117 | - <queueSize>512</queueSize> | |
| 118 | - <appender-ref ref="FILE_DEBUG"/> | |
| 119 | - </appender> | |
| 120 | - <appender name="ASYNC_LOG_INFO" class="ch.qos.logback.classic.AsyncAppender"> | |
| 121 | - <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | |
| 122 | - <discardingThreshold>0</discardingThreshold> | |
| 123 | - <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | |
| 124 | - <queueSize>512</queueSize> | |
| 125 | - <appender-ref ref="FILE_INFO"/> | |
| 126 | - </appender> | |
| 127 | - <appender name="ASYNC_LOG_WARN" class="ch.qos.logback.classic.AsyncAppender"> | |
| 128 | - <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | |
| 129 | - <discardingThreshold>0</discardingThreshold> | |
| 130 | - <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | |
| 131 | - <queueSize>512</queueSize> | |
| 132 | - <appender-ref ref="FILE_WARN"/> | |
| 133 | - </appender> | |
| 134 | - <appender name="ASYNC_LOG_ERROR" class="ch.qos.logback.classic.AsyncAppender"> | |
| 135 | - <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> | |
| 136 | - <discardingThreshold>0</discardingThreshold> | |
| 137 | - <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> | |
| 138 | - <queueSize>512</queueSize> | |
| 139 | - <appender-ref ref="FILE_ERROR"/> | |
| 140 | - </appender> | |
| 141 | - <root level="INFO"> | |
| 142 | - <!-- appender referenced after it is defined --> | |
| 143 | - <appender-ref ref="STDOUT"/> | |
| 144 | - <appender-ref ref="ASYNC_LOG"/> | |
| 145 | - <appender-ref ref="ASYNC_LOG_DEBUG"/> | |
| 146 | - <appender-ref ref="ASYNC_LOG_INFO"/> | |
| 147 | - <appender-ref ref="ASYNC_LOG_WARN"/> | |
| 148 | - <appender-ref ref="ASYNC_LOG_ERROR"/> | |
| 149 | - </root> | |
| 150 | - <logger name="org.springframework" level="INFO"/> | |
| 151 | -</configuration> | |
| 152 | 0 | \ No newline at end of file |