Browse Source
Conflicts: esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java esua-epdc/epdc-gateway/pom.xml esua-epdc/epdc-gateway/src/main/resources/application.yml esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.javafeature/dangjian
60 changed files with 2456 additions and 454 deletions
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<parent> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis</artifactId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
|
|||
<artifactId>epdc-analysis-client</artifactId> |
|||
<packaging>jar</packaging> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-tools</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<finalName>${project.artifactId}</finalName> |
|||
</build> |
|||
|
|||
</project> |
@ -0,0 +1,64 @@ |
|||
package com.elink.esua.epdc.dto.issue.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 议题列表DTO |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 15:58 |
|||
*/ |
|||
@Data |
|||
public class IssueResultDTO implements Serializable { |
|||
/** |
|||
* epdc_issue主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 议题内容 |
|||
*/ |
|||
private String issueContent; |
|||
|
|||
/** |
|||
* 来源网格-所有部门 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 支持-点赞次数 |
|||
*/ |
|||
private Integer approveNum; |
|||
|
|||
/** |
|||
* 反对-踩次数 |
|||
*/ |
|||
private Integer opposeNum; |
|||
|
|||
/** |
|||
* 评论数 |
|||
*/ |
|||
private Integer commentNum; |
|||
|
|||
/** |
|||
* 浏览数 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 表达态度(评论+回复+浏览) |
|||
*/ |
|||
private Integer expressAttitudeNum; |
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.elink.esua.epdc.dto.item.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 项目列表DTO |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:44 |
|||
*/ |
|||
@Data |
|||
public class ItemResultDTO implements Serializable { |
|||
/** |
|||
* epdc_item表主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 议题内容-项目摘要 |
|||
*/ |
|||
private String itemContent; |
|||
|
|||
/** |
|||
* 所有部门 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 发布人用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 支持-点赞次数 |
|||
*/ |
|||
private Integer approveNum; |
|||
|
|||
/** |
|||
* 反对-踩次数 |
|||
*/ |
|||
private Integer opposeNum; |
|||
|
|||
/** |
|||
* 评论数 |
|||
*/ |
|||
private Integer commentNum; |
|||
|
|||
/** |
|||
* 浏览数 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 表达态度(评论+回复+浏览) |
|||
*/ |
|||
private Integer expressAttitudeNum; |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.elink.esua.epdc.dto.topic.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 话题列表DTO |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 11:31 |
|||
*/ |
|||
@Data |
|||
public class TopicResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -1938141144074477454L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 话题摘要 |
|||
*/ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 所有部门 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 网格来源群名称 |
|||
*/ |
|||
private String groupName; |
|||
|
|||
/** |
|||
* 话题发布人姓名 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 评论数(评论+回复) |
|||
*/ |
|||
private Integer commentNum; |
|||
|
|||
/** |
|||
* 浏览数 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 表达态度(评论+回复+浏览) |
|||
*/ |
|||
private Integer expressAttitudeNum; |
|||
} |
@ -0,0 +1,205 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis</artifactId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
|
|||
<artifactId>epdc-analysis-server</artifactId> |
|||
<packaging>jar</packaging> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis-client</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-tools</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-mybatis</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework</groupId> |
|||
<artifactId>spring-context-support</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>de.codecentric</groupId> |
|||
<artifactId>spring-boot-admin-starter-client</artifactId> |
|||
<version>${spring.boot.admin.version}</version> |
|||
</dependency> |
|||
|
|||
<!-- nacos start --> |
|||
<dependency> |
|||
<groupId>com.alibaba.cloud</groupId> |
|||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
|||
</dependency> |
|||
<!-- nacos end --> |
|||
<!--版本控制--> |
|||
<dependency> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-commons-api-version-control</artifactId> |
|||
<version>${project.version}</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<finalName>${project.artifactId}</finalName> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-surefire-plugin</artifactId> |
|||
<configuration> |
|||
<skipTests>true</skipTests> |
|||
</configuration> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-deploy-plugin</artifactId> |
|||
<configuration> |
|||
<skip>true</skip> |
|||
</configuration> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>com.spotify</groupId> |
|||
<artifactId>dockerfile-maven-plugin</artifactId> |
|||
</plugin> |
|||
</plugins> |
|||
|
|||
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory> |
|||
|
|||
<resources> |
|||
<resource> |
|||
<filtering>true</filtering> |
|||
<directory>${basedir}/src/main/resources</directory> |
|||
<includes> |
|||
<include>**/application*.yml</include> |
|||
<include>**/*.properties</include> |
|||
<include>logback-spring.xml</include> |
|||
<include>registry.conf</include> |
|||
</includes> |
|||
</resource> |
|||
<resource> |
|||
<directory>${basedir}/src/main/resources</directory> |
|||
<excludes> |
|||
<exclude>**/application*.yml</exclude> |
|||
<exclude>**/*.properties</exclude> |
|||
<exclude>logback-spring.xml</exclude> |
|||
<exclude>registry.conf</exclude> |
|||
</excludes> |
|||
</resource> |
|||
</resources> |
|||
</build> |
|||
|
|||
<profiles> |
|||
<profile> |
|||
<id>dev</id> |
|||
<activation> |
|||
<activeByDefault>true</activeByDefault> |
|||
</activation> |
|||
<properties> |
|||
<spring.profiles.active>dev</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<spring.redis.index>2</spring.redis.index> |
|||
<spring.redis.host>47.104.224.45</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>elink@888</spring.redis.password> |
|||
|
|||
<nacos.register-enabled>false</nacos.register-enabled> |
|||
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>test</id> |
|||
<properties> |
|||
<spring.profiles.active>test</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<spring.redis.index>2</spring.redis.index> |
|||
<spring.redis.host>47.104.224.45</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>elink@888</spring.redis.password> |
|||
|
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>prod</id> |
|||
<properties> |
|||
<spring.profiles.active>prod</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<!-- redis配置 --> |
|||
<spring.redis.index>0</spring.redis.index> |
|||
<spring.redis.host>10.5.34.164</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>Elink@833066</spring.redis.password> |
|||
<!-- nacos --> |
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>10.5.34.164:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>prod_kongcun</id> |
|||
<properties> |
|||
<spring.profiles.active>prod</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<!-- redis配置 --> |
|||
<spring.redis.index>0</spring.redis.index> |
|||
<spring.redis.host>172.16.1.238</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>Elink833066</spring.redis.password> |
|||
|
|||
<!-- nacos --> |
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>172.16.1.238:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
|
|||
<profile> |
|||
<id>prod_shibei_aliyun</id> |
|||
<properties> |
|||
<spring.profiles.active>prod</spring.profiles.active> |
|||
|
|||
<server.port>9077</server.port> |
|||
|
|||
<!-- redis配置 --> |
|||
<spring.redis.index>0</spring.redis.index> |
|||
<spring.redis.host>172.16.0.54</spring.redis.host> |
|||
<spring.redis.port>6379</spring.redis.port> |
|||
<spring.redis.password>Elink833066</spring.redis.password> |
|||
|
|||
<!-- nacos --> |
|||
<nacos.register-enabled>true</nacos.register-enabled> |
|||
<nacos.server-addr>172.16.0.52:8848</nacos.server-addr> |
|||
</properties> |
|||
</profile> |
|||
</profiles> |
|||
|
|||
</project> |
@ -0,0 +1,31 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc; |
|||
|
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
|||
import org.springframework.cloud.openfeign.EnableFeignClients; |
|||
|
|||
/** |
|||
* 模块 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@SpringBootApplication |
|||
@EnableDiscoveryClient |
|||
@EnableFeignClients |
|||
public class AnalysisApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(AnalysisApplication.class, args); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.config; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.config.ModuleConfig; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 模块配置信息 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Service |
|||
public class ModuleConfigImpl implements ModuleConfig { |
|||
@Override |
|||
public String getName() { |
|||
return "analysis"; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.elink.esua.epdc.datasources; |
|||
|
|||
/** |
|||
* |
|||
* 增加多数据源,在此配置 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 14:50 |
|||
*/ |
|||
public interface DataSourceNames { |
|||
String FIRST = "first"; |
|||
String SECOND = "second"; |
|||
String THIRD = "third"; |
|||
String FOURTH = "fourth"; |
|||
String FIFTH = "fifth"; |
|||
String SIXTH = "sixth"; |
|||
String SEVENTH = "seventh"; |
|||
String EIGHTH = "eighth"; |
|||
String NINTH = "ninth"; |
|||
String TENTH = "tenth"; |
|||
String ELEVENTH = "eleventh"; |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.elink.esua.epdc.datasources; |
|||
|
|||
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; |
|||
|
|||
import javax.sql.DataSource; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* 动态数据源 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 14:59 |
|||
*/ |
|||
public class DynamicDataSource extends AbstractRoutingDataSource { |
|||
|
|||
private static final ThreadLocal<String> contextHolder = new ThreadLocal<>(); |
|||
|
|||
public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) { |
|||
super.setDefaultTargetDataSource(defaultTargetDataSource); |
|||
super.setTargetDataSources(targetDataSources); |
|||
super.afterPropertiesSet(); |
|||
} |
|||
|
|||
@Override |
|||
protected Object determineCurrentLookupKey() { |
|||
return getDataSource(); |
|||
} |
|||
|
|||
public static void setDataSource(String dataSource) { |
|||
contextHolder.set(dataSource); |
|||
} |
|||
|
|||
public static String getDataSource() { |
|||
return contextHolder.get(); |
|||
} |
|||
|
|||
public static void clearDataSource() { |
|||
contextHolder.remove(); |
|||
} |
|||
} |
@ -0,0 +1,111 @@ |
|||
package com.elink.esua.epdc.datasources; |
|||
|
|||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.context.annotation.Primary; |
|||
|
|||
import javax.sql.DataSource; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* 配置多数据源 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 15:04 |
|||
*/ |
|||
@Configuration |
|||
public class DynamicDataSourceConfig { |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.first") |
|||
public DataSource firstDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.second") |
|||
public DataSource secondDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.third") |
|||
public DataSource thirdDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.fourth") |
|||
public DataSource fourthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.fifth") |
|||
public DataSource fifthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.sixth") |
|||
public DataSource sixthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.seventh") |
|||
public DataSource seventhDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.eighth") |
|||
public DataSource eighthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.ninth") |
|||
public DataSource ninthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.tenth") |
|||
public DataSource tenthDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@ConfigurationProperties("spring.datasource.druid.eleventh") |
|||
public DataSource eleventhDataSource() { |
|||
return DruidDataSourceBuilder.create().build(); |
|||
} |
|||
|
|||
@Bean |
|||
@Primary |
|||
public DynamicDataSource dataSource(DataSource firstDataSource, DataSource secondDataSource, |
|||
DataSource thirdDataSource, DataSource fourthDataSource, |
|||
DataSource fifthDataSource, DataSource sixthDataSource, |
|||
DataSource seventhDataSource, DataSource eighthDataSource, |
|||
DataSource ninthDataSource, DataSource tenthDataSource, |
|||
DataSource eleventhDataSource) { |
|||
Map<Object, Object> targetDataSources = new HashMap<>(); |
|||
targetDataSources.put(DataSourceNames.FIRST, firstDataSource); |
|||
targetDataSources.put(DataSourceNames.SECOND, secondDataSource); |
|||
targetDataSources.put(DataSourceNames.THIRD, thirdDataSource); |
|||
targetDataSources.put(DataSourceNames.FOURTH, fourthDataSource); |
|||
targetDataSources.put(DataSourceNames.FIFTH, fifthDataSource); |
|||
targetDataSources.put(DataSourceNames.SIXTH, sixthDataSource); |
|||
targetDataSources.put(DataSourceNames.SEVENTH, seventhDataSource); |
|||
targetDataSources.put(DataSourceNames.EIGHTH, eighthDataSource); |
|||
targetDataSources.put(DataSourceNames.NINTH, ninthDataSource); |
|||
targetDataSources.put(DataSourceNames.TENTH, tenthDataSource); |
|||
targetDataSources.put(DataSourceNames.ELEVENTH, eleventhDataSource); |
|||
return new DynamicDataSource(firstDataSource, targetDataSources); |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.elink.esua.epdc.datasources.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* |
|||
* 多数据源注解 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 14:50 |
|||
*/ |
|||
@Target(ElementType.METHOD) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface DataSource { |
|||
String name() default ""; |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.elink.esua.epdc.datasources.aspect; |
|||
|
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.DynamicDataSource; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import org.aspectj.lang.ProceedingJoinPoint; |
|||
import org.aspectj.lang.annotation.Around; |
|||
import org.aspectj.lang.annotation.Aspect; |
|||
import org.aspectj.lang.annotation.Pointcut; |
|||
import org.aspectj.lang.reflect.MethodSignature; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.core.Ordered; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.lang.reflect.Method; |
|||
|
|||
/** |
|||
* |
|||
* 多数据源,切面处理类 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/2/9 15:12 |
|||
*/ |
|||
@Aspect |
|||
@Component |
|||
public class DataSourceAspect implements Ordered { |
|||
protected Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Pointcut("@annotation(com.elink.esua.epdc.datasources.annotation.DataSource)") |
|||
public void dataSourcePointCut() { |
|||
|
|||
} |
|||
|
|||
@Around("dataSourcePointCut()") |
|||
public Object around(ProceedingJoinPoint point) throws Throwable { |
|||
MethodSignature signature = (MethodSignature) point.getSignature(); |
|||
Method method = signature.getMethod(); |
|||
|
|||
DataSource ds = method.getAnnotation(DataSource.class); |
|||
if(ds == null){ |
|||
DynamicDataSource.setDataSource(DataSourceNames.FIRST); |
|||
logger.debug("set datasource is " + DataSourceNames.FIRST); |
|||
}else { |
|||
DynamicDataSource.setDataSource(ds.name()); |
|||
logger.debug("set datasource is " + ds.name()); |
|||
} |
|||
|
|||
try { |
|||
return point.proceed(); |
|||
} finally { |
|||
DynamicDataSource.clearDataSource(); |
|||
logger.debug("clean datasource"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public int getOrder() { |
|||
return 1; |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.elink.esua.epdc.modules.issue.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("issue") |
|||
public class IssueController { |
|||
@Autowired |
|||
private IssueService issueService; |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.issue.result.IssueResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:15 |
|||
**/ |
|||
@GetMapping("pageHottestIssue") |
|||
public Result<PageData<IssueResultDTO>> pageHottestIssue(@RequestParam Map<String, Object> params) { |
|||
PageData<IssueResultDTO> page = issueService.listHottestIssue(params); |
|||
return new Result<PageData<IssueResultDTO>>().ok(page); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.issue.result.IssueResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:15 |
|||
**/ |
|||
@GetMapping("pageLatestIssue") |
|||
public Result<PageData<IssueResultDTO>> pageLatestIssue(@RequestParam Map<String, Object> params) { |
|||
PageData<IssueResultDTO> page = issueService.listLatestIssue(params); |
|||
return new Result<PageData<IssueResultDTO>>().ok(page); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.issue.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
@Mapper |
|||
public interface IssueDao extends BaseDao<IssueResultDTO> { |
|||
/** |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:19 |
|||
**/ |
|||
List<IssueResultDTO> selectListHottestIssue(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:19 |
|||
**/ |
|||
List<IssueResultDTO> selectListLatestIssue(Map<String, Object> params); |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.modules.issue.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
public interface IssueService { |
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:16 |
|||
**/ |
|||
PageData<IssueResultDTO> listHottestIssue(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:16 |
|||
**/ |
|||
PageData<IssueResultDTO> listLatestIssue(Map<String, Object> params); |
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.elink.esua.epdc.modules.issue.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; |
|||
import com.elink.esua.epdc.modules.issue.dao.IssueDao; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 议题相关 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 16:06 |
|||
*/ |
|||
@Service |
|||
public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueResultDTO> implements IssueService { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热议题列表 |
|||
* @Date 2020/2/10 16:17 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FOURTH) |
|||
@Override |
|||
public PageData<IssueResultDTO> listHottestIssue(Map<String, Object> params) { |
|||
UserDetail userDetail= SecurityUser.getUser(); |
|||
params.put("deptIdList",userDetail.getDeptIdList()); |
|||
IPage<IssueResultDTO> page = getPage(params); |
|||
List<IssueResultDTO> list = baseDao.selectListHottestIssue(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新议题列表 |
|||
* @Date 2020/2/10 16:17 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FOURTH) |
|||
@Override |
|||
public PageData<IssueResultDTO> listLatestIssue(Map<String, Object> params) { |
|||
UserDetail userDetail= SecurityUser.getUser(); |
|||
params.put("deptIdList",userDetail.getDeptIdList()); |
|||
IPage<IssueResultDTO> page = getPage(params); |
|||
List<IssueResultDTO> list = baseDao.selectListLatestIssue(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.item.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import com.elink.esua.epdc.modules.item.service.ItemService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author yujintao yujintao@elink-cn.com |
|||
* @since v1.0.0 2019-09-04 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("item") |
|||
public class ItemController { |
|||
|
|||
@Autowired |
|||
private ItemService itemService; |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:45 |
|||
**/ |
|||
@GetMapping("pageHottestItem") |
|||
public Result<PageData<ItemResultDTO>> pageHottestItem(@RequestParam Map<String, Object> params) { |
|||
PageData<ItemResultDTO> page = itemService.listItemResultDTO(params); |
|||
return new Result<PageData<ItemResultDTO>>().ok(page); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.item.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 项目模块 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:43 |
|||
*/ |
|||
@Mapper |
|||
public interface ItemDao extends BaseDao<ItemResultDTO> { |
|||
/** |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:53 |
|||
**/ |
|||
List<ItemResultDTO> selectListHottestItemResultDTO(Map<String, Object> params); |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.elink.esua.epdc.modules.item.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 项目模块 |
|||
* |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:43 |
|||
*/ |
|||
public interface ItemService { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:46 |
|||
**/ |
|||
PageData<ItemResultDTO> listItemResultDTO(Map<String, Object> params); |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.elink.esua.epdc.modules.item.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemDao; |
|||
import com.elink.esua.epdc.modules.item.service.ItemService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 项目模块 |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 13:43 |
|||
*/ |
|||
@Service |
|||
public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemResultDTO> implements ItemService { |
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热项目列表查询 |
|||
* @Date 2020/2/10 13:47 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FOURTH) |
|||
@Override |
|||
public PageData<ItemResultDTO> listItemResultDTO(Map<String, Object> params) { |
|||
UserDetail userDetail = SecurityUser.getUser(); |
|||
params.put("deptIdList", userDetail.getDeptIdList()); |
|||
IPage<ItemResultDTO> page = getPage(params); |
|||
List<ItemResultDTO> list = baseDao.selectListHottestItemResultDTO(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
} |
@ -0,0 +1,71 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.topic.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
import com.elink.esua.epdc.modules.topic.service.TopicService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 话题相关接口 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-10-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("topic") |
|||
public class TopicController { |
|||
|
|||
@Autowired |
|||
private TopicService topicService; |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.TopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 11:34 |
|||
**/ |
|||
@GetMapping("pageHottestTopic") |
|||
public Result<PageData<TopicResultDTO>> pageHottestTopic(@RequestParam Map<String, Object> params) { |
|||
PageData<TopicResultDTO> page = topicService.listHottestTopic(params); |
|||
return new Result<PageData<TopicResultDTO>>().ok(page); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.TopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:50 |
|||
**/ |
|||
@GetMapping("pageLatestTopic") |
|||
public Result<PageData<TopicResultDTO>> pageLatestTopic(@RequestParam Map<String, Object> params) { |
|||
PageData<TopicResultDTO> page = topicService.listLatestTopic(params); |
|||
return new Result<PageData<TopicResultDTO>>().ok(page); |
|||
} |
|||
} |
@ -0,0 +1,53 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.topic.dao; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 话题表 话题表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-10-10 |
|||
*/ |
|||
@Mapper |
|||
public interface TopicDao extends BaseMapper<TopicResultDTO> { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.dto.result.TopicResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 11:52 |
|||
**/ |
|||
List<TopicResultDTO> selectListHottestTopicDTO(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.dto.result.TopicResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:51 |
|||
**/ |
|||
List<TopicResultDTO> selectListLatesttTopicDTO(Map<String, Object> params); |
|||
} |
@ -0,0 +1,49 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.topic.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 话题相关Service |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-10-10 |
|||
*/ |
|||
public interface TopicService { |
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.TopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 11:34 |
|||
**/ |
|||
PageData<TopicResultDTO> listHottestTopic(Map<String, Object> params); |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.TopicResultDTO> |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:50 |
|||
**/ |
|||
PageData<TopicResultDTO> listLatestTopic(Map<String, Object> params); |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.elink.esua.epdc.modules.topic.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.datasources.DataSourceNames; |
|||
import com.elink.esua.epdc.datasources.annotation.DataSource; |
|||
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO; |
|||
import com.elink.esua.epdc.modules.topic.dao.TopicDao; |
|||
import com.elink.esua.epdc.modules.topic.service.TopicService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 话题相关Service |
|||
* @Author yinzuomei |
|||
* @Date 2020/2/10 10:56 |
|||
*/ |
|||
@Service |
|||
public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicResultDTO> implements TopicService { |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.HottestTopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最热话题列表查询 |
|||
* @Date 2020/2/10 12:53 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FIFTH) |
|||
@Override |
|||
public PageData<TopicResultDTO> listHottestTopic(Map<String, Object> params) { |
|||
UserDetail userDetail = SecurityUser.getUser(); |
|||
params.put("deptIdList", userDetail.getDeptIdList()); |
|||
IPage<TopicResultDTO> page = getPage(params); |
|||
List<TopicResultDTO> list = baseDao.selectListHottestTopicDTO(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* @param params |
|||
* @return com.elink.esua.epdc.dto.result.LatestTopicResultDTO |
|||
* @Author yinzuomei |
|||
* @Description 最新话题列表查询 |
|||
* @Date 2020/2/10 12:53 |
|||
**/ |
|||
@DataSource(name = DataSourceNames.FIFTH) |
|||
@Override |
|||
public PageData<TopicResultDTO> listLatestTopic(Map<String, Object> params) { |
|||
UserDetail userDetail = SecurityUser.getUser(); |
|||
params.put("deptIdList", userDetail.getDeptIdList()); |
|||
IPage<TopicResultDTO> page = getPage(params); |
|||
List<TopicResultDTO> list = baseDao.selectListLatesttTopicDTO(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.utils; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|||
|
|||
/** |
|||
* 模块常量 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.1.0 |
|||
*/ |
|||
public interface ModuleConstant extends Constant { |
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.jdbc.Driver |
|||
druid: |
|||
first: #数据源1 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
second: #数据源2 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
third: #数据源3 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fourth: #数据源4 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fifth: #数据源5 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
sixth: #数据源6 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
seventh: #数据源7 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eighth: #数据源8 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
ninth: #数据源9 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
tenth: #数据源10 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eleventh: #数据源11 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
initial-size: 10 |
|||
max-active: 100 |
|||
min-idle: 10 |
|||
max-wait: 60000 |
|||
pool-prepared-statements: true |
|||
max-pool-prepared-statement-per-connection-size: 20 |
|||
time-between-eviction-runs-millis: 60000 |
|||
min-evictable-idle-time-millis: 300000 |
|||
test-while-idle: true |
|||
test-on-borrow: false |
|||
test-on-return: false |
|||
stat-view-servlet: |
|||
enabled: true |
|||
url-pattern: /druid/* |
|||
filter: |
|||
stat: |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: false |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
@ -0,0 +1,74 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.jdbc.Driver |
|||
druid: |
|||
first: #数据源1 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
second: #数据源2 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
third: #数据源3 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
fourth: #数据源4 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
fifth: #数据源5 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
sixth: #数据源6 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
seventh: #数据源7 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
eighth: #数据源8 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
ninth: #数据源9 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
tenth: #数据源10 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
eleventh: #数据源11 |
|||
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: Elink@833066 |
|||
initial-size: 10 |
|||
max-active: 100 |
|||
min-idle: 10 |
|||
max-wait: 60000 |
|||
pool-prepared-statements: true |
|||
max-pool-prepared-statement-per-connection-size: 20 |
|||
time-between-eviction-runs-millis: 60000 |
|||
min-evictable-idle-time-millis: 300000 |
|||
test-while-idle: true |
|||
test-on-borrow: false |
|||
test-on-return: false |
|||
stat-view-servlet: |
|||
enabled: true |
|||
url-pattern: /druid/* |
|||
filter: |
|||
stat: |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: false |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
@ -0,0 +1,74 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.jdbc.Driver |
|||
druid: |
|||
first: #数据源1 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
second: #数据源2 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
third: #数据源3 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fourth: #数据源4 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
fifth: #数据源5 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
sixth: #数据源6 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
seventh: #数据源7 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eighth: #数据源8 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
ninth: #数据源9 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
tenth: #数据源10 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
eleventh: #数据源11 |
|||
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
|||
username: epdc |
|||
password: elink833066 |
|||
initial-size: 10 |
|||
max-active: 100 |
|||
min-idle: 10 |
|||
max-wait: 60000 |
|||
pool-prepared-statements: true |
|||
max-pool-prepared-statement-per-connection-size: 20 |
|||
time-between-eviction-runs-millis: 60000 |
|||
min-evictable-idle-time-millis: 300000 |
|||
test-while-idle: true |
|||
test-on-borrow: false |
|||
test-on-return: false |
|||
stat-view-servlet: |
|||
enabled: true |
|||
url-pattern: /druid/* |
|||
filter: |
|||
stat: |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: false |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
@ -0,0 +1,62 @@ |
|||
server: |
|||
port: @server.port@ |
|||
servlet: |
|||
context-path: /analysis |
|||
|
|||
spring: |
|||
main: |
|||
allow-bean-definition-overriding: true |
|||
application: |
|||
name: epdc-analysis-server |
|||
# 环境 dev|test|prod |
|||
profiles: |
|||
active: @spring.profiles.active@ |
|||
messages: |
|||
encoding: UTF-8 |
|||
basename: i18n/messages,i18n/messages_common |
|||
jackson: |
|||
time-zone: GMT+8 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
|||
redis: |
|||
database: @spring.redis.index@ |
|||
host: @spring.redis.host@ |
|||
timeout: 30s |
|||
port: @spring.redis.port@ |
|||
password: @spring.redis.password@ |
|||
cloud: |
|||
nacos: |
|||
discovery: |
|||
server-addr: @nacos.server-addr@ |
|||
register-enabled: @nacos.register-enabled@ |
|||
alibaba: |
|||
seata: |
|||
tx-service-group: epdc-analysis-server-fescar-service-group |
|||
|
|||
management: |
|||
endpoints: |
|||
web: |
|||
exposure: |
|||
include: "*" |
|||
endpoint: |
|||
health: |
|||
show-details: ALWAYS |
|||
|
|||
mybatis-plus: |
|||
mapper-locations: classpath:/mapper/**/*.xml |
|||
#实体扫描,多个package用逗号或者分号分隔 |
|||
typeAliasesPackage: com.elink.esua.epdc.modules.*.entity |
|||
global-config: |
|||
#数据库相关配置 |
|||
db-config: |
|||
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; |
|||
id-type: UUID |
|||
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" |
|||
field-strategy: NOT_NULL |
|||
#驼峰下划线转换 |
|||
column-underline: true |
|||
banner: false |
|||
#原生配置 |
|||
configuration: |
|||
map-underscore-to-camel-case: true |
|||
cache-enabled: false |
|||
call-setters-on-nulls: true |
@ -0,0 +1 @@ |
|||
#Default |
@ -0,0 +1 @@ |
|||
#English |
@ -0,0 +1 @@ |
|||
#\u7B80\u4F53\u4E2D\u6587 |
@ -0,0 +1 @@ |
|||
#\u7E41\u4F53\u4E2D\u6587 |
@ -0,0 +1 @@ |
|||
#Default |
@ -0,0 +1 @@ |
|||
#English |
@ -0,0 +1 @@ |
|||
#\u7B80\u4F53\u4E2D\u6587 |
@ -0,0 +1 @@ |
|||
#\u7E41\u4F53\u4E2D\u6587 |
@ -0,0 +1,159 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<configuration> |
|||
<include resource="org/springframework/boot/logging/logback/base.xml"/> |
|||
|
|||
<property name="log.path" value="logs/analysis"/> |
|||
|
|||
<!-- 彩色日志格式 --> |
|||
<property name="CONSOLE_LOG_PATTERN" |
|||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
|||
|
|||
<!--1. 输出到控制台--> |
|||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
|||
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
|||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
|||
<level>debug</level> |
|||
</filter> |
|||
<encoder> |
|||
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
|||
<!-- 设置字符集 --> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
</appender> |
|||
|
|||
<!--2. 输出到文档--> |
|||
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
|||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/debug.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 日志归档 --> |
|||
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录debug级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>debug</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
|||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/info.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 每天日志归档路径以及格式 --> |
|||
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录info级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>info</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
|||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/warn.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录warn级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>warn</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
|||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/error.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录ERROR级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>ERROR</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 开发、测试环境 --> |
|||
<springProfile name="dev,test"> |
|||
<logger name="org.springframework.web" level="INFO"/> |
|||
<logger name="org.springboot.sample" level="INFO"/> |
|||
<logger name="com.elink.esua.epdc" level="INFO"/> |
|||
<logger name="com.elink.esua.epdc.dao" level="DEBUG"/> |
|||
<root level="INFO"> |
|||
<appender-ref ref="DEBUG_FILE"/> |
|||
<appender-ref ref="INFO_FILE"/> |
|||
<appender-ref ref="WARN_FILE"/> |
|||
<appender-ref ref="ERROR_FILE"/> |
|||
</root> |
|||
</springProfile> |
|||
|
|||
<!-- 生产环境 --> |
|||
<springProfile name="prod"> |
|||
<logger name="org.springframework.web" level="ERROR"/> |
|||
<logger name="org.springboot.sample" level="ERROR"/> |
|||
<logger name="com.elink.esua.epdc" level="ERROR"/> |
|||
<root level="ERROR"> |
|||
<appender-ref ref="CONSOLE"/> |
|||
<appender-ref ref="DEBUG_FILE"/> |
|||
<appender-ref ref="INFO_FILE"/> |
|||
<appender-ref ref="WARN_FILE"/> |
|||
<appender-ref ref="ERROR_FILE"/> |
|||
</root> |
|||
</springProfile> |
|||
|
|||
</configuration> |
@ -0,0 +1,106 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.issue.dao.IssueDao"> |
|||
<!-- 最热议题列表 --> |
|||
<select id="selectListHottestIssue" resultType="com.elink.esua.epdc.dto.issue.result.IssueResultDTO"> |
|||
SELECT |
|||
ei.ID, |
|||
ei.ISSUE_CONTENT, |
|||
ei.ALL_DEPT_NAMES, |
|||
ei.NICK_NAME, |
|||
ei.CREATED_TIME, |
|||
ee.APPROVE_NUM, |
|||
ee.OPPOSE_NUM, |
|||
ee.COMMENT_NUM, |
|||
ee.BROWSE_NUM, |
|||
( ee.COMMENT_NUM + ee.BROWSE_NUM + ee.APPROVE_NUM + ee.OPPOSE_NUM ) AS expressAttitudeNum |
|||
FROM |
|||
esua_epdc_events.epdc_issue ei |
|||
LEFT JOIN esua_epdc_events.epdc_events ee ON ee.ID = ei.EVENT_ID |
|||
AND ee.DEL_FLAG = '0' |
|||
<if test="issueContent != null and issueContent != ''"> |
|||
AND ei.ISSUE_CONTENT LIKE CONCAT('%',#{issueContent},'%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (ei.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and ei.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
WHERE |
|||
ei.DEL_FLAG = '0' |
|||
AND ei.ISSUE_STATE IN ( 0, 2 ) |
|||
ORDER BY |
|||
expressAttitudeNum DESC |
|||
</select> |
|||
|
|||
<!-- 最新议题列表 --> |
|||
<select id="selectListLatestIssue" resultType="com.elink.esua.epdc.dto.issue.result.IssueResultDTO"> |
|||
SELECT |
|||
ei.ID, |
|||
ei.ISSUE_CONTENT, |
|||
ei.ALL_DEPT_NAMES, |
|||
ei.NICK_NAME, |
|||
ei.CREATED_TIME, |
|||
ee.APPROVE_NUM, |
|||
ee.OPPOSE_NUM, |
|||
ee.COMMENT_NUM, |
|||
ee.BROWSE_NUM, |
|||
( ee.COMMENT_NUM + ee.BROWSE_NUM + ee.APPROVE_NUM + ee.OPPOSE_NUM ) AS expressAttitudeNum |
|||
FROM |
|||
esua_epdc_events.epdc_issue ei |
|||
LEFT JOIN esua_epdc_events.epdc_events ee ON ee.ID = ei.EVENT_ID |
|||
AND ee.DEL_FLAG = '0' |
|||
<if test="issueContent != null and issueContent != ''"> |
|||
AND ei.ISSUE_CONTENT LIKE CONCAT('%',#{issueContent},'%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (ei.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and ei.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
WHERE |
|||
ei.DEL_FLAG = '0' |
|||
AND ei.ISSUE_STATE IN ( 0, 2 ) |
|||
ORDER BY |
|||
expressAttitudeNum DESC,CREATED_TIME desc |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,53 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.item.dao.ItemDao"> |
|||
<select id="selectListHottestItemResultDTO" resultType="com.elink.esua.epdc.dto.item.result.ItemResultDTO"> |
|||
SELECT |
|||
ei.id, |
|||
ei.ITEM_CONTENT, |
|||
ei.ALL_DEPT_NAMES, |
|||
ei.GRID, |
|||
ei.NICK_NAME, |
|||
ei.CREATED_TIME AS releaseTime, |
|||
ee.APPROVE_NUM, |
|||
ee.OPPOSE_NUM, |
|||
ee.COMMENT_NUM, |
|||
ee.BROWSE_NUM, |
|||
(ee.APPROVE_NUM + ee.OPPOSE_NUM + ee.COMMENT_NUM + ee.BROWSE_NUM ) AS expressAttitudeNum |
|||
FROM |
|||
epdc_item ei |
|||
LEFT JOIN epdc_events ee ON ( ei.EVENT_ID = ee.ID ) |
|||
WHERE |
|||
ei.DEL_FLAG = '0' |
|||
AND ee.DEL_FLAG = '0' |
|||
<if test='searchContent != null and searchContent != ""'> |
|||
AND ei.ITEM_CONTENT LIKE CONCAT('%',#{searchContent},'%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (ei.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and ei.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
ORDER BY expressAttitudeNum DESC |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,96 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.topic.dao.TopicDao"> |
|||
<!-- 最热话题列表查询 --> |
|||
<select id="selectListHottestTopicDTO" resultType="com.elink.esua.epdc.dto.topic.result.TopicResultDTO"> |
|||
select |
|||
et.ID, |
|||
et.TOPIC_CONTENT, |
|||
et.ALL_DEPT_NAMES, |
|||
et.GRID, |
|||
et.GROUP_NAME, |
|||
et.NICKNAME, |
|||
et.CREATED_TIME as releaseTime, |
|||
et.COMMENT_NUM, |
|||
et.BROWSE_NUM, |
|||
et.COMMENT_NUM+et.BROWSE_NUM as expressAttitudeNum |
|||
from epdc_topic et |
|||
where et.DEL_FLAG='0' |
|||
and et.STATE='0' |
|||
<if test="topicContent != null and topicContent != ''"> |
|||
and et.TOPIC_CONTENT like concat('%', #{topicContent}, '%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (et.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and et.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
order by expressAttitudeNum desc |
|||
</select> |
|||
|
|||
<!-- 最新话题列表查询 --> |
|||
<select id="selectListLatesttTopicDTO" resultType="com.elink.esua.epdc.dto.topic.result.TopicResultDTO"> |
|||
select |
|||
et.ID, |
|||
et.TOPIC_CONTENT, |
|||
et.ALL_DEPT_NAMES, |
|||
et.GRID, |
|||
et.GROUP_NAME, |
|||
et.NICKNAME, |
|||
et.CREATED_TIME as releaseTime, |
|||
et.COMMENT_NUM, |
|||
et.BROWSE_NUM, |
|||
et.COMMENT_NUM+et.BROWSE_NUM as expressAttitudeNum |
|||
from epdc_topic et |
|||
where et.DEL_FLAG='0' |
|||
and et.STATE='0' |
|||
<if test="topicContent != null and topicContent != ''"> |
|||
and et.TOPIC_CONTENT like concat('%', #{topicContent}, '%') |
|||
</if> |
|||
<if test="streetId != null and streetId != ''"> |
|||
AND (find_in_set(#{streetId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{streetId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="communityId != null and communityId != ''"> |
|||
AND (find_in_set(#{communityId},et.PARENT_DEPT_IDS) |
|||
OR find_in_set(#{communityId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="gridId != null and gridId != ''"> |
|||
AND (et.GRID_ID = #{gridId} |
|||
OR find_in_set(#{gridId},et.ALL_DEPT_IDS)) |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) >=#{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) <=#{endTime} |
|||
</if> |
|||
<if test="deptIdList!=null and deptIdList.size()>0"> |
|||
and et.GRID_ID in |
|||
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|||
#{deptId} |
|||
</foreach> |
|||
</if> |
|||
order by expressAttitudeNum desc,releaseTime desc |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,21 @@ |
|||
registry { |
|||
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa |
|||
type = "nacos" |
|||
|
|||
nacos { |
|||
serverAddr = "@nacos.server-addr@" |
|||
namespace = "public" |
|||
cluster = "default" |
|||
} |
|||
} |
|||
|
|||
config { |
|||
# file、nacos 、apollo、zk、consul、etcd3 |
|||
type = "nacos" |
|||
|
|||
nacos { |
|||
serverAddr = "@nacos.server-addr@" |
|||
namespace = "public" |
|||
cluster = "default" |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<parent> |
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-module</artifactId> |
|||
<version>1.0.0</version> |
|||
</parent> |
|||
|
|||
<groupId>com.esua.epdc</groupId> |
|||
<artifactId>epdc-analysis</artifactId> |
|||
<packaging>pom</packaging> |
|||
|
|||
<modules> |
|||
<module>epdc-analysis-client</module> |
|||
<module>epdc-analysis-server</module> |
|||
</modules> |
|||
|
|||
</project> |
@ -0,0 +1,36 @@ |
|||
package com.elink.esua.epdc.enums; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|||
|
|||
/** |
|||
* 党员注册认证状态枚举类 |
|||
* |
|||
* @author work@yujt.net.cn |
|||
* @date 2020/2/5 17:37 |
|||
*/ |
|||
public enum PartyMemberRegFlagEnum { |
|||
|
|||
/** |
|||
* 未注册 |
|||
*/ |
|||
NO(NumConstant.ZERO_STR), |
|||
/** |
|||
* 自动匹配认证(通过完善信息接口) |
|||
*/ |
|||
AUTO(NumConstant.ONE_STR), |
|||
/** |
|||
* 手动认证(PC端待认证居民列表页面操作) |
|||
*/ |
|||
MANUAL(NumConstant.TWO_STR); |
|||
|
|||
|
|||
private String value; |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
|
|||
PartyMemberRegFlagEnum(String value) { |
|||
this.value = value; |
|||
} |
|||
} |
Loading…
Reference in new issue