소스 검색

修改包扫描路径

syh 5 년 전
부모
커밋
ea1fc96437
18개의 변경된 파일104개의 추가작업 그리고 155개의 파일을 삭제
  1. 1 0
      module-common/pom.xml
  2. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  3. 6 5
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  4. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  5. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java
  6. 2 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  7. 6 5
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java
  8. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoWatermarkTaskServiceImpl.java
  9. 1 1
      module-crawler/pom.xml
  10. 0 6
      module-toutiao/pom.xml
  11. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertisePlanController.java
  12. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertiserController.java
  13. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java
  14. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  15. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserServiceImpl.java
  16. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCampaignServiceImpl.java
  17. 75 14
      xxl-job-executor/pom.xml
  18. 0 109
      xxl-job-executor/src/main/java/com/xxl/job/executor/config/RedisConfig.java

+ 1 - 0
module-common/pom.xml

@@ -11,6 +11,7 @@
 
     <groupId>cn.com.ctop</groupId>
     <artifactId>module-common</artifactId>
+    <version>2.0.2</version>
 
     <name>module-common</name>
     <!-- FIXME change it to the project's website -->

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -25,7 +25,7 @@ import java.util.Map;
  * @Version: V1.0
  */
 @Slf4j
-@Service
+@Service("ctopOauthTokenService")
 public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper, CtopOauthToken> implements ICtopOauthTokenService {
     @Autowired
     private CtopOauthTokenMapper cTopOauthTokenMapper;

+ 6 - 5
module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.URI;
@@ -48,13 +49,13 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
     private String videoUploadPath;
     @Autowired
     FileInfoMapper fileInfoMapper;
-    @Autowired
-    private ICtopOauthTokenService tokenService;
+    @Resource
+    private ICtopOauthTokenService ctopOauthTokenService;
 
     @Override
     public void uploadVideoToBytedance(String accountId, String videoUrl) {
         try {
-            CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
+            CtopOauthToken token = ctopOauthTokenService.getOauthTokenByAccountId(accountId);
             uploadAdvideo(token, videoUrl, token.getAccountId() + "");
             JSONObject jsonObject = videoUpload(token, videoUrl);
             log.info("头条上传素材返回信息:{},accountId:{}", jsonObject, accountId);
@@ -68,7 +69,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
     public Map<String, Object> uploadImageToBytedance(String accountId, String imageUrl) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
-            CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
+            CtopOauthToken token = ctopOauthTokenService.getOauthTokenByAccountId(accountId);
             JSONObject jsonObject = imageUpload(token, String.valueOf(token.getAccountId()), imageUrl);
             log.info("头条上传图片素材返回信息:{},accountId:{}", jsonObject, accountId);
         } catch (Exception e) {
@@ -88,7 +89,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
 
     @Override
     public Map<String, Object> getCreativeWords(Long accountId) {
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
+        CtopOauthToken token = ctopOauthTokenService.getOauthTokenByAccountId(accountId + "");
         return getCreativeWord(token, accountId);
     }
 

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -28,7 +28,7 @@ import java.net.URLEncoder;
  * @version V1.0
  * @date 2019-12-25
  */
-@Service
+@Service("materialCutFrameService")
 public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMapper, MaterialCutFrame> implements IMaterialCutFrameService {
 
     private static String ossLocation = "oss-cn-beijing";

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java

@@ -33,7 +33,7 @@ import java.util.Map;
  * @date 2020-03-16
  */
 @Slf4j
-@Service
+@Service("materialImageInfoService")
 public class MaterialImageInfoServiceImpl extends ServiceImpl<MaterialImageInfoMapper, MaterialImageInfo> implements IMaterialImageInfoService {
 
     @Value("${oss.replace.download}")

+ 2 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -45,7 +45,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     private static ExecutorService uploadExecutorService = Executors.newFixedThreadPool(5);
     @Resource
     private IVideoWatermarkTemplateService videoWatermarkTemplateService;
-    @Autowired
+    @Resource
     private IVideoWatermarkTaskService videoWatermarkTaskService;
     @Autowired
     private MaterialInfoMapper materialInfoMapper;
@@ -174,7 +174,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         return resultMap;
     }
 
-    @Autowired
+    @Resource
     private IMaterialCutFrameService materialCutFrameService;
 
     private void insertMaterialInfo(String url, String type, JSONObject jsonObject) {

+ 6 - 5
module-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java

@@ -10,15 +10,16 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 @Slf4j
-@Service
+@Service("refreshTokenService")
 public class RefreshTokenServiceImpl implements IRefreshTokenService {
     @Autowired
     private CtopOauthTokenMapper oauthTokenMapper;
-    @Autowired
-    private ICtopOauthTokenService oauthTokenService;
+    @Resource
+    private ICtopOauthTokenService ctopOauthTokenService;
 
     /**
      * 获取所有token
@@ -34,11 +35,11 @@ public class RefreshTokenServiceImpl implements IRefreshTokenService {
                 log.info("刷新token,accountId:{}", oauthToken.getAccountId());
                 //头条
                 if (CtopAdConstant.PLATFORM_TYPE_BYTEDANCE.equals(oauthToken.getMediaId().trim())) {
-                    oauthTokenService.getByteDanceAccessToken(String.valueOf(oauthToken.getAccountId()));
+                    ctopOauthTokenService.getByteDanceAccessToken(String.valueOf(oauthToken.getAccountId()));
                 }
                 //快手
                 if (CtopAdConstant.PLATFORM_TYPE_KUAISHOU.equals(oauthToken.getMediaId().trim())) {
-                    oauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getRefreshToken(), oauthToken.getAgentType());
+                    ctopOauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getRefreshToken(), oauthToken.getAgentType());
                 }
             }
         } else {

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoWatermarkTaskServiceImpl.java

@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @date   2019-12-20
  * @version V1.0
  */
-@Service
+@Service("videoWatermarkTaskService")
 public class VideoWatermarkTaskServiceImpl extends ServiceImpl<VideoWatermarkTaskMapper, VideoWatermarkTask> implements IVideoWatermarkTaskService {
 
 }

+ 1 - 1
module-crawler/pom.xml

@@ -8,7 +8,7 @@
         <version>2.0.2</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-
+    <version>2.0.2</version>
     <groupId>cn.com.ctop</groupId>
     <artifactId>module-crawler</artifactId>
     <dependencies>

+ 0 - 6
module-toutiao/pom.xml

@@ -32,12 +32,6 @@
             <artifactId>module-crawler</artifactId>
             <version>2.0.2</version>
         </dependency>
-       <!-- <dependency>
-            <groupId>cn.com.ctop</groupId>
-            <artifactId>module-kuaishou</artifactId>
-            <version>2.0.2</version>
-            <scope>compile</scope>
-        </dependency>-->
     </dependencies>
 
     <build>

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertisePlanController.java

@@ -12,9 +12,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 
@@ -29,7 +29,7 @@ import java.util.Arrays;
 @RestController
 @RequestMapping("/ctop/byteDanceAdvertisePlan")
 public class ByteDanceAdvertisePlanController {
-    @Autowired
+    @Resource
     private IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
 
     /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertiserController.java

@@ -12,9 +12,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 
@@ -29,7 +29,7 @@ import java.util.Arrays;
 @RestController
 @RequestMapping("/ctop/byteDanceAdvertiser")
 public class ByteDanceAdvertiserController {
-    @Autowired
+    @Resource
     private IByteDanceAdvertiserService byteDanceAdvertiserService;
 
     /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java

@@ -12,9 +12,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 
@@ -29,7 +29,7 @@ import java.util.Arrays;
 @RestController
 @RequestMapping("/ctop/byteDanceCampaign")
 public class ByteDanceCampaignController {
-    @Autowired
+    @Resource
     private IByteDanceCampaignService byteDanceCampaignService;
 
     /**

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -18,7 +18,7 @@ import java.util.List;
  * @Version: V1.0
  */
 @Slf4j
-@Service
+@Service("byteDanceAdvertisePlanService")
 public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdvertisePlanMapper, ByteDanceAdvertisePlan> implements IByteDanceAdvertisePlanService {
     @Autowired
     private ByteDanceAdvertisePlanMapper byteDanceAdvertisePlanMapper;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * @Date: 2019-07-22
  * @Version: V1.0
  */
-@Service
+@Service("byteDanceAdvertiserService")
 public class ByteDanceAdvertiserServiceImpl extends ServiceImpl<ByteDanceAdvertiserMapper, ByteDanceAdvertiser> implements IByteDanceAdvertiserService {
 
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCampaignServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * @Date: 2019-07-22
  * @Version: V1.0
  */
-@Service
+@Service("byteDanceCampaignService")
 public class ByteDanceCampaignServiceImpl extends ServiceImpl<ByteDanceCampaignMapper, ByteDanceCampaign> implements IByteDanceCampaignService {
 
 }

+ 75 - 14
xxl-job-executor/pom.xml

@@ -8,9 +8,12 @@
         <version>2.0.2</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-
     <artifactId>xxl-job-executor</artifactId>
     <name>xxl-job-executor</name>
+    <version>2.0.2</version>
+    <properties>
+        <spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
+    </properties>
 
     <dependencies>
         <!-- spring-boot-starter-web (spring-webmvc + tomcat) -->
@@ -39,39 +42,97 @@
         <dependency>
             <groupId>org.jeecgframework.boot</groupId>
             <artifactId>jeecg-boot-base-common</artifactId>
-            <version>2.0.2</version>
+
         </dependency>
         <dependency>
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-toutiao</artifactId>
             <version>2.0.2</version>
-            <!--<exclusions>
-                <exclusion>
-                    <groupId>cn.com.ctop</groupId>
-                    <artifactId>module-common</artifactId>
-                </exclusion>
-            </exclusions>-->
         </dependency>
         <dependency>
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-kuaishou</artifactId>
             <version>2.0.2</version>
-           <!-- <exclusions>
-                <exclusion>
-                    <groupId>cn.com.ctop</groupId>
-                    <artifactId>module-common</artifactId>
-                </exclusion>
-            </exclusions>-->
         </dependency>
 
     </dependencies>
+
+    <repositories>
+        <repository>
+            <id>aliyun</id>
+            <name>aliyun Repository</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>jeecg</id>
+            <name>jeecg Repository</name>
+            <url>http://maven.jeecg.org/nexus/content/repositories/jeecg</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>com.e-iceblue</id>
+            <name>e-iceblue</name>
+            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
+        </repository>
+    </repositories>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
     <build>
         <plugins>
             <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.6</version>
+                <configuration>
+                    <!-- 是否覆盖,true表示会替换生成的JAVA文件,false则不覆盖 -->
+                    <overwrite>true</overwrite>
+                </configuration>
+                <dependencies>
+                    <!--mysql驱动包-->
+                    <dependency>
+                        <groupId>mysql</groupId>
+                        <artifactId>mysql-connector-java</artifactId>
+                        <version>5.1.45</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
         </plugins>
+        <resources>
+            <!-- 解决MyBatis配置文件引入问题 -->
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <!-- 是否替换资源中的属性-->
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
     </build>
 
     <profiles>

+ 0 - 109
xxl-job-executor/src/main/java/com/xxl/job/executor/config/RedisConfig.java

@@ -1,109 +0,0 @@
-package com.xxl.job.executor.config;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping;
-import org.springframework.cache.CacheManager;
-import org.springframework.cache.annotation.CachingConfigurerSupport;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.cache.interceptor.KeyGenerator;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.cache.RedisCacheConfiguration;
-import org.springframework.data.redis.cache.RedisCacheManager;
-import org.springframework.data.redis.cache.RedisCacheWriter;
-import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
-import org.springframework.data.redis.serializer.RedisSerializer;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-
-import javax.annotation.Resource;
-import java.lang.reflect.Method;
-import java.time.Duration;
-import java.util.Arrays;
-
-@Configuration
-@EnableCaching
-public class RedisConfig extends CachingConfigurerSupport {
-
-    @Resource
-    private LettuceConnectionFactory lettuceConnectionFactory;
-
-    /**
-     * @return 自定义策略生成的key
-     * @description 自定义的缓存key的生成策略 若想使用这个key
-     * 只需要讲注解上keyGenerator的值设置为keyGenerator即可</br>
-     */
-    @Override
-    @Bean
-    public KeyGenerator keyGenerator() {
-        return new KeyGenerator() {
-            @Override
-            public Object generate(Object target, Method method, Object... params) {
-
-                StringBuilder sb = new StringBuilder();
-                sb.append(target.getClass().getName());
-                sb.append(method.getDeclaringClass().getName());
-                Arrays.stream(params).map(Object::toString).forEach(sb::append);
-                return sb.toString();
-            }
-        };
-    }
-
-    /**
-     * RedisTemplate配置
-     */
-    @Bean
-    public RedisTemplate<String, Object> redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {
-        // 设置序列化
-        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<Object>(Object.class);
-        ObjectMapper om = new ObjectMapper();
-        om.setVisibility(PropertyAccessor.ALL, Visibility.ANY);
-        om.enableDefaultTyping(DefaultTyping.NON_FINAL);
-        jackson2JsonRedisSerializer.setObjectMapper(om);
-        // 配置redisTemplate
-        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
-        redisTemplate.setConnectionFactory(lettuceConnectionFactory);
-        RedisSerializer<?> stringSerializer = new StringRedisSerializer();
-        // key序列化
-        redisTemplate.setKeySerializer(stringSerializer);
-        // value序列化
-        redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
-        // Hash key序列化
-        redisTemplate.setHashKeySerializer(stringSerializer);
-        // Hash value序列化
-        redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
-        redisTemplate.afterPropertiesSet();
-        return redisTemplate;
-    }
-
-    /**
-     * 缓存配置管理器
-     */
-    @Bean
-    public CacheManager cacheManager(LettuceConnectionFactory factory) {
-        // 以锁写入的方式创建RedisCacheWriter对象
-        RedisCacheWriter writer = RedisCacheWriter.lockingRedisCacheWriter(factory);
-        /**
-         * 设置CacheManager的Value序列化方式为JdkSerializationRedisSerializer,
-         * 但其实RedisCacheConfiguration默认就是使用 StringRedisSerializer序列化key,
-         * JdkSerializationRedisSerializer序列化value, 所以以下注释代码就是默认实现,没必要写,直接注释掉
-         */
-        // RedisSerializationContext.SerializationPair pair =
-        // RedisSerializationContext.SerializationPair.fromSerializer(new
-        // JdkSerializationRedisSerializer(this.getClass().getClassLoader()));
-        // RedisCacheConfiguration config =
-        // RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair);
-        // 创建默认缓存配置对象
-
-        // 创建默认缓存配置对象
-        //设置缓存默认有效期3小时;
-        RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofHours(3));
-
-        RedisCacheManager cacheManager = new RedisCacheManager(writer, config);
-        return cacheManager;
-    }
-
-}